runtime: an issue may omit trailing optional operands

e28cf86 made timestep_embed's curve `table` an optional WEIGHT operand but left the
arity check demanding exact equality with the schema, so every sinusoidal issuer —
qwenimage21, minimaxh3's full-form path — died at step 0: engine_e2e_test has been red
since that commit. The check now accepts a count at or above the last REQUIRED operand
and nulls the dropped schema slots, which is what rad_abi.h promises ("an absent
optional operand is a null RadTensor.data") and what every shim already branches on
(r4d_opt(), rad_args_have(), libref's finish(); the curve kernel still requires the
table when curve > 0). Only TRAILING optionals: an omitted optional before a required
operand would shift positions, which is the miscount the check exists to catch.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
gearwave00001andClaude committed 2026-10-22 00:57:42 -05:00
1 parent d480a47bef
commit 80b13b49d8
3 files changed
+31 -6

No files matched your search

+8 -2
View File
@@ -76,8 +76,14 @@ struct OpPlan {
int32_t n_bands = 0;
int32_t plan_off = 0; /* into Ctx::issue_table_, band * RAD_N_DOMAINS + domain */
/* The schema's operand count, cached so the arity check avoids a cold OpInfo. -1 when the op
* has no schema. */
int32_t n_opd_schema = -1;
* has no schema. The arity check also stores here the count with the schema's *trailing*
* optional operands dropped (rad_abi.h: "an absent optional operand is a null
* RadTensor.data"): an issue may stop at n_opd_required and the shims -- r4d_opt(),
* rad_args_have(), libref's finish() -- already branch on exactly that. Only trailing
* optionals; an omitted optional before a required operand shifts positions and is the
* miscount the check exists to catch. */
int32_t n_opd_schema = -1;
int32_t n_opd_required = -1;
bool issued = false; /* did the run phase ever issue it (spec §16's graph dump) */
/* Whether issuing it puts bytes on the interconnect. Set at bind from the resolved rows
* (rad_kernel_collective) and the conventional all_reduce. The weight stager's copies share