feat: cross-target bit-exact for IGLA RACE ternary MAC + gen-backend findings - #1880
Merged
Conversation
…findings Applies the GF-T trainer's multi-target discipline to IGLA RACE. verify_igla_race.py emits ternary_mul/ternary_mac (the multiplier-free R-SI-1 MAC primitives) from specs/igla/race/ternary_mac.t27 to C and Rust via t27c and cross-checks against an independent reference over 800 vectors incl. edges (a=-128 sign-flip wrap, invalid codes, i32 edges): C == Rust == reference bit-exact. Verified the guard catches a corrupted sign-flip (161 mismatches). Finding: the FULL spec does NOT emit compilable C/Rust -- gen-c chokes on slice .len() (ternary_dot) and emits test functions twice; gen-rust emits serde derives (unavailable) + a non-Copy struct moved twice. The tool reports this and verifies the core by extracting decode/mul/mac. Finding: seal math_math-igla-primitives.json exists but specs/math/igla_primitives.t27 is absent from the tree. Wired into emit-bitexact-gate (SKIPs if cc/rustc/t27c absent). Refs #1764 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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.
Applies the GF-T trainer's multi-target discipline to IGLA RACE.
verify_igla_race.pyemitsternary_mul/ternary_mac(the multiplier-free R-SI-1 MAC primitives, {-1,0,+1} weights) fromspecs/igla/race/ternary_mac.t27to C and Rust via t27c and cross-checks against an independent reference over 800 vectors incl. edges (a=-128 sign-flip wrap, invalid codes, i32 edges): C == Rust == reference bit-exact. Guard verified (161 mismatches on a corrupted sign-flip).Findings surfaced by the harness: (1) the FULL spec does NOT emit compilable C/Rust — gen-c chokes on slice
.len()(internary_dot) + emits test functions twice; gen-rust emitsserdederives (unavailable) + a non-Copy struct moved twice. So RACE's spec→any-target holds for the arithmetic core but not the whole spec. (2) sealmath_math-igla-primitives.jsonexists but sourcespecs/math/igla_primitives.t27is absent from the tree (imported by coder/arch.t27). Wired into emit-bitexact-gate. Refs #1764