test(backend-cpu): golden parity gate for packed encodings + golden-parity CI leg (SKEEP-003 S0.9) - #1049
Merged
Conversation
…tical decode/kernel/TurboQuant digests, dispatch parity, CI leg (SKEEP-003 S0.9) Guards the packed-encoding system bit-for-bit across the SKEEP-003 migration (milestone M0, #1001): - goldenTest source set (compiled into jvmTest and the Kotlin/Native test targets): PackedDecodeGoldenTest (Q4_0, Q5_0, Q5_1, Q8_0, Q4_K, Q5_K, Q6_K block decoders; ternary from values and from a TQ2_0 block), ScalarKernelGoldenTest (the seven scalar reference matmul kernels), TurboQuantGoldenTest (codes, scales, decoded vector for polar-3/4 and polar-4 + QJL). Seeded inputs (xorshift64*), FNV-64 digest over raw float bits plus head values, recorded in Goldens.kt; verified identical on JVM and linuxX64. JS/Wasm are excluded by construction (double-precision Float). - commonTest PackedMatmulDispatchParityTest (every target): all seven encodings through ops.matmul(x, ops.transpose(w)) vs an FP32 reference from the decoded weight, 5e-3 relative (SIMD / Q8-activation tiers, #944). - CI: new build.yml matrix leg `golden-parity` = apiCheck + the golden and parity tests on jvm + linuxX64 (apiCheck was required by the contributing docs but never run in CI). - scripts/pr-gate.sh --golden mode; contributing docs section on the gate. Closes #1005 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
📖 Documentation Preview The documentation has been built successfully for this PR. Generated Files:
Artifacts:
This comment will be updated automatically when the PR is updated. |
aharakal
approved these changes
Aug 22, 2026
This was referenced Aug 22, 2026
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.
Summary
SKEEP-003 slice S0.9 (milestone M0 #1001): the packed-encoding golden parity gate that every later memory-architecture slice must keep green.
skainet-backends/skainet-backend-cpu/src/goldenTest/, compiled intojvmTestand the Kotlin/Native test targets):PackedDecodeGoldenTest(block decoders of Q4_0 / Q5_0 / Q5_1 / Q8_0 / Q4_K / Q5_K / Q6_K, ternary from values and from a TQ2_0 block),ScalarKernelGoldenTest(the seven scalar reference matmul kernels),TurboQuantGoldenTest(codes, scales, decoded vector; polar-3/4, polar-4+QJL). Seeded inputs (xorshift64*, sane FP16 scales), FNV-64 digest over the raw float bits + head values recorded inGoldens.kt(26 digests). Verified identical on JVM and linuxX64. JS/Wasm are excluded by construction (double-precisionFloat).commonTest, every target):PackedMatmulDispatchParityTest— all seven encodings throughops.matmul(x, ops.transpose(w))vs an FP32 reference from the decoded weight, 5e-3 relative (SIMD / Q8-activation tiers, Q4_K/Q6_K parity tests compare the ggml-faithful int8 (block_q8_K) native kernels against exact-float scalar references — divergence is intended activation-quant loss, not a bug #944). Fills the Q4_0/Q8_0/Q5_0/Q5_K gaps of the existingPackedMatmulDispatchTest.build.ymlmatrix leggolden-parity=apiCheck+ the golden/parity tests on jvm + linuxX64 (a few minutes, fails early).apiCheckwas required by the contributing docs but never run in CI.scripts/pr-gate.sh --goldenmode; contributing docs section (build-from-source.adoc) on the gate and how to re-baseline intentionally.A benchmark baseline table (
StorageBenchmarks+ JMH matmul/elementwise/reductions, this machine) follows as a docs-only commit underdocs/design/memory/once the run finishes — it is informational, no code change.Re-baselining
Goldens.ktis a deliberate act: only in a PR that intentionally changes decoder/kernel numerics, stated in the PR.Test plan
Full local gate on b7573a5 (JDK 25):
jvmTest✔ ·apiCheck✔ ·verifyNpmPins jsTest wasmJsTest wasmWasiTest✔ ·linuxX64Test✔ ·assemble✔ ·:skainet-test:skainet-test-java:test✔. Golden tests: 26/26 on JVM, 26/26 on linuxX64; parity 7/7 on every target. New CI leg visible in this PR's checks.Closes #1005
🤖 Generated with Claude Code