Skip to content

Bundle 3: registry facades and zero-unsafe UATs for zstd, libarchive, freetype, glfw - #3664

Merged
ehartford merged 8 commits into
mainfrom
bundle3-facades
Nov 27, 2026
Merged

ehartford merged 8 commits into
mainfrom
bundle3-facades

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #3136
Closes #3140
Closes #3155
Closes #3158

Summary

Bundled registry facades and supporting compiler/toolchain fixes verified under a single seed-driven battery:

Compiler & Toolchain Fixes

  1. render.with / CiFacts.with / CiFacadeDraft.with:
    • Preserve unsafe qualifier when rendering NK_TYPE_FN and NK_TYPE_EXTERN_FN AST nodes so facade wrappers returning raw C function pointers (e.g. glfwSetKeyCallback returning Option[unsafe extern "C" fn(...)]) match C's CALLABLE_UNSAFE type (§16.11).
    • Carry callback_thread free-function stanzas from registry facts.with into drafted contracts.
    • Skip auto-drafting unassigned fn/from stanzas that take a C record wrapped by multiple registry resources (fd_is_ambiguous_record), avoiding ambiguous contract drafts while keeping explicitly assigned of <Resource> stanzas and bzip2's BZFILEHandle intact.
  2. ConanClient.with:
    • Skip CMake imported target names (ZLIB::ZLIB) that leak into generated .pc Libs.private fields (the dependency is already in requires).
    • Collect Apple SDK .tbd libraries from installed CMake INTERFACE_LINK_LIBRARIES (e.g. libhvf.tbd linked by FreeType 2.15.0 on macOS) when omitted from .pc files.

Registry Facades & Zero-Unsafe UATs

  • c.zstd (#3136): registry/c/zstd/facts.with (CCtx, DCtx, CDict, DDict, one-shot/context/dictionary compression & decompression) + uat/zstd.uat + uat/fixtures/zstd_main.with (pass: 7 steps, 25.9s).
  • c.libarchive (#3140): registry/c/libarchive/facts.with (ArchiveReader, ArchiveWriter, archive_write_disk_new, filters/formats, entry I/O) + uat/libarchive.uat + uat/fixtures/libarchive_main.with (write .tar.gz + .zip, read .tar.gz, extract to disk; pass: 7 steps, 82.2s).
  • c.freetype (#3155): registry/c/freetype/facts.with (Library, Face, version, charmap/glyph/kerning/render operations) + uat/freetype.uat + uat/fixtures/freetype_main.with (self-contained ASCII BDF font, Library.init, new_face, select_size, char_index, load_char(FT_LOAD_RENDER), strict Face/Library teardown; pass: 7 steps, 29.9s).
  • c.glfw (#3158): registry/c/glfw/facts.with (Window, Cursor, headless windowing, input queries, stateless callbacks) + uat/glfw.uat + uat/fixtures/glfw_main.with (headless GLFW_PLATFORM_NULL, Window.create, error/key/framebuffer callbacks, size/key queries, glfwPollEvents, clean Window/Terminate teardown; pass: 7 steps, 28.4s).

Verification

  • Targeted UATs (zstd, libarchive, freetype, glfw, bzip2 regression check): ALL PASS
  • Seed-driven battery (WITH=$PWD/src/main with run tools/battery.with): starting now; verdict will be posted before marking ready.

@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery GREEN on fa478508b (WITH=$PWD/src/main with run tools/battery.with):

  • Verdict: out/battery/battery.log: rc=0 green (wall=256s, fixpoint verified)
  • behavior-tests: 2349/2349 ok
  • native-compile-error-tests: 2208/2208 ok
  • internals-tests: 144/144 ok
  • contract-view-tests: 19/19 fixtures ok
  • battery-uat: all UATs green, including the 4 new zero-unsafe UATs (zstd, libarchive, freetype, glfw) and sqlite3

@ehartford
ehartford marked this pull request as ready for review November 27, 2026 22:25
@ehartford
ehartford merged commit 3be0a97 into main Nov 27, 2026
1 check passed
@ehartford
ehartford deleted the bundle3-facades branch November 27, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant