Conversation
The indirect half of #1785. A call_indirect with a 64-bit argument was refused (#929: "a call_indirect has no per-type width table"), so a Rust-built component calling through a vtable or closure with an i64 parameter could not be compiled. - The decoder's per-TYPE masks (type_params_i64, lumped i64/f64 like func_params_i64, plus type_params_f32/f64) reach DecodedModule, CompileConfig, the CLI's --all-exports path and the ARM backend, which hands them to the selector (set_callee_type_params). - The call_indirect arm lays its core arguments out with the SAME plan as a direct call: pop_call_args, call_arg_marshal (aapcs_param_layout), call_nsaa_bytes for the outgoing area, one sequentialized parallel move, stack stores before preservation. Widths come from indirect_call_arg_widths(type). - Caller/callee agreement: the decoder copies func_params_i64[f] from type_params_i64[type of f], the callee prologue homes params with aapcs_param_layout over that mask, and the table guard admits only a callee of the same structural type class. - Still refused by name: a type with any f32/f64 param stays all-narrow (no indirect AAPCS-VFP), so its i64 is refused (#929) or the float op declines first; an absent table (hand-built streams, the .wast merge) refuses any 64-bit operand (#929). Evidence: crates/synth-oracle/tests/i64_call_args_1785.rs gains two call_indirect tests (105 hosted steps on 3 --relocatable legs, the hosted harness now writing the funcref table at R11 per the embedder ABI; 35 self-contained --cortex-m steps). Every module refused with #929 on main c0bd12a. Byte identity: 882 of 882 compiled outputs identical over 307 inputs x 4 legs. claims.yaml: selector_lines_code 21566 -> 21620 waived, total 32725 -> 32820. oracle-kiln.yml: two new exact ORACLE pins, result-line counts. Three CLI decline fixtures that used the now-compiling shape are moved to a decline that stays. Refs #1785 Refs #929 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
The census function pins move by exactly one export per ARM leg: arm_m4f 1482 -> 1481, arm_m7dp 1387 -> 1386 (unpinned arm 1556 -> 1555). left-to-right.wast `i64_call_indirect` makes a call_indirect with i64 arguments and is now marshalled from the per-type width table; its f32/f64 twins stay skipped. spec_exec_1636 executes its assert_return on both legs (35787 -> 35789 executed directives, both pass). No file bucket moves. Base binary c0bd12a measures exactly the old pins. Existing Python pin edited (SKIPPED_FUNCTION_PINS), and its claims.yaml binding. Refs #1785 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
`scripts/mutation_survey.py reanchor`: 19 sites moved, 0 not found (four arm_backend.rs R1-routing sites the CI subset named, +7 lines each). Line numbers only. Refs #1785 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
avrabe
force-pushed
the
v092-callindirect-i64-1785
branch
from
December 5, 2026 06:25
f9372c2 to
175d03d
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The audit on this branch (run 47488868774) printed functions audited 7941 (was 7937) and attributed instructions 245570 (was 245462); homes watched 9435 and hits 0 are unchanged, RESULT: PASS. The pins move because more functions compile, not because the audit found anything. Refs #1785 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
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.
Refs #1785
Refs #929
What
#1791 passed i64 call arguments per AAPCS for direct calls only. It refused
call_indirectwith #929, because no per-type width table reached the selector. So a Rust-built component that calls through a vtable or a closure with an i64 parameter could not be compiled. This PR is that missing half.type_params_i64(i64 and f64 lumped, likefunc_params_i64) and the per-type f32/f64 masks. They now reachDecodedModule,CompileConfig, the CLI's--all-exportspath andarm_backend. The backend passes them to the selector withset_callee_type_params, next toset_callee_params_i64.call_indirectarm uses the direct call's plan unchanged:pop_call_args, thencall_arg_marshal(aapcs_param_layout),call_nsaa_bytesto size the outgoing area, one sequentialized parallel move, and stack stores before caller-saved preservation. Only the widths differ:indirect_call_arg_widths(type)replacescall_arg_widths(func). The table-index relocation (call_indirect with a non-zero table index dispatches through the wrong table (spec call_indirect.wast m1, wrong callee, exit 0); elem.wast call_in_table executes an invalid instruction — multi-table should loud-decline #1211) already protects everyreg_movessource, and that now includes both halves of each i64.func_params_i64[f]as a copy oftype_params_i64[type of f](wasm_decoder.rs, function section). The callee prologue homes its params withaapcs_param_layoutover that mask (instruction_selector.rs:2400). The table guard admits only a callee of the same structural type class: the closed-world verdict, or the runtime type-id check (call_indirect_guards, call_indirect into a HETEROGENEOUS funcref table (mixed signatures) loud-declines — needs a runtime type-id check; the terminal layer of falcon's dispatch (20 funcs) #676). So the caller's mask is the callee's mask..wastmerge, which declines everycall_indirectanyway.call_indirectby name (thumb-2: call_indirect emits no bounds-check and no type-check — OOB/wrong-type index does an uncontrolled indirect branch instead of trapping (WASM 4.4.8) #642), so it falls back to the direct selector. The self-contained--cortex-mimage dispatches through its flash table in that same arm, so it is covered. Both are executed below.Evidence
i64_call_indirect_args_hosted_1785(new): 7 signatures × 5 steps on cortex-m4, cortex-m3 and cortex-m7--relocatable, kiln vs unicorni64_call_indirect_args_self_contained_1785(new):--cortex-mimage on cortex-m4call_arg_marshalspec_exec_1636_differential.pyi64_call_indirect, which passes)selector_parity_197reinterpret_pair_1603_differential.pyarm_corpus_sweep_973home_alias_audit_corpus_1189wrong_code_censusspec_compile_census.pyskipped functionsscripts/repro,tests/,examples/; .wat/.wasm/.wast) × 4 legs (m4--relocatable, m4--cortex-m, m7dp--relocatable, m3--relocatable)The sweep corpus contains no i64-argument
call_indirect, so it is identical everywhere. The new behaviour is covered by the oracle modules, which main refuses.The signatures are (i64, i32), (i32, i64) with R1 skipped, (i64, i64, i64) with the third on the stack, four i32 then an i64 (stacked), an i64 then four i32 (two stacked), and two with an i32 result. Each module's table holds a decoy of the same type in slot 0.
p_indcomputes the table index at run time, so the index sits in a register while the arguments move. The two potency mutants were built from this tree with one line changed and run asSYNTH; the source was restored and checked by sha. Those steps stay green under a swap because both words are equal (all-ones or zero vectors) or because no i64 is passed in a register or on the stack in that signature.Harness. The hosted harness used to refuse any module with a table. A new opt-in,
HostConfig::funcref_tables, plays the embedder's table step: it writes the funcref tables atR11 + 0in the #650 layout fromdocs/embedder-abi-relocatable-arm.md, asfunc_N | 1. It refuses imported tables, non-const offsets, entries that are not plainref.func, and tables that mix types.value::funcref_table_imagebuilds the image and has a unit test.Gates (local, head dc750c4)
cargo fmt --checkcargo +1.100.0 clippy --workspace --all-targets -D warnings-p synth-oracle --features exec --all-targets -D warningscargo test -p synth-core/-p synth-synthesis/-p synth-backendcargo test -p synth-cli --no-fail-fastfrozen_codegen_bytes10 passed)oracle-kiln.yml"kiln oracles" step, run block executed whole (CARGO_TERM_COLOR=always)claim_check.py claims.yaml--emit-statuscommittedworkflow_strict_check.pyfmt, clippy, claims and the census ran on dc750c4. The other rows ran on 940a28a; dc750c4 changes only the census pin and its ledger line.
Ledger
claims.yaml:selector_lines_code21566 -> 21620 (+54), with a waiver bound to 21620. That covers the per-type tables, the setter andindirect_call_arg_widths; no second lowering and no wildcard arm.selector_lines_total32725 -> 32820 (+54 code, +41 for the new selector unit test). The census pin binding is updated too..github/workflows/oracle-kiln.yml: two new exact ORACLE pins.i64_call_args_1785now reports 5 passed, so "5 passed" occurs 2 times and "3 passed" 8 times. The lib unit count goes 31 -> 32. The ordinal comments are renumbered.scripts/spec_compile_census.py: an existing Python pin was edited (SKIPPED_FUNCTION_PINS). No new Python.i64_call_arg_decline_929.rs,skipped_export_exit_952.rsandexport_alias_symbols_1746.rsused the i64call_indirectshape as a "still declines" fixture. That shape now compiles, soi64_call_arg_decline_929.rsasserts it is emitted and pins the remaining residual: f32 beside i64 on cortex-m4f gives [CRITICAL] thumb-2 silently miscompiles any call with an i64 parameter that is not last — args land in the wrong registers, exit 0, no warning #929. The other two use an f32 op on cortex-m3 instead.artifacts/planning-v0.92-draft.yaml: RQ-92-I64ARGS records the indirect half and the remaining residual.Not in this PR
call_indirectwhose type has f32/f64 params (GI-FPU-002 still declines it).--func-namewithout--relocatable) does not get the per-type table, and it does not getfunc_params_i64either. It makes no difference there: that path refuses any call before marshalling (a direct call because of its relocation, andcall_indirectbecause there is no table image). This was probed on main and on this branch with the same refusal.--relocatable --func-namegoes through the module path and compiles both shapes.#518/#837callee-prologue residual from ARM: marshal i64 call arguments in AAPCS register pairs and on the stack #1791 is unchanged. The oracle's callees start withcall $nopfor the same reason.🤖 Generated with Claude Code
https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L