Tests: compare benchmark regression thresholds #2959

Merged
bmjask merged 324 commits from upstream-pr/2959 into main 2026-11-28 03:18:42 +00:00
bmjask commented 2026-11-27 05:15:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-27T05:15:28Z.


Part of #2508.

This is stack slice 308. Only top commit b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2 belongs to this PR; the preceding commits are prerequisite stack history rebased onto xcl-dev/main c2ee10e4e905eb736e56953c52b749e18bcc7ede.

Add a deterministic comparator for versioned benchmark NDJSON. Matching candidate medians are compared directly with the baseline-scaled limit so an exactly-at-limit result remains inclusive despite floating-point rounding.

What is in it

  • crates/xcl/src/bin/bench_compare.rs: parse, validate and compare records; cover exact-boundary and just-over-boundary thresholds plus malformed or incomparable inputs.
  • crates/xcl/Cargo.toml: register xcl-bench-compare.
  • README.md: document the command and comparison rule.

Tested

  • Exact head b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2: ./scripts/test.ps1 --nocapture --skip test_title_runs_and_game_folder_is_untouched on GitHub-hosted Windows Server 2025, stable Rust 1.100.0, Microsoft Basic Render Driver: 39 test binaries, 2067 passed, 0 failed, 48 ignored, 361 GPU tests skipped. https://github.com/xcl-dev/xcl/actions/runs/46002348248
  • git diff --check c2ee10e4e905eb736e56953c52b749e18bcc7ede..b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2 passed.

Regression run

  • Not required: this slice changes benchmark tooling, its manifest entry and documentation, not runtime behavior.

Not tested

  • Benchmark workloads, collected GPU baselines, AMD/NVIDIA GPU execution, or retail-title smoke.

AI use

  • Codex, GPT-5.6-sol implemented, rebased, tested and reviewed the change and wrote this description.
<!-- greyfinch-sync:ivall/xcl:issue:5521598722 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2959). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-27T05:15:28Z. --- Part of #2508. This is stack slice 308. Only top commit `b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2` belongs to this PR; the preceding commits are prerequisite stack history rebased onto `xcl-dev/main` `c2ee10e4e905eb736e56953c52b749e18bcc7ede`. Add a deterministic comparator for versioned benchmark NDJSON. Matching candidate medians are compared directly with the baseline-scaled limit so an exactly-at-limit result remains inclusive despite floating-point rounding. **What is in it** - `crates/xcl/src/bin/bench_compare.rs`: parse, validate and compare records; cover exact-boundary and just-over-boundary thresholds plus malformed or incomparable inputs. - `crates/xcl/Cargo.toml`: register `xcl-bench-compare`. - `README.md`: document the command and comparison rule. **Tested** - Exact head `b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2`: `./scripts/test.ps1 --nocapture --skip test_title_runs_and_game_folder_is_untouched` on GitHub-hosted Windows Server 2025, stable Rust 1.100.0, Microsoft Basic Render Driver: 39 test binaries, 2067 passed, 0 failed, 48 ignored, 361 GPU tests skipped. https://github.com/xcl-dev/xcl/actions/runs/46002348248 - `git diff --check c2ee10e4e905eb736e56953c52b749e18bcc7ede..b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2` passed. **Regression run** - Not required: this slice changes benchmark tooling, its manifest entry and documentation, not runtime behavior. **Not tested** - Benchmark workloads, collected GPU baselines, AMD/NVIDIA GPU execution, or retail-title smoke. **AI use** - Codex, GPT-5.6-sol implemented, rebased, tested and reviewed the change and wrote this description.
luckyteagirl commented 2026-11-27 05:27:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-27T05:27:17Z.

Review: COMMENTED


On a933c83fac6636f9481a21ce403c32c8e5fde4f9, an exactly-at-limit measurement can be reported as a regression because (after / before - 1.0) * 100.0 rounds upward before the > limit comparison. I ran the exact comparator on Windows with matching one-record NDJSON inputs: baseline 100 ns, candidate 105 ns, limit 5%. It printed change +5.00%, limit +5.00% but exited 1 with REGRESSION because the internal value is 5.000000000000004. This contradicts the documented rule that a change must exceed the limit. Could the threshold comparison avoid this floating boundary error and add an inclusive at-limit fixture? The displayed percentage can remain rounded for readability. This is a focused CLI run, not a workspace or GPU run.

AI use: OpenAI Codex (GPT-6.2 Sol) compiled and ran the exact-head comparator with synthetic records; OpenAI Codex (GPT-6.2 Astra) checked the source and wrote this review.

