gqa(adr-0065): P6 — close dispatch-ratio loop (ADR-0064 Test #9 direction)

Extend the opt2 R-sensitivity test to assert the opt3/opt2 dispatch ratio increases as R decreases (4.20x -> 5.22x -> 5.45x at R=0.25/0.0625/0.03125) — the cost is FIXED-dominated (command-count-driven), per ADR-0064 Test #9. Test-only; no production change (the P0 cost model + P2 recipe already make the ratio measurable).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 21:04:45 -07:00
parent 35453cc4fe
commit 4a55ae5c0b
+10 -2
View File
@@ -97,12 +97,20 @@ def test_opt3_dispatch_exceeds_opt2_by_2x():
def test_dispatch_ratio_R_sensitivity(): def test_dispatch_ratio_R_sensitivity():
"""ADR-0064 Test #9 — opt2 < opt3 across the queue-bandwidth range.""" """ADR-0064 Test #9 — opt2 < opt3 across the queue-bandwidth range, and
for R in (0.25, 0.0625, 0.03125): the opt3/opt2 ratio increases as R decreases (the cost becomes more
FIXED-dominated, i.e. command-count-driven). Absolute ratio values are
informative only; the gate is the direction + opt2 < opt3."""
ratios = []
for R in (0.25, 0.0625, 0.03125): # strictly decreasing R
cm = PeCostModel(fixed_per_cmd_cycles=40, byte_cycles_recip=R) cm = PeCostModel(fixed_per_cmd_cycles=40, byte_cycles_recip=R)
opt3 = _dispatch_cycles(_opt3_tile, cm) opt3 = _dispatch_cycles(_opt3_tile, cm)
opt2 = _dispatch_cycles(_opt2_tile, cm) opt2 = _dispatch_cycles(_opt2_tile, cm)
assert opt2 < opt3, f"R={R}: opt2={opt2} !< opt3={opt3}" assert opt2 < opt3, f"R={R}: opt2={opt2} !< opt3={opt3}"
ratios.append(opt3 / opt2)
assert ratios[0] < ratios[1] < ratios[2], (
f"opt3/opt2 ratio must increase as R decreases; got {ratios}"
)
# ── K-before-V DMA priority (ADR-0065 Test #3) ─────────────────────── # ── K-before-V DMA priority (ADR-0065 Test #3) ───────────────────────