Skip to content

fix(component): skip indirect-call-table modules — stop silent miscompile (closes #196, v1.1.12)#197

Merged
avrabe merged 1 commit into
mainfrom
fix/196-skip-indirect-table-modules
Jun 10, 2026
Merged

fix(component): skip indirect-call-table modules — stop silent miscompile (closes #196, v1.1.12)#197
avrabe merged 1 commit into
mainfrom
fix/196-skip-indirect-table-modules

Conversation

@avrabe

@avrabe avrabe commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

CRITICAL — gale #196: flight-control silent miscompile

v1.1.11's #172 encoding fix made falcon's core module 0 encode validly, which unmasked a worse pre-existing defect: loom's optimization of a module with a function-referencing element segment produces valid-but-wrong code. The fused pass changes function indices across several sub-passes but only remaps the call_indirect table in one; the parse→re-encode round-trip corrupts further. Output passes wasm-tools validate and loom --verify (both structural) yet flies wrong — falcon SIL run-position-hold 0.13 m → 593.8 m. v1.1.10 was accidentally safe (invalid → fallback); v1.1.11 removed the accident.

Fix (correctness — prime directive)

Behavioral verification is the only thing that catches this, and loom has none. So per "skip rather than risk incorrect": skip optimization of any core module with a function-referencing element segment, keeping original bytes — in both optimize_core_module (component) and optimize_module (standalone). Restores v1.1.10's safe behavior deliberately. #172's segment-count fix is retained (real, just insufficient).

Validation (behavioral, not just structural)

falcon-flight-v1.34.wasm optimized output now matches the original bit-for-bit under wasmtime: run-stabilization 0.023399856, run-position-hold 0.1317415 (was 0.329 / 593.79); validates. New tests: detection + per-slot remap identity. 395 lib + 85 integration pass.

Limitation / next

Indirect-call-table modules are now unoptimized (safe). Re-enabling is gated on a behavioral differential in loom CI (run exports before/after, compare) — structural --verify is insufficient, as #196 proved.

Known-red (pre-existing)

Closes #196.

🤖 Generated with Claude Code

…op silent miscompile (closes #196)

CRITICAL — flight-control silent miscompile. v1.1.11's #172 encoding fix
made falcon's core module 0 encode validly, unmasking a worse pre-existing
defect: loom's optimization of a module with a function-referencing element
segment produces VALID-BUT-WRONG code. The fused pass changes function
indices across several sub-passes but only remaps the call_indirect table
in one of them, and the parse→re-encode round-trip has further corruption.
Output passes wasm-tools validate AND loom --verify (both structural) yet
flies wrong: falcon SIL run-position-hold 0.13m → 593.8m. v1.1.10 was
ACCIDENTALLY safe (invalid → fallback); v1.1.11 removed that accident.

Behavioral verification — not structural — is the only thing that catches
this, and loom has none. Per the prime directive ("skip rather than risk
incorrect"), skip optimization of any core module with a function-
referencing element segment, keeping the original bytes, in BOTH the
component path (optimize_core_module) and the standalone path
(optimize_module). Restores v1.1.10's safe behavior deliberately. #172's
segment-count fix is retained (real, just insufficient).

Verified on falcon-flight-v1.34.wasm: optimized output now matches the
original bit-for-bit under wasmtime — run-stabilization 0.023399856,
run-position-hold 0.1317415 (was 0.329 / 593.79 on v1.1.11); validates.
New tests: element_section_references_functions detection + per-slot
element-remap identity. 395 lib + 85 integration pass.

Limitation: indirect-call-table modules are now unoptimized (safe);
re-enabling is gated on a behavioral differential in loom (#196).

Bumps 1.1.11 -> 1.1.12.

Closes #196.

Trace: REQ-5
@avrabe avrabe merged commit 983c619 into main Jun 10, 2026
@avrabe avrabe deleted the fix/196-skip-indirect-table-modules branch June 10, 2026 18:41
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.

v1.1.11 element remap scrambles the function-pointer table — valid-but-wrong code, falcon SIL gate fails (0.13m → 593.8m)

1 participant