Skip to content

c.zlib: complete registry facade and remove UAT inline contract (#3135) - #3657

Merged
ehartford merged 1 commit into
mainfrom
c-zlib-facade-3135
Nov 27, 2026
Merged

ehartford merged 1 commit into
mainfrom
c-zlib-facade-3135

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #3135.

Summary

  • registry/c/zlib/facts.with: Expanded registry facts to cover the full safe public zlib.h 1.4 surface (67/88 functions presented safely, up from 34/88; the 21 genuinely unmodeled/internal/unsafe functions are documented in the header comments):
    • Deflater lends: deflateSetDictionary (buffer param 1 len param 2), deflateReset, deflateResetKeep, deflateParams, deflateTune, deflateBound, deflateBound_z, deflatePrime.
    • Inflater lends: inflateSetDictionary (buffer param 1 len param 2), inflateSync, inflateReset, inflateReset2, inflateResetKeep, inflatePrime, inflateMark, inflateSyncPoint, inflateUndermine, inflateValidate, inflateCodesUsed.
    • One-shot utility fns: compress, compress_z, compress2, compress2_z, uncompress, uncompress_z (buffer param 0 capacity param 1 inout, buffer param 2 len param 3, ok Z_OK).
    • GzFileS fns: gzread (buffer param 1 capacity param 2), gzwrite (buffer param 1 len param 2), gzputs, gzungetc (of GzFileS(param 1)), gzerror (param 1 discarded, returns borrow CStr from param 0).
    • Checksum & error string fns: adler32, adler32_z, crc32, crc32_z (buffer param 1 len param 2), zError (returns static CStr).
  • src/CiFacts.with: Carry returns borrow CStr from param N clauses from registry fn stanzas into generated package contracts.
  • uat/zlib.uat & uat/fixtures/zlib_main.with: Removed the inline project contract override (src/contracts/zlib.with) and expanded the zero-unsafe UAT fixture to exercise one-shot compress/uncompress, Deflater/Inflater streaming (deflateInit2/deflate/inflateInit2/inflate), gzip file I/O (GzFileS.gzopen/gzwrite/gzgetc/gzungetc/gzread/gzerror), crc32/adler32, zlibVersion, and zError.

Verification

  • with-stage1 uat zlib: pass (7 steps, 16.0s, facade zlib: 88 functions, 67 presented safely, 21 raw).
  • Targeted behavior tests (behav_3138_buffer_capacity_and_of_param, behav_c_facade_facts_verify, behav_zlib_facade_roundtrip): 3/3 pass.
  • Seed-driven battery + :release-checks pending before marking ready.

@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery and :release-checks are GREEN on b17792602:

  • Battery (WITH=$PWD/src/main with run tools/battery.with): rc=0, wall=808s (out/battery/battery.log: rc=0 green), including uat: zlib without any inline contract.
  • Release checks (src/main build :release-checks): wall=611.1s, stage2 == stage3 over all 16 units, all 6 rt-bundle-fixpoint, all 8 wo-drift, EMIT-C OK, EMIT-C FIXPOINT, survey: all targets green.

Marking ready and merging.

@ehartford
ehartford marked this pull request as ready for review November 27, 2026 16:43
@ehartford
ehartford merged commit 94195e2 into main Nov 27, 2026
1 check passed
@ehartford
ehartford deleted the c-zlib-facade-3135 branch November 27, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Registry facade for c.zlib (compression): complete, reviewed, with a zero-unsafe UAT

1 participant