Skip to content

ci: ARM oracle job + integer-kernel bit-exactness gate (closes #1081) - #1083

Merged
JustVugg merged 1 commit into
devfrom
ci/arm-oracle
Aug 18, 2026
Merged

ci: ARM oracle job + integer-kernel bit-exactness gate (closes #1081)#1083
JustVugg merged 1 commit into
devfrom
ci/arm-oracle

Conversation

@JustVugg

Copy link
Copy Markdown
Owner

Closes #1081.

What

  1. tests/test_int_kernel_exact.c β€” integer kernels have no rounding excuse: against a pure-C reference on the same inputs they must match bit for bit, on every ISA. Covers dot_i4i8, the planarize_i4 round-trip, dot_i4p_u (K1 plane layout, the βˆ’8Β·sum(x) identity), and matmul_i4p_idot vs matmul_i4_idot bitwise. 2,176 checks, 0 failures on x86 (avx-vnni branch live).
  2. oracle-arm job (ubuntu-24.04-arm, timeout-bounded per ci: stop running every dev commit twice, and bound every jobΒ #953's direction): builds every engine β€” NEON compile coverage; K1's dot_i4p_u NEON branch had never been compiled by anyone β€” runs the exactness gate with the NEON branches live, and replays the glm_tiny teacher-forcing oracle against a fixture generated on the same runner (same-machine torch reference, no cross-ISA float excuses).
  3. The x86 efficiency job now runs the same exactness gate, so both ISAs hold the same bar.

The test found a real contract on day one

The first draft generated full-range int8 activations and produced 30 false failures against the shipped dot_i4i8: x = βˆ’128. The abs/sign VNNI trick cannot represent βˆ’(βˆ’128), and qrow_i8 clamps to [βˆ’127,127] β€” so βˆ’128 never reaches the kernels in production. The test now encodes that contract explicitly, with a comment: it is the kind of invariant that only exists in people's heads until a test writes it down.

Deliberately deferred

deepseek-v4-tiny-check on ARM β€” its ARCH/PORTABLE_ARCH plumbing needs checking for aarch64 first. qwen36's tiny gate joins when #712 lands (its author's review is what surfaced this class β€” credit @kreuzzelg).

⚠️ Note for review: this PR is also the first time K1's NEON branch compiles anywhere. If the ARM job fails on it, that is the job doing its work β€” the fix lands here.

πŸ€– Generated with Claude Code

Every tiny-oracle job ran on x86, so NEON branches were never compiled,
let alone executed β€” which is how the olmoe (#1044) / qwen36 (#712
review) / inkling (#1080) IDOT class shipped undetected.

Two additions:

1. tests/test_int_kernel_exact.c β€” integer kernels have no rounding
   excuse: against a pure-C reference on the same inputs they must match
   bit for bit on every ISA. Covers dot_i4i8 (pair int4xint8),
   planarize_i4 round-trip, dot_i4p_u (K1 plane layout, the -8*sum(x)
   identity), and matmul_i4p_idot vs matmul_i4_idot bitwise. The test
   encodes the real activation contract: qrow_i8 clamps to [-127,127],
   and -128 must never reach the kernels (the abs/sign VNNI trick cannot
   represent its negation) β€” the first draft generated full-range int8
   and produced 30 false failures against the SHIPPED kernel, which is
   the contract documenting itself.

2. An ubuntu-24.04-arm job (timeout-bounded per #953's direction):
   builds every engine (NEON compile coverage β€” K1's dot_i4p_u NEON
   branch had never been compiled by anyone), runs the exactness gate
   with the NEON branches live, and replays the glm_tiny teacher-forcing
   oracle against a fixture generated on the same runner (same-machine
   torch reference, no cross-ISA float excuses).

The x86 efficiency job also runs the exactness gate, so both ISAs hold
the same bar. deepseek-v4 tiny-check on ARM is follow-up (its ARCH
plumbing needs checking for aarch64 first).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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