[ BENCHMARKS / v5.0 / TASKS / 163_bigint_divmod_e ]
Big-integer divide/mod (Knuth Algorithm D, base 2^32) in Rust.
Multi-precision division with remainder over arrays of 32-bit limbs, implemented as Knuth’s Algorithm D, with two of its internal step counters reported for every case.
- Unit
163_bigint_divmod_e- Category
- Algorithms & DSMulti-precision arithmetic
- Language
- Rust
- Difficulty
- Hard900 s wall clock (15 min)
- Origin
- New in v5
- Ranked rows passed
- 3/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_divmod/divmod.rs: multi-precision division with remainder of unsigned integers stored as little-endian arrays of 32-bit limbs (base b = 2^32), implemented as Knuth's Algorithm D (TAOCP vol. 2, sec. 4.3.1).
Input (stdin): line 1 is T. Each case is three lines: 'LU LV', then the LU limbs of u, then the LV limbs of v (decimal, each 0..4294967295, least-significant limb first, space-separated). Arrays may carry high-order zero limbs; v is never zero; 1 <= LU, LV <= 2000; T <= 3000.
Output (stdout), exactly three lines per case, in input order:
1. the limbs of q = floor(u / v)
2. the limbs of r = u mod v
(both least-significant first, space-separated, no high-order zero limbs, zero printed as 0)
3. two integers 'D3 D6': counters from your run of Algorithm D under exactly this convention:
- Drop high-order zero limbs. Let n = number of limbs of v and m = (number of limbs of u) - n. If n = 1 or m < 0, print '0 0'.
- Otherwise normalize: shift u and v left by s bits, where s (0 <= s <= 31) is the number of leading zero bits of v's top limb. u always gains one extra top limb u[m+n] (it is 0 when s = 0). Quotient digits are produced for j = m, m-1, ..., 0, and u[] below means the normalized, progressively updated dividend.
- For each j: qhat = floor((u[j+n]*b + u[j+n-1]) / v[n-1]) and rhat is the remainder of that division. While qhat >= b or qhat*v[n-2] > b*rhat + u[j+n-2]: decrease qhat by 1, add 1 to D3, add v[n-1] to rhat, and leave the loop if rhat >= b.
- D6 counts the j for which the multiply-and-subtract step goes negative, so that the quotient digit must be decreased once more and v added back.
D3 and D6 are totals for the case.
The hidden tests are thousands of seeded, adversarial cases, including operands of about 2000 limbs; the whole input must be processed within 6 s of CPU time. Example: sample_input.txt -> sample_output.txt in /tmp/eval_divmod.
Rust, std only (no crates). Build: rustc -O -o divmod divmod.rsWhat it tests and why it is in the suite
What it asks. Multi-precision division with remainder over arrays of 32-bit limbs, implemented as Knuth’s Algorithm D, with two of its internal step counters reported for every case.
Why it is here. A new family, ported to all six languages. With the Pike-VM regex it carries Algorithms & DS: the v4 families 71 and 20 were left out because every v4 variant writes its expected outputs into the agent’s directory, and their rework did not clear review.
The same problem in 6 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:133 · evals/README.md:158
How it is graded
The validator holds its checks where the agent cannot read them, and runs them against what the agent left on disk once it stops. Its hidden cases are generated inside the validator from a seed; any worked sample the prompt names is only a sample, and no expected output for a hidden case is in the agent’s directory. Before any model ran it, the unit was proven: its reference solution passes, plausible wrong solutions fail for the reason declared in advance, an empty solution and a leak probe fail, and, where the unit is timed, a slow solution fails by the validator’s own limit. The family also went through up to three adversarial review rounds, in which an independent verifier tried to pass every unit without solving it.
- 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 boardFailedDid not pass the validator.
One RTX 5090
- Inkling 2 Mini#4 on the boardFailedDid not pass the validator.
- Inkling 2 Mini Derisked#5 on the boardFailedDid not pass the validator.
- Inkling 2 Mini SC117 abliterated#6 on the boardFailedDid not pass the validator.
- Qwen3.8 27B Uncensored MTP#7 on the boardPassedPassed the validator.
Gold standard · unranked
- Claude Opus 5.5Claude Code tools, no turn cap, 2× wallPassedPassed the validator.