Skip to content

feat(sched): arm the scheduler preemption-rate gate; ADR-0022 Accepted (prereq 2, PR-2) - #218

Merged
NickFlach merged 1 commit into
mainfrom
pr2/adr0022-sched-gate
Jul 13, 2026
Merged

feat(sched): arm the scheduler preemption-rate gate; ADR-0022 Accepted (prereq 2, PR-2)#218
NickFlach merged 1 commit into
mainfrom
pr2/adr0022-sched-gate

Conversation

@NickFlach

Copy link
Copy Markdown
Collaborator

What

PR-2 of ADR-0022 prerequisite 2 — arms the scheduler baseline gate on the scalar PR-1's calibration selected, and flips ADR-0022 to Accepted.

scripts/test_qos_sched.py flips from report-only to a real gate: it asserts preemptions per 1000 guest ticks in [100, 600] (the calibrated metric, ~200 at the default quantum) on top of the non-vacuous liveness floor. Everything asserted is a delta over guest ticks, so the band is host-CPU-invariant — a slow CI runner reads the same rate.

  • FLOOR = 100 (= q5-median × 0.5) catches a coarsened round-robin cadence (the scheduler getting more sluggish — ADR-0022's regression direction).
  • CEIL = 600 (= q5-median × 3) is a loose thrash cap that does not redden on the intended future fix (a smaller quantum raises the rate).

Revert-confirmed (anti-vacuous)

On WSL, byte-identical protocol:

SCHED_QUANTUM_TICKS preempt/1000t gate
5 (default) 199.9 GREEN
20 49.9 RED (below floor 100)
5 (restored) 199.9 GREEN

The gate reddens on exactly the regression the ADR guards (a coarsened quantum). q=80 grinds the windowed harness itself, so 20 is the practical lever — as PR-1's calibration established.

ADR status

Completes ADR-0022's second prerequisite, so the ADR flips to Accepted: the deferral decision and both prerequisites (latency gate + scheduler baseline) are done. The latency fix itself (the I/O-priority-boost epic, or a measured quantum reduction) stays a deliberately deferred, now-unblocked future epic — it now has both a proven latency gate and a proven scheduler baseline to be measured against.

Verification

No kernel change (docs + harness + gate comments only). make ci-smoke-sched passes at the default quantum (199.9 ∈ [100,600]); py-compile + YAML green.

🤖 Generated with Claude Code

…d (prereq 2, PR-2)

Flips scripts/test_qos_sched.py from report-only to a real gate. It asserts the
PR-1-calibrated scalar — preemptions per 1000 guest ticks — within [100, 600],
on top of the non-vacuous liveness floor. The metric is a delta over GUEST
ticks, so the band is host-CPU-invariant: a slow CI runner reads the same rate
(it just takes longer wall-clock to fill the window).

- FLOOR = 100 (= q5-median 200 x 0.5) catches a COARSENED round-robin cadence
  (the scheduler getting more sluggish — ADR-0022's regression direction).
- CEIL = 600 (= q5-median x 3) is a loose thrash cap that does NOT redden on the
  intended future fix (a SMALLER quantum raises the rate).

Revert-confirmed on WSL (feedback-anti-vacuous-boundary-gates — PR not done
until RED observed): default SCHED_QUANTUM_TICKS=5 -> gate GREEN (rate 199.9);
set 20 -> rate 49.9 < floor -> gate RED with "round-robin cadence has COARSENED";
restore 5 -> GREEN. (q=80 grinds the windowed harness itself, so 20 is the
practical lever, as PR-1's calibration established.)

Completes ADR-0022's second prerequisite, so the ADR flips to Accepted: the
deferral decision and both prerequisites (latency gate + scheduler baseline) are
done. The latency fix itself (the I/O-priority-boost epic or a measured quantum
reduction) stays a deliberately deferred, now-unblocked future epic.

No kernel change (docs + harness + gate comments only). py-compile + YAML green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NickFlach
NickFlach merged commit b889744 into main Jul 13, 2026
25 checks passed
@NickFlach
NickFlach deleted the pr2/adr0022-sched-gate branch July 13, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants