[ BENCHMARKS / v5.0 / TASKS / 122_gemm_blocked_e ]
Cache-blocked matrix multiply (GEMM) in Zig.
A cache-blocked double-precision matrix multiply up to N = 2048 inside a CPU-time limit, in the multiply’s own code: only the language’s standard runtime may be linked.
- Unit
122_gemm_blocked_e- Category
- Performance & HW OptCache locality
- Language
- Zig
- Difficulty
- Hard900 s wall clock (15 min)
- Origin
- From v4, upgraded
- Zig stratum
- In samplea retained unit the pack could have been shaped on
- Ranked rows passed
- 5/7single seed each
The prompt
The agent receives exactly this text as its task, verbatim. The harness adds its own system prompt and, in some campaign arms, guidance of its own; the harness chapter describes those. The task’s setup also writes the files its working directory starts with (a worked sample, a repository or a service, where the prompt names them); they are not reproduced here.
Create /tmp/eval_gemm/gemm.zig. Read one line from stdin: 'N seed' (1 <= N <= 2048, 1 <= seed < 2^31 - 1). Build the two N x N input matrices from the Lehmer generator x_0 = seed, x_t = (48271 * x_(t-1)) mod (2^31 - 1): A[i][k] = x_(i*N + k + 1) / (2^31 - 1) and B[k][j] = x_(N*N + k*N + j + 1) / (2^31 - 1) (0-based i, j, k; the division in IEEE double precision). Compute C = A * B in double precision. Output N lines; line i holds two numbers: S_i = sum over j of C[i][j]^2 and M_i = max over j of C[i][j], each printed with at least 12 significant digits (graded with a relative tolerance of 1e-9). Grading runs hidden seeds and sizes, including N = 2048, which must finish within 12 s of CPU time, user + system summed over every thread (20 s of wall time at most). The multiply must be your own code: the program may link only the language's standard runtime, and loading or linking any other library (a BLAS such as Accelerate or OpenBLAS, or anything through dlopen) fails the run. The program must run as a single process: it may use threads, but starting any other process fails the run. /tmp/eval_gemm/sample_input.txt and /tmp/eval_gemm/sample_output.txt are a worked sample (N = 4). Target Zig 0.16.0. Compile with `zig build-exe -O ReleaseFast gemm.zig`.What it tests and why it is in the suite
What it asks. A cache-blocked double-precision matrix multiply up to N = 2048 inside a CPU-time limit, in the multiply’s own code: only the language’s standard runtime may be linked.
Why it is here. A v4 family in five compiled languages (no Python), upgraded for v5: seeded hidden tests in the validator, no expected-output files for them, no Zig tutoring, and a guard against calling a vendor BLAS.
Its stratum. One of three in-sample Zig units: retained units the Zig language pack could have been shaped on. Reading a pack’s effect separately on held-out and in-sample units shows whether it carries knowledge or memorises. Held-out and in-sample
The same problem in 5 languages. Each port is its own unit and asks the same question; SOLVE counts the problem once, and LANG counts how far a solution carried across its ports.
In the suite README: evals/README.md:134
How it is graded
The validator holds its test cases where the agent cannot read them, and runs them against what the agent left on disk once it stops. Since the upgrade its cases are generated from a seed and no expected output for them is in the agent’s directory (the worked sample the prompt names is only a sample); a mismatch reports only the failing case’s index. The unit was proven like the new ones (reference passes; wrong, empty, leaking and, where timed, slow solutions fail) and passed the same adversarial review.
- Time. The agent has 900 s of wall clock (hard tier) before an arm’s scaling; at the wall it is stopped and whatever is on disk is validated. Any time limit in the prompt applies to the program itself.
- Verdict. Pass or fail, from the validator alone. A unit the integrity scan finds contaminated is withheld and counts as not passed; a unit lost to infrastructure is rerun, and one still lost counts as not passed.
- Scoring. SCORE is 0.75 × SOLVE + 0.25 × LANG over the whole suite, with hard problems weighted above medium ones. Scoring and ranking
Upstream: the prover’s controls · one unit’s life cycle · why v5 is built this way
How each ranked run did
One run per board row, the DGX Spark pair first, then the RTX 5090, then the gold standard. Each is a single seed: a pass or a fail on one unit is one draw, and a difference between two rows on one unit says little on its own. Claude Opus 5.5 is the unranked reference, in its own scaffold.
DGX Spark pair
- DeepSeek-V4.1-Flash#1 on the boardPassedPassed the validator.
- Hy4-flash#2 on the boardPassedPassed the validator.
- GLM-5.3-Flash#3 on the boardPassedPassed the validator.
One RTX 5090
- Inkling 2 Mini#4 on the boardPassedPassed the validator.
- Inkling 2 Mini Derisked#5 on the boardFailedDid not pass the validator.
- Inkling 2 Mini SC117 abliterated#6 on the boardPassedPassed the validator.
- Qwen3.8 27B Uncensored MTP#7 on the boardFailedDid not pass the validator.
Gold standard · unranked
- Claude Opus 5.5Claude Code tools, no turn cap, 2× wallPassedPassed the validator.