Skip to content

fix: memory64, GC struct/array refs, misc validation#162

Merged
avrabe merged 1 commit intomainfrom
fix/wast-conformance-batch5
Mar 17, 2026
Merged

fix: memory64, GC struct/array refs, misc validation#162
avrabe merged 1 commit intomainfrom
fix/wast-conformance-batch5

Conversation

@avrabe
Copy link
Collaborator

@avrabe avrabe commented Mar 17, 2026

Summary

  • Memory64 (~934 tests): MemArg.offset u64, i64 addressing in all load/store/bulk ops, memory.size/grow i64 support
  • GC struct/array (~70 tests): Arc<Mutex<>> heap-backed refs, DefaultMemoryProvider fix, BrOnCast flag handling
  • Misc validation (~15 tests): unreachable code stack, custom page sizes, BrOnNull/BrOnNonNull multi-value

Test plan

  • All 13 memory64 test files pass (5,902 assertions)
  • array.wast: 5→38, struct.wast: 7→17, br_on_cast: +16
  • unreached-valid.wast: fully passing
  • Full WAST suite: 63,806 → 64,820 (98.7%), total 65,642 assertions verified

Trace: skip

🤖 Generated with Claude Code

…code

Memory64 support (~934 tests):
- Change MemArg.offset from u32 to u64
- Add read_leb128_u64 for offset parsing
- Accept i64 addresses in all load/store/bulk memory ops
- memory.size/grow return/accept i64 for memory64 memories
- Handle i64 data segment offsets
- Cap initial allocation to prevent OOM on huge memory64 modules

GC struct/array reference semantics (~70 tests):
- Use Arc<Mutex<>> for shared heap-backed struct/array references
- Fix DefaultMemoryProvider to use heap-backed Vec in std mode
- Add GcStorageType::RefType/RefTypeNull for concrete type indices
- Fix BrOnCast/BrOnCastFail null handling flags
- Fix ArrayNewDefault element type defaults

Misc validation (~15 tests):
- Fix unreachable code stack handling for ref.is_null, ref.as_non_null, br_on_null
- Fix select validation in unreachable code
- Fix custom page size validation (only exponents 0 and 16 valid)
- Fix BrOnNull/BrOnNonNull multi-value branch handling
- Add page_size compatibility check for memory imports

WAST conformance: 63,806 → 64,820 passed (+1,014), 1,836 → 822 failed.
Total assertions verified: 65,642 (unchanged — no tests skipped).

Trace: skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit a98613e into main Mar 17, 2026
14 checks passed
@avrabe avrabe deleted the fix/wast-conformance-batch5 branch March 17, 2026 05:35
@github-actions
Copy link

🔍 Build Diagnostics Report

Summary

Metric Base Branch This PR Change
Errors 0 0 0
Warnings 2 2 0

🎯 Impact Analysis

Issues in Files You Modified

  • 0 new errors introduced by your changes
  • 0 new warnings introduced by your changes
  • 0 total errors in modified files
  • 0 total warnings in modified files
  • 0 files you modified

Cascading Issues (Your Changes Breaking Other Files)

  • 0 new errors in unchanged files
  • 0 new warnings in unchanged files
  • 0 unchanged files now affected

Note: "Cascading issues" are errors in files you didn't modify, caused by your changes (e.g., breaking API changes, dependency issues).

✅ No Issues Detected

Perfect! Your changes don't introduce any new errors or warnings, and don't break any existing code.


📊 Full diagnostic data available in workflow artifacts

🔧 To reproduce locally:

# Install cargo-kiln
cargo install --path cargo-kiln

# Analyze your changes
cargo-kiln build --output json --filter-severity error
cargo-kiln check --output json --filter-severity warning

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