ci: run the kernel host-KAT gates on every PR (lane K, F8) - #963
Merged
Conversation
The device kernels' known-answer tests — make test-blake3-host-kat and make test-rpx-host-kat — compile the real .cu sources as host C++ through the Track G shim and run them against external vectors and the committed oracle tables in seconds, with no CUDA and no cargo. They lived in no workflow: gpu-tests.yml runs on merge_group only, so a kernel edit that broke a hash reached the merge queue before anything noticed. A new host-kat job on a plain ubuntu runner runs both, plus make test-blake3-second-source (upstream BLAKE3's portable C with a parameterised round loop against the committed 6-round tables and the Python oracle — the check on the TABLES the host-KAT trusts, which also had no workflow). The job joins the Test gate's needs so the pins gate merges. Locally all three pass from a cold target dir in 2.5 s, 1.3 s and 3.1 s.
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.
Lane K follow-up F8: the kernel host-KAT gates run on every PR.
Why
make test-blake3-host-katandmake test-rpx-host-katcompile the real.cusources as host C++ throughcrypto/math-cuda/tests/host_kat/cuda_host_shim.hand run them against external vectors (official BLAKE3, miden-crypto RPO) and the committed oracle tables — g++ only, no CUDA, no cargo, seconds. They were in no workflow:gpu-tests.ymlruns onmerge_grouponly, so an edit toblake3.cuorrpx.cuthat broke a hash reached the merge queue before anything noticed.What changes
One file,
.github/workflows/pr_main.yaml:host-kat(Host KAT (kernel pins),ubuntu-latest, sameif:as the other jobs,actions/checkout@v4only — no Rust setup, no caches), three steps:make test-blake3-host-kat(7-round and 6-round arms);make test-rpx-host-kat(permutation, leaf sponge, parent, the seven leaf kernels and both Merkle compressors replayed through the shim);make test-blake3-second-source— the check on the TABLES the BLAKE3 host-KAT trusts (upstream BLAKE3's portable C with a parameterised round loop vs the committed 6-round vectors and the Python oracle). Included because it is the same class of gate, it also lived in no workflow, and every input it needs is tracked (thoughts/blake3/reference-impl/{driver.c,upstream/*},thoughts/blake3/blake3-oracle/*,crypto/crypto/src/hash/blake3/vectors.rs);ccandpython3are on the runner. Drop the step if the scope should stay at the two host-KATs.Testgate:host-katadded toneeds, its result echoed and checked like the others, so the pins gate merges rather than merely run.No Makefile change: all three targets exist at the tip (
test-rpx-host-katsince #952's merge).Evidence
Local, from a cold
target/host_kat, laptop (clang, M-series):git statusclean afterwards (the reference binaries are gitignored). YAML parsed with Ruby'sYAML.load_file: jobslint, test-executor, test-cli, host-kat, test, test-disk-spill, test-stark-cuda-lib, build-prover-tests, test-prover, test-prover-comprehensive, seed-elf-cache;test.needs=test-executor, test-cli, test-prover, test-disk-spill, test-stark-cuda-lib, host-kat.Prediction
Job wall time 30–60 s: about 7 s of work locally, 1.5–3× that under g++ on the runner (≤ 20 s for the three steps), plus checkout and runner start-up. It should be the shortest job in the workflow by an order of magnitude; the gate's critical path is unchanged.
Not covered
Arithmetic only. nvcc acceptance, register pressure and execution stay with
gpu-tests.ymlonmerge_group.