test(router): record D4 lookup evidence and no miss-time recompilation (CARD-10, #109) #130

Merged
chrnx merged 4 commits from feature/fprd-001b-lookup-evidence into develop 2026-10-12 20:43:34 +00:00
4 Commits
Author SHA1 Message Date
chrnx 2e2c68de07 test(bench): record D4 lookup evidence at ed19f16 (CARD-10, #109)
CI / dco (pull_request) Successful in 5s
CI / runtimes (bun) (pull_request) Successful in 15s
CI / build (pull_request) Successful in 25s
CI / runtimes (deno) (pull_request) Successful in 20s
CI / runtimes (edge) (pull_request) Successful in 19s
Formal D4 run after the walk-stack fix (#131) and the router-order fix in
the harness, 16 x 21 rounds on jarvis. Every cell passes; the 10-route
late param hit passes with its CI lower bound at +4.9%. Marks the
b128139 evidence as superseded.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-12 15:27:20 -05:00
chrnx ed19f16c70 test(bench): alternate the whole router order per lookup run
Only the import order alternated between processes; warm-up order and
the shared lookup call site always saw the first-listed router first.
CARD-10's A/A run (oracle vs a byte-identical copy) showed a steady bias
of up to +8.3% against the second-listed router at 10 routes. Reversing
the whole order per process brings the same A/A to -0.1% (8 x 21
rounds on jarvis). Owner-approved D4 method change (2026-10-12).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-12 15:16:13 -05:00
chrnx a64f514db2 test(bench): record D4 lookup evidence for the radix router (CARD-10, #109)
Formal D4 run on jarvis with the baseline's harness, image, and cpuset:
oracle (pre-radix linear matcher) against the radix router at b128139,
16 processes x 21 rounds = 336 paired rounds per cell, plus an A/A
run (oracle against a byte-identical copy) at the same settings.

D4 fails at 10 routes: late param hit +52.5%, method miss +31.8% and path
miss +101.9%, with every CI lower bound far above +5%. 100 routes improve
in every cell, and all 500-route targets are met (-82.5% to -92.1%). A
diagnostic run with three router revisions traces the 10-route regression
to a2b71e2 (try/finally stack reset in the walk). The seam counters
added for the no-recompilation test change nothing.

No threshold was relaxed and no src/ change was made. The raw samples
are committed for an owner decision.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-12 15:12:40 -05:00
chrnx 7a9932f095 test(router): prove misses after index build recompile nothing (CARD-10, #109)
The linear matcher answered every 404, 405 and automatic OPTIONS by compiling
the whole route table. The radix index compiles each pattern once, when the
index for an array is built. Nothing asserted that, so a regression to
per-request compilation or per-request index builds would only show up as a
slower benchmark.

compilePattern is called inside router.ts, where a spy on the module export
cannot see it, so the router gains two internal counters (compilePattern calls,
index builds), exposed as @internal routerSeamCounts() next to walkStackSize.
router.ts is not a package entry. The new test warms the index, then repeats
404, 405 and OPTIONS misses through resolveRoute/allowedMethods, buildFetch and
app.fetch, and asserts both counts stay constant while status and Allow stay
correct.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-12 15:12:40 -05:00