Skip to content

Added DRR and WFQ golden fixtures and wire them into CI.#100

Merged
baochunli merged 2 commits into
mainfrom
drr-wfq-fixtures
Jul 6, 2026
Merged

Added DRR and WFQ golden fixtures and wire them into CI.#100
baochunli merged 2 commits into
mainfrom
drr-wfq-fixtures

Conversation

@baochunli

Copy link
Copy Markdown
Collaborator

Summary

Closes a CI coverage gap left after the TraceSpec port (#99): the lean-fixtures job builds
drr_check and wfq_check but never ran them on golden fixtures — only AQM and CUBIC had fixture
scripts. DRR/WFQ were exercised solely by the protocol-traces conformance matrix, which asserts
accept: true but not exact checker output or coverage. In particular, WFQ's class_count_ge_2
coverpoint — the seen accumulator introduced when WFQ moved onto TraceSpec in #99 — was not
golden-tested anywhere.

This PR gives DRR and WFQ the same fixture coverage CUBIC/AQM have, plus --coverage-out golden
fixtures, including a 2-class WFQ trace that directly locks down the class_count_ge_2 / seen
path. No Lean source changes; checker behavior is unchanged. Test infrastructure only.

What's added

lean/fixtures/drr/

  • drr_single_class_accept — the real trace emitted by the DRR CI conformance run, used verbatim; plus a .coverage.expected golden.
  • drr_deficit_conservation_reject — schedule row deficit_bytes 500501REJECT: line 3: deficit_bytes mismatch: got 501, expected 500.
  • drr_class_id_out_of_range_reject — enqueue row class_id 01REJECT: line 2: class_id out of range.

lean/fixtures/wfq/

  • wfq_single_class_accept — the real emitted WFQ CI trace, verbatim; plus a .coverage.expected golden.
  • wfq_two_class_accept — a 2-class trace (two flows, distinct class_id); its .coverage.expected contains class_count_ge_2, golden-testing the ported seen accumulator.
  • wfq_finish_time_reject — enqueue row finish_time_ns 10000002000000REJECT: line 2: finish_time_ns mismatch: got 2000000, expected 1000000.
  • wfq_depart_timing_reject — depart row departure_time_ns2000000REJECT: line 4: departure_time_ns must equal time_ns on depart.

Runner scripts (lean/scripts/): run-drr-fixtures.sh, run-wfq-fixtures.sh (clones of run-cubic-fixtures.sh), and run-drr-coverage-fixtures.sh, run-wfq-coverage-fixtures.sh (clones of run-aqm-coverage-fixtures.sh) — only the build target / binary / fixture dir differ.

CI (.github/workflows/leanguard.yml): four steps in the lean-fixtures job after the CUBIC step. The build step already builds drr_check/wfq_check, so no other change.

How the fixtures were produced

  • Accept traces are captured verbatim from the CI conformance run's emitted drr_events.csv / wfq_events.csv — valid by construction.
  • Reject traces corrupt a single constant-valued field of an accept trace, so the error message is deterministic (no float-recomputed "expected" value).
  • The 2-class WFQ accept trace was simulator-generated (a two-flow / two-class WFQ config → wfq_check accepts by construction), avoiding hand-computing float finish/virtual times.
  • Every .expected / .coverage.expected is a snapshot of an actual checker run, not hand-written (golden-master).

Verification

  • All four scripts pass with true exit 0 (each fixture reports ok:).
  • Negative control: tampering a golden makes the runner exit 1; restoring it returns to exit 0 — confirming the harness genuinely detects mismatches.
  • wfq_two_class_accept.coverage.expected contains class_count_ge_2, proving the seen path is now golden-tested.

Notes

  • Fixture CSVs are force-added (the repo's **/*.csv ignore rule also covers the existing cubic/aqm fixtures, which are likewise tracked).
  • The 2-class WFQ generator config is intentionally not committed, matching the existing convention (AQM/CUBIC fixtures don't ship generator configs). Happy to add it under configs/testgen/ if preferred.

🤖 Generated with Claude Code

baochunli and others added 2 commits July 4, 2026 03:41
The lean-fixtures CI job built drr_check and wfq_check but never ran them on golden fixtures — only AQM and CUBIC had fixture scripts, so DRR/WFQ were exercised solely by the accept-only conformance matrix. In particular WFQ's class_count_ge_2 coverpoint (the ported `seen` accumulator path from #99) was not golden-tested anywhere.

Add fixtures/drr and fixtures/wfq mirroring the CUBIC/AQM layout: an accept trace (captured verbatim from the CI conformance run) plus reject cases per checker, and --coverage-out golden fixtures. A hand-verified 2-class WFQ trace (simulator-generated, accept-by-construction) golden-tests class_count_ge_2. All .expected/.coverage.expected files are snapshots of real checker runs, not hand-written. Add run-{drr,wfq}[-coverage]-fixtures.sh (clones of the cubic/aqm runners) and four CI steps. No Lean source changes; checker behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use `mktemp -p .` (repo-local temp file) instead of the default
`mktemp`, which honors $TMPDIR and fails with "Operation not
permitted" under sandboxes that deny writes to the system temp dir.
Applied to all three coverage runners (aqm/drr/wfq) for consistency.
Works on both BSD (macOS) and GNU (CI) mktemp; temp files are removed
each iteration and never land in the repo tree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baochunli baochunli changed the title Add DRR and WFQ golden fixtures and wire them into CI Added DRR and WFQ golden fixtures and wire them into CI. Jul 6, 2026
@baochunli
baochunli merged commit d6a473b into main Jul 6, 2026
8 checks passed
@baochunli
baochunli deleted the drr-wfq-fixtures branch July 6, 2026 07:03
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.

1 participant