<!-- greyfinch-sync:ivall/xcl:review:6083859553 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2959#pullrequestreview-6083859553). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-27T05:27:17Z. **Review:** COMMENTED --- On `a933c83fac6636f9481a21ce403c32c8e5fde4f9`, an exactly-at-limit measurement can be reported as a regression because `(after / before - 1.0) * 100.0` rounds upward before the `> limit` comparison. I ran the exact comparator on Windows with matching one-record NDJSON inputs: baseline 100 ns, candidate 105 ns, limit 5%. It printed `change +5.00%, limit +5.00%` but exited 1 with `REGRESSION` because the internal value is `5.000000000000004`. This contradicts the documented rule that a change must *exceed* the limit. Could the threshold comparison avoid this floating boundary error and add an inclusive at-limit fixture? The displayed percentage can remain rounded for readability. This is a focused CLI run, not a workspace or GPU run. AI use: OpenAI Codex (GPT-6.2 Sol) compiled and ran the exact-head comparator with synthetic records; OpenAI Codex (GPT-6.2 Astra) checked the source and wrote this review.
bmjask commented 2026-11-27 13:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-27T13:06:38Z.


@luckyteagirl Addressed at b4c93f2b. The regression decision now compares the candidate median directly against baseline * (1 + limit / 100) in the measurement domain, avoiding the rounded percentage subtraction at the boundary. The fixtures cover 100 -> 105 at 5% as inclusive and 100 -> 105.000001 as a regression. Windows CI passed: 39 binaries, 2067 passed, 0 failed, 48 ignored, 361 GPU tests skipped (run).

<!-- greyfinch-sync:ivall/xcl:comment:7219068480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2959#issuecomment-7219068480). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-27T13:06:38Z. --- @luckyteagirl Addressed at `b4c93f2b`. The regression decision now compares the candidate median directly against `baseline * (1 + limit / 100)` in the measurement domain, avoiding the rounded percentage subtraction at the boundary. The fixtures cover 100 -> 105 at 5% as inclusive and 100 -> 105.000001 as a regression. Windows CI passed: 39 binaries, 2067 passed, 0 failed, 48 ignored, 361 GPU tests skipped ([run](https://github.com/xcl-dev/xcl/actions/runs/46002348248)).
JJAutoCompare commented 2026-11-27 22:50:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T22:50:58Z.


Tested

Clean detached b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2 on Windows 11 x64 build 26200.9974, Ryzen 7 3800X, and Rust 1.100.0 MSVC debug. I reran the pinned xcl-bench-compare.exe <baseline.ndjson> <candidate.ndjson> --max-regression-percent 5 with hash-verified synthetic version-1 NDJSON.

Candidate Observed result Native exit
100 to 105 ns Threshold row PASS, unchanged row PASS 0
100 to 105.000001 ns Threshold row REGRESSION, unchanged row PASS 1
Different environment metadata Incomparable-results diagnostic on stderr, empty stdout 2

Both threshold rows displayed +5.00%. The pinned stock comparator unit binary also passed 4 tests, with zero failures, ignores, or skips, using --nocapture --test-threads=1. All artifact hashes held.

Not tested

Actual benchmark workloads, metadata emission by other tools, GPU execution, retail smoke, and the full workspace suite.

AI use

T3 Code / Codex (gpt-6.2-sol) independently reran the CLI and unit controls and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7229667268 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2959#issuecomment-7229667268). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T22:50:58Z. --- **Tested** Clean detached `b4c93f2bb7834a8dc2dc601a6e286fe02920ecb2` on Windows 11 x64 build 26200.9974, Ryzen 7 3800X, and Rust 1.100.0 MSVC debug. I reran the pinned `xcl-bench-compare.exe <baseline.ndjson> <candidate.ndjson> --max-regression-percent 5` with hash-verified synthetic version-1 NDJSON. | Candidate | Observed result | Native exit | | --- | --- | ---: | | 100 to 105 ns | Threshold row `PASS`, unchanged row `PASS` | 0 | | 100 to 105.000001 ns | Threshold row `REGRESSION`, unchanged row `PASS` | 1 | | Different environment metadata | Incomparable-results diagnostic on stderr, empty stdout | 2 | Both threshold rows displayed `+5.00%`. The pinned stock comparator unit binary also passed 4 tests, with zero failures, ignores, or skips, using `--nocapture --test-threads=1`. All artifact hashes held. **Not tested** Actual benchmark workloads, metadata emission by other tools, GPU execution, retail smoke, and the full workspace suite. **AI use** T3 Code / Codex (`gpt-6.2-sol`) independently reran the CLI and unit controls and wrote this report.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2959
No description provided.