Repository navigation
c.bzip2: complete registry facade, D243 capacity/of(param N), and zero-unsafe UAT (#3138) - #3656
Merged
Merged
Conversation
Contributor
Author
|
Seed-driven verification on
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3138.
Summary
Delivers a complete, source-cited registry facade for
[email protected](23 of 24 public functions presented safely; onlyBZ2_bzReadGetUnusedstays raw, with its reason explained), along with two small mission-settled contract-language extensions (D243) and a zero-unsafe, zero-project-facade UAT exercising all three bzip2 APIs.Changes
buffer param P capacity param L [elements](withoutinout): pairs a writable pointerP(*mut) with a by-value integer capacityL, rendering[]mut u8(or[]mut Twithelements) with pre-call count overflow checking and returning C's own return value (BZ2_bzread,BZ2_bzRead,gzread,read, etc.). Refuses*constpointers.of R(param N): hosts a lend operation on resourceRreceivingselfat parameterN(defaulting to parameter 0 when omitted), paralleling D209'sdrop/destroys/abandon f(param N)(BZ2_bzRead,BZ2_bzWrite).docs/spec/031_contract-language.md,docs/spec/016_ffi.md, and recordeddocs/meetings/2026-11-27-D243-buffer-capacity-and-of-param.md.c.bzip2:FacadeRender.facade_render_deps: skip buffer-paired, fixed, and discarded parameters (matchingSemaFacade.facade_param_receives) soBZ2_bzReadOpen'svoid *unusedbuffer is not mistaken for an ambiguous*mut BZFILE(*mut c_void) resource parameter.SemaFacade.apply_facade_dependency_effects: project parent parameter indices past omittedfixed/discarded/buffer_lenparameters (BZ2_bzReadOpen/BZ2_bzWriteOpenhaveparam 0 discardedbeforeFILE *fat param 1).src/CiFacts.with,src/CiFacadeDraft.with):drop/destroys F(param N)) or multiple resources over one C record (ReadStream,WriteStreambesideBZFILEHandleover*mut BZFILE) andfnstanzas carryingof R[(param N)],buffer param ...,param N discarded,param N fixed ...,ok ...,returns static CStr, andlend.registry/c/bzip2/facts.with+ expanded UAT (uat/bzip2.uat,uat/fixtures/bzip2_main.with):Compressor/Decompressor(BZ2_bzCompressInit/Compress/End,BZ2_bzDecompressInit/Decompress/End),ReadStream/WriteStream(BZ2_bzReadOpen/Read/Close,BZ2_bzWriteOpen/Write/Close/Close64),BZ2_bzBuffToBuffCompress/Decompress, andBZFILEHandle(BZ2_bzread/write/errorbeside auto-provenBZ2_bzopen/bzdopen/flush/closeandBZ2_bzlibVersion).uat/bzip2.uatand expandeduat/fixtures/bzip2_main.withto exerciseBZ2_bzBuffToBuffCompress/Decompress,Compressor/Decompressorstream loop, andWriteStream/ReadStreamon a real file viaCFile.fopenwith zerounsafe.test/behavior/behav_3138_buffer_capacity_and_of_param.with,test/compile_errors/err_3138_buffer_capacity_const.with, andtest/compile_errors/err_3138_of_param_wrong_type.with.err_c_facade_buffer_capacity_no_inout.withanderr_c_facade_buffer_inout_len_not_ptr.withfor D243's settled diagnostics.Verification
with get c.bzip2:facade bzip2: 24 functions, 23 presented safely, 1 raw(BZ2_bzReadGetUnused),bzip2 UAT passed.:release-checkspending (will be posted below before marking ready).