Add a multi-field differential for qualified ungated construction - #804
Merged
Conversation
The fail-closed demotion scan for multi-field records canonicalizes qualified construct-site spellings through the flatten alias map, but no test would go red if that canonicalization regressed: the existing multi-field coverage has no ungated construct. Add the multi-field twin of the single-field three-way differential: a dep module declares a bounded two-field Coord record, the entry constructs it with a qualified spelling and a beyond-i64 value, and the printed value must match the VM on carrier-enabled wasm-gc and under AVER_NO_PACKED_SEQUENCES=1 (demotion, not a trap at the construct bridge). Also trim the spelling before the alias lookup in canonical_spelling, matching TypeRegistry::canonical_type_name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ified-demotion-differential
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 a review-identified coverage gap from #803: the multi-field demotion scan's alias-aware canonicalization (
multi_field_record_demotions, Scan 1) had no test that would go red if it regressed — the existing multi-field test has no ungated construct.qualified_ungated_multi_field_constructor_demotes_instead_of_trappingintests/wasm_gc_packed_sequence.rs, the multi-field twin ofqualified_ungated_constructor_demotes_instead_of_truncating: a dep module declares a bounded two-fieldCoordrecord, the entry constructs it with a qualified spelling (Dep.Coord(...)) and a beyond-i64 value, and the printed value must match the VM on carrier-enabled wasm-gc and underAVER_NO_PACKED_SEQUENCES=1(demotion, not truncation/trap).canonical_spellinginsrc/codegen/proof_lower/mod.rsnow trims the spelling before the alias lookup, matchingTypeRegistry::canonical_type_name.Red-check: with the multi-field scan's canonicalization locally reverted to raw-spelling comparison, the new test FAILS — the carrier-enabled leg traps (
wasm 'unreachable' instruction executed) at the construct bridge instead of demoting. Restored, the whole file passes (5/5).Tests run: the new test, the single-field twin, both cross-module same-bare-name soundness regressions (
..._does_not_inherit_packed_layout,..._does_not_inherit_carrier_i64_erasure),cargo test --lib packed_sequence+bare_i64,cargo fmt --check, clippy on the touched targets.🤖 Generated with Claude Code