Repository navigation
hy-check(buildable): rust/sha3 pinned crate call-arity + spread rejection (Row 13 BUILDABLE) - #4355
Open
gorky117-cell wants to merge 2 commits into
Conversation
… (Row 13 BUILDABLE) Both members of \ ust/sha3\ blessed in foreign.rs are now arity-checked at hyb check time against the pinned Rust crate descriptors: - \sha3.digest256(data)\: exactly 1 argument - \sha3.stream_checksum(iters, seed)\: exactly 2 arguments Invocations with missing or excessive arguments fail-closed with HYB-E1002 instead of escaping to emitter / build errors (Row 13 BUILDABLE). Spread calls (\...\) on non-variadic members are strictly guarded from day one. Dedicated regression test suite covers exact arity acceptance, underflow/overflow rejection, spread rejection, local shadowing, and actionable error messages. Signed-off-by: Gaurav Kumar Singh <gauravatwork117@gmail.com>
…into fix/sha3-pinned-crate-call-arity-soundness Signed-off-by: gauravatwork117 <gauravatwork117@gmail.com>
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.
Soundness & Specification Context (Row 13 BUILDABLE)
Under GUARANTEES.md Row 13 (BUILDABLE):
In
compiler/crates/hy-check/src/buildable.rs, foreign calls to the M5/M6 curated pinned Rust craterust/sha3(sha3) completely bypassed call arity validation and spread argument constraints.Calls with missing or extra arguments:
sha3.digest256()(expects 1 argumentdata, accepts 0 or 2+)sha3.stream_checksum()(expects 2 argumentsiters, seed, accepts 0, 1, or 3+)passed
hyb checkwith zero diagnostics (Verdict::Accept), only to fail downstream at emission/compilation time with:Technical Solution
Foreign Package Call Dispatch (
buildable.rsline 8370):(pkg == "sha3" || pkg == "rust/sha3") && self.lookup_kind(pkg).is_none()tocheck_sha3_package_call.sha3retain their local semantics.foreign.rs: strictly matches the Spec M6 pinned Rust surface.Exact Arity Enforcement:
sha3.digest256: exactly 1 argument (data).sha3.stream_checksum: exactly 2 arguments (iters, seed).HYB-E1002, providing actionable error messages naming expected count and actual argument count....on non-variadic calls withHYB-E1002.Hermetic Regression Test Battery (
tests/sha3_member_arity_buildable_soundness.rs):sha3andrust/sha3imports), arity underflow rejection, arity overflow rejection, spread rejection, local shadowing preservation, and actionable error messages.Verification & Repository Hygiene
python tools/check_conflict_markers.py: nonepython tools/check_test_registration.py: OK (40 test file(s), 36 discovery pattern(s))python tools/check_guarantees.py: OK (table, registry, corpus and doc agree)python tools/check_corpus_census.py: OK (all 7 corpus census surfaces agree)7cf29833), 0 behind, single atomic commit.Bounty Settlement Coordinates
@gorky117-cell/gauravatwork117 <gauravatwork117@gmail.com>kumarsinghgaurav@gmail.com