Skip to content

Add a multi-field differential for qualified ungated construction - #804

Merged
jasisz merged 2 commits into
mainfrom
test/multi-field-qualified-demotion-differential
Aug 7, 2026
Merged

Add a multi-field differential for qualified ungated construction#804
jasisz merged 2 commits into
mainfrom
test/multi-field-qualified-demotion-differential

Conversation

@jasisz

@jasisz jasisz commented Aug 7, 2026

Copy link
Copy Markdown
Owner

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.

  • New three-way differential qualified_ungated_multi_field_constructor_demotes_instead_of_trapping in tests/wasm_gc_packed_sequence.rs, the multi-field twin of qualified_ungated_constructor_demotes_instead_of_truncating: a dep module declares a bounded two-field Coord record, 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 under AVER_NO_PACKED_SEQUENCES=1 (demotion, not truncation/trap).
  • canonical_spelling in src/codegen/proof_lower/mod.rs now trims the spelling before the alias lookup, matching TypeRegistry::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

jasisz and others added 2 commits August 7, 2026 19:39
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>
@jasisz
jasisz merged commit 9341ab5 into main Aug 7, 2026
35 checks passed
@jasisz
jasisz deleted the test/multi-field-qualified-demotion-differential branch August 7, 2026 19:23
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.

1 participant