Skip to content

tests: d3d12_ab_compare's sign rule has a test of its own (D3D12-AB-COMPARE-AGREE-TEST) - #2796

Merged
MoonEyes merged 1 commit into
ProjectLeonida:mainfrom
TheGeogeo:d3d12-ab-agree-test
Nov 30, 2026
Merged

MoonEyes merged 1 commit into
ProjectLeonida:mainfrom
TheGeogeo:d3d12-ab-agree-test

Conversation

@TheGeogeo

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D12-AB-COMPARE-AGREE-TEST (#2570 (comment))

What and why

tools/d3d12_ab_compare.py (#2783) says "B faster" or "B slower" only when two things hold: the 95 % interval leaves 0 out, and all pairs but at most one agree in sign. The verification of #2783 found that no test catches removing the second rule. test_one_odd_run_gives_no_verdict already has an interval that holds 0, so it passes without the rule.

This adds test_two_pairs_against_the_rest_give_no_verdict:

  • eight pairs: six with B 2 ms faster, two with B 0.1 ms slower;
  • the interval leaves 0 out, and 6 of 8 pairs agree in sign: no verdict;
  • with only one pair against the rest, the verdict is "B faster".

Test only: no change to the tool.

Tested

On Windows 11 Pro 10.0.26300, Python 3.12:

  • tests/test_d3d12_ab_compare.py: 14 tests OK on main 407f71a with this test.
  • With the rule removed from verdict() (and e["agree"] >= e["k"] - 1 deleted), the new test fails and the other 13 pass.
  • scripts/check_no_game_data.py on the changed file is clean.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

…OMPARE-AGREE-TEST)

"B faster" or "B slower" needs the interval to leave 0 out and all pairs but at most one to agree
in sign. No test caught removing the sign part (the verification of ProjectLeonida#2783 found it): the odd-run
test's interval already held 0. Eight pairs, two against the rest, now give no verdict, and one
against the rest still does.
@OreoFR

OreoFR commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Verified by OreoFR on macOS 27.2.1, Apple M5, head 3b45610f9, main 407f71a23. CPU only, Python.

MEASURED

  • This PR only adds a test, so red and green run the same code: tests/test_d3d12_ab_compare.py gives 14 passed on main + this test, and 14 passed on main + the PR (merge-tree).
  • Mutation on the PR head: deleting and e["agree"] >= e["k"] - 1 from verdict() (tools/d3d12_ab_compare.py:73) gives 1 failed, 13 passed. The only failure is the new test_two_pairs_against_the_rest_give_no_verdict. That matches your Windows result: removing the sign rule is now caught, which closes the coverage gap reported in the tools: d3d12_ab_compare reads an A/B of the D3D12 runtime (D3D12-AB-COMPARE) #2783 verification.

AI-assisted: Claude Code

@MoonEyes

Copy link
Copy Markdown
Collaborator

Merging. Head 3b45610f9 merges cleanly with main b1f91c2f9 and does not force a rebase of #2566. Tests only. CI green on this head. Checked by OreoFR (mutation: the new test alone fails without the sign rule); I ran it with its neighbours on main + PR: 14 tests OK (Windows, Python 3.14). Merged by MoonEyes.

AI-assisted (Claude Code).

@MoonEyes
MoonEyes merged commit 6494909 into ProjectLeonida:main Nov 30, 2026
5 checks passed
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.

3 participants