code wiki / _hdl_build / nx_retry_policy_gate.nx
nx_retry_policy_gate.nx
buildroot/runtime/_hdl_build/nx_retry_policy_gate.nx
about
nx_retry_policy_gate.nx -- TEETH FOR THE RETRY PRIMITIVE, written because its jitter was ADVERTISED AND
INERT and nothing could see it.
THE DEFECT (measured 2026-08-21, vocabulary census): nx_retry_policy_new set `p.jitter_enabled = 1`
while nx_retry_compute_wait_seconds performed NO randomization -- its own comment said "v1 uses
deterministic mid-jitter (multiply by 1.0)". A caller reading the flag believed the herd was
decorrelated while every retry landed on the same instant. It failed in the FLATTERING direction, so
nobody investigated, and the organ had NO GATE AT ALL -- the two facts are the same fact.
THE TOOTH THAT MATTERS IS T2, AND IT IS BUILT TO FAIL AGAINST THE OLD CODE: two DIFFERENT callers
drawing at the SAME instant must get DIFFERENT delays. Under the 1.0-multiplier version they get the
same number, so T2 goes RED on the pre-fix source by construction -- that is what makes the GREEN worth
anything. Every other tooth here would have passed before the fix.
No files, no fixtures, no clock: the subject is pure arithmetic and the seed is explicit, so this gate
is idempotent and cannot share a fixture with a production beat.
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_retry_policy.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 23 | const RG_SEEDS: i64 = 64 |
| 27 | const RG_ATTEMPT: i64 = 3 |
| 28 | const RG_NOW: i64 = 1787000000 |
functions
| 30 | func rg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 } called by 1: main |
| 32 | func rg_policy(hk: i64, attempt: i64, jit: i64) -> *RetryPolicy |
| 39 | func main() -> i64 |