Skip to content

tools: gpu_results.py reads the GPU test records into one overview (GPU-RESULTS-OVERVIEW) - #2379

Open
syfyra wants to merge 1 commit into
ProjectLeonida:mainfrom
syfyra:feat/gpu-results-overview
Open

syfyra wants to merge 1 commit into
ProjectLeonida:mainfrom
syfyra:feat/gpu-results-overview

Conversation

@syfyra

@syfyra syfyra commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: GPU-RESULTS-OVERVIEW (#1608 (comment))

Depends on: none. No open pull request changes these three files (checked with the scripts/pr_overlap.py of #2349); it does not touch docs/gpu_test_results.md, which 33 open pull requests edit, or any record.

What and why

gpu-test-results/ holds 46 records and 35 open pull requests add 38 more, but nothing reads them. Which fixtures fail on which GPUs and drivers is only in their prose, and the hand-written table in docs/gpu_test_results.md lists 11 runs.

tools/gpu_results.py parses the Key: value fields the records share and prints one overview:

  • a row per record: GPU and family, driver, how many commits its commit is behind main, the native and the wave64-emulated run of run_gpu_tests.py as passed/total with skips and failures, and the fixtures it lists as failed;
  • each failing fixture with the records and vendors it fails on, the newest record that lists it, and how many records taken at newer commits do not. A fixture that fails across vendors points at the fixture or the translator, one that fails on a single driver at that driver;
  • runs of another kind (a validation run, a filtered run) and the records it could not read in full.

--markdown prints the record table for a document, --json everything as one object, and --check names each record that lacks GPU, Driver, OS or Commit, or whose Commit has no hash, and exits 1 when there is one. gpu-test-results/README.md states the format, which until now was "the format of the files there".

What is read from prose is a convention, not a grammar: a run is a line with N/M passed, labelled by what stands before it or after it in parentheses; a failed fixture is one the Failed: field opens with, or one that starts a line of its own as ps_c: .... A wrapped sentence that starts with a fixture that passes ("cs_d and cs_e pass with #N applied") is not counted.

On the 46 records of main (30 NVIDIA, 12 AMD, 2 Apple, 1 Intel, 1 llvmpipe), with main at 56bdd7e88:

One thing for the reviewer to decide: tests/test_gpu_results.py also reads the repository's own records and fails for one that lacks a required field, so a pull request that adds such a record fails that test. That is the point of --check, but it would turn the two pull requests above red once this is merged; the test class RepositoryRecordsTest can be dropped without touching the rest.

Tested

Windows 11, Python 3.14.7, git 2.55.0:

  • python -I tests/test_gpu_results.py: 19 tests on synthetic records in the layouts the real files use (invented devices and numbers): fields and continuation lines, the short names, the run labels in the spellings the records use, the failed fixtures with wrapped prose, problems and notes, the fixture table and its ordering, commit distances on a throwaway git repository, the text, Markdown and JSON output, --check, and the repository's own 46 records.
  • The test file fails on main, where the tool does not exist.
  • 62 small changes to the tool (a field pattern that takes sentences, a comma that ends a name inside parentheses, the wrapped-prose rule removed, <= for < in the newer-record count, and so on): 61 fail a test in a copy outside a git checkout, and the last one, which makes --no-git ask git anyway, fails two tests in the checkout.
  • python -I tools/gpu_results.py on this repository: 1.1 s for the 46 records including the commit distances; --check, --markdown and --json run on them too.
  • python -I on the 13 tests/test_docs_*.py, tests/test_i18n_index.py, tests/test_tool_stdout_encoding.py, tests/test_text_write_line_endings.py and tests/test_ci_registration.py; python -I scripts/check_no_game_data.py on the three files.
  • Not tested: Linux and macOS, Python 3.12, and no GPU test was run for this change (it reads records, it does not produce one).

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. (No translator rule in this change.)

🤖 Generated with Claude Code

…PU-RESULTS-OVERVIEW)

gpu-test-results/ holds 46 records and 35 open pull requests add more, but
nothing reads them: which fixtures fail on which GPUs and drivers is only
in their prose, and the hand-written table in docs/gpu_test_results.md
lists 11 runs.

tools/gpu_results.py parses the `Key: value` fields the records share and
prints a row per record (GPU, driver, how far its commit is behind main,
the native and the wave64-emulated run as passed/total with skips and
failures, the failed fixtures), then each failing fixture with the records
and vendors it fails on, where it was last seen failing and how many
records at newer commits no longer list it. --markdown prints the record
table for a document, --json everything, and --check names a record that
lacks GPU, Driver, OS or Commit.

gpu-test-results/README.md states the format the records use. The test
file also reads the repository's own records, so one that lacks a required
field fails there.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@wavehs wavehs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS arm64 check of #2379 (GPU-RESULTS-OVERVIEW). A new standard-library tool, its test, and a README; no GPU or build involved.

Tested head 346117c24 with its diff applied to a copy of main bdbc7e923 (branch 15 commits behind; git apply / git merge-tree clean).

Environment: Apple M3 Pro, arm64, macOS 27.2.1, CPython 3.15.2.

Result

  • python -I tests/test_gpu_results.py: 19 tests, OK.
  • Run over the repository's own 46 records: --check prints 46 record(s) checked, 0 to fix and exits 0 (three notes: two records with more failures than fixture names, one record with no readable run); --json and --markdown exit 0 and produce the expected shapes; the text table lists 46 records and the fixture section.
  • Negative control (new test kept, one rule at a time sabotaged in tools/gpu_results.py, then restored):
    • dropping the ENTRY_END condition in parse_failed - 4 failures (test_a_full_record, test_failed_fixtures_are_the_ones_the_field_opens_with_or_gives_a_line_of_their_own, and both report tests);
    • ignoring the distance in newer_without - 1 failure (test_newer_records_that_no_longer_list_a_fixture_are_counted);
    • reading Failed: none as fixture names - 1 failure (the parse_failed test).
      So the parsing and the report are pinned, not just the CLI.
  • python -I scripts/check_no_game_data.py tools/gpu_results.py tests/test_gpu_results.py gpu-test-results/README.md: clean.
  • tests/test_docs_*.py (links, CLI flags, table rows/ids, repo paths, repeated lines, list items, encoding): all OK on the applied tree.

Finding: one record in main is invisible to the tool, and --check passes it

gpu-test-results/V100-SXM2.txt (merged as 01bf18d94) opens its runs with

run_gpu_tests.py, 256 fixtures; 265 shaders translated, 264 pass spirv-val in every run:
            native:                                       193/256 passed, 62 skipped, 1 failed
            LEONIDA_W64_EMULATE=1:                        224/256 passed, 31 skipped, 1 failed

FIELD (tools/gpu_results.py:51) forbids a comma in the key, so that line starts no field; the three indented run lines become a continuation of the preceding Build: field, and parse_runs (:120-121) only looks at keys starting with run_gpu_tests.py. The overview therefore prints - / - for V100 and loses 256 fixtures of coverage, and the 1 failed in each run is never tied to a fixture (the record also has no Failed: field; it names cs_imgstore_cube in prose instead). --check reduces all of it to the note no run_gpu_tests.py line with N/M passed`` and exits 0, so a new record written this way would pass the check the PR adds for exactly this purpose.

The data is there and one line recovers it: treating any line that starts with run_gpu_tests.py as its own field (before the comma rule is applied) yields the three runs as intended - native 193/256 62s 1f, emulated 224/256 31s 1f, and the fallback run 237/256 18s 1f under "Other runs" - which is what the record says. I verified that patch on the merged tree; I did not change the repository.

Two smaller things, not defects:

  • --no-git (and any run outside a checkout) prints ? for every behind, with the legend line explaining it; correct, just worth knowing for the --markdown output pasted into a document without .git.
  • For RTX2060SUPER and RTX5070 the note 8 failed in a run, 1 fixture name(s) read from Failed is right: those records list one fixture and then prose. The tool reporting the gap instead of inventing names is the behaviour I want, so I would keep the note as a note.

No GPU fixtures were run: this PR touches no translator, runtime or harness code, so the same-main baseline stands (195 PASS / 3 FAIL / 70 SKIP MoltenVK, 190 / 5 / 73 KosmicKrisp).

No game files. AI-assisted.

@akimfomin

Copy link
Copy Markdown
Contributor

PortBridge checked the exact parser at 346117c against the merged V100 record. The parser finds the required metadata and leaves the fatal-check list empty, but drops all three runs and cs_imgstore_cube. Both section headings contain a comma, so they are absorbed into the preceding field. Replacing just the two headings in a copy with run_gpu_tests.py: and Failed: restores 193/256, 224/256 and 237/256, with one failure each, and puts cs_imgstore_cube in the failure table. Changing either heading alone restores only that section.

Would you prefer a narrowly scoped parser regression using this public record, or a separate heading-only cleanup of the legacy record? Either can preserve every measurement. Until then, the overview cannot establish Volta coverage even though the record passes its metadata check. PortBridge reproduced this with Codex. The hardware record remains credited to 31415-n.

@imShangLi

Copy link
Copy Markdown
Contributor

claiming: VERIFY-2379

New tool (tools/gpu_results.py, 355 lines) with its own 354-line test and the README that documents the record format. No verification comment on it. It is all standard library and reads the 78 .txt records already in the repository, so it is testable here without game files or a GPU.

Method: the same three rows as my last batch, plus a functional pass — for a new tool the reverse control on its own only proves the module is missing (ModuleNotFoundError), which says nothing about whether the parser reads correctly. So I will also compare what it prints against the raw text of the records it reads, and check --check's exit code and what it names.

AI-assisted.

@imShangLi

Copy link
Copy Markdown
Contributor

VERIFY-2379 — Linux, Python 3.15, CPU only, no game files

Claimed as VERIFY-2379.

Verdict: the tool is correct and reads the records accurately, and it is green on its own base. Merging it into main today turns it red, and the reviewer decision the description already asks for has moved from "two open pull requests" to "main itself".

tree python3 -I tests/test_gpu_results.py
main 86c30fce test file does not exist yet
main + this pull request 19 tests, FAILED (failures=3)
main + this pull request, with gpu-test-results/ rolled back to this pull request's base 19 tests, OK
main + only this pull request's test file (tools/gpu_results.py absent) ModuleNotFoundError

Row 3 is the isolation: same code, same tool, only the 78 records swapped for the 46 that existed when the branch was written (its base 56bdd7e8). It goes green. Nothing in the change is wrong about itself — and the description's own claim, "All 46 pass --check", reproduces exactly.

The three failures are one cause

FAIL: test_every_record_in_the_repository_has_the_required_fields (record='PR1608-Radeon860M-RTX5060Laptop-Win11.txt')
  AssertionError: ['no GPU field', 'no Driver field'] != []

FAIL: test_every_record_in_the_repository_has_the_required_fields (record='RTX4080-Windows-62101-validated.txt')
  AssertionError: ['no Commit field'] != []

FAIL: test_the_default_folder_is_the_repositorys
  code = gpu_results.main(["--check"])   ->   1, ''   expected  0, ''

The third is those same two records: --check exits 1 when a record needs fixing, and that test asserts it returns 0.

$ python3 -I tools/gpu_results.py --check
PR1608-Radeon860M-RTX5060Laptop-Win11.txt: no GPU field
PR1608-Radeon860M-RTX5060Laptop-Win11.txt: no Driver field
RTX4080-Windows-62101-validated.txt: no Commit field
78 record(s) checked, 2 to fix
exit=1

The parser reports exactly what is missing and nothing else. It reads Commit: and OS: from the first record, and GPU:/Driver:/OS: from the second — the second has GPU: on line 18 and Driver: on line 19, and only Commit: is absent. That is a correct parser meeting non-conforming data.

Both records hold the information under other keys or in prose:

RTX4080-Windows-62101-validated.txt:7   Baseline: 02f71ccfe78160997a02950607be583af87e1180   <- a commit hash
PR1608-...-Win11.txt:9                  AMD Radeon 860M: driver 26.11.2, Vulkan 1.4.359
PR1608-...-Win11.txt:10                 NVIDIA RTX 5060 Laptop GPU: driver 621.24, Vulkan 1.4.357

This is the outcome the description predicted — but already on main, not on the two pull requests

The description ends "What and why" with a reviewer decision, quoted here because it is the thing to decide:

One thing for the reviewer to decide: tests/test_gpu_results.py also reads the repository's own records and fails for one that lacks a required field ... but it would turn the two pull requests above red once this is merged; the test class RepositoryRecordsTest can be dropped without touching the rest.

and it names them: "the one in #2204 has no GPU and no Driver field and the one in #2238 no OS field."

Two things have happened since that was written:

  1. gpu-test-results: Radeon 860M and RTX 5060 Laptop, native Windows 11 (#1608) #2204 is merged (2026-11-28) — PR1608-Radeon860M-RTX5060Laptop-Win11.txt is now a file in gpu-test-results/, not in an open pull request. So the consequence is no longer that two open pull requests go red; main is red the moment this merges, on its own RepositoryRecordsTest.
  2. A second record the description does not list fails it: RTX4080-Windows-62101-validated.txt, missing Commit:, which reached main through 54b811aa rather than through gpu-test-results: Radeon 860M and RTX 5060 Laptop, native Windows 11 (#1608) #2204 or gpu-test-results: Radeon Pro Vega II (gfx906, Linux RADV) — GPU-VEGA20-RADV #2238.

#2238 is still open, so its record is not in main yet and is not one of these three failures.

Neither fact is a defect in this pull request — the records are the repository's, and the base is 56bdd7e8, while gpu-test-results/ went from 46 to 78 files after it. But it does sharpen the decision: dropping RepositoryRecordsTest (the option the description offers) turns these three failures off with no other change, and keeping it means this lands red until the two records are corrected.

What I measured about the tool itself

Cross-checked its output against the raw text of a record it reads:

parsed   780M.txt   AMD Radeon 780M Graphics (RDNA3 iGPU)   AMD proprietary 26.10.2   243/263 18s 2f   cs_imgatomic_ext, cs_texture_uav
raw      line 1  GPU:        AMD Radeon 780M Graphics (RDNA3 iGPU, gfx1103, WDDM 3.2, 16 GB shared)
raw      line 2  Driver:     AMD proprietary 26.10.2 (32.0.32015.12012, LLPC), Vulkan 1.4.359
raw      line 12 Native: 243/263 passed, 18 skipped, 2 failed.
raw      line 14 Failed:     cs_imgatomic_ext: 6 of 64 sint words differ; ...

Vendor totals over all 78 records add up: NVIDIA 47, AMD 20, Apple 5, Intel 4, other 1, software 1 = 78.

The other option, if keeping the test

Correct the two records rather than drop the check — both fixes are three lines of data:

  • RTX4080-Windows-62101-validated.txt: Commit: 02f71ccfe78160997a02950607be583af87e1180 (its existing Baseline: value);
  • PR1608-Radeon860M-RTX5060Laptop-Win11.txt: GPU: and Driver: lines for the two adapters it names on lines 9-10.

I have not changed any file.

AI-assisted: yes — MiMo-V2.6-Flash (OpenCode). It built the worktrees, ran the isolation row, cross-checked the parser against record text and drafted this report.

@aslan2142 aslan2142 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Draft review note: GPU-RESULTS-OVERVIEW (tools/gpu_results.py, tests/test_gpu_results.py, gpu-test-results/README.md) remains a draft with no CI run, and independent testing against current main found 3 failures in tests/test_gpu_results.py on the expanded gpu-test-results/ corpus (plus dropped runs/failures on comma-containing section headings such as gpu-test-results/V100-SXM2.txt). Please update the parser/tests against current main, run CI to green, and mark ready for review.

(AI-assisted review.)

@aslan2142
aslan2142 marked this pull request as ready for review December 1, 2026 12:33
@aslan2142

Copy link
Copy Markdown
Collaborator

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

@merzleckeier

Copy link
Copy Markdown
Contributor

Isolated the V100 heading-loss issue reported above at 346117c2 + c95183fd8. A synthetic record with run_gpu_tests.py, ...: and Failed in all runs, ...: loses both sections on the PR as written. My local change recognizes those two prefixes before the generic field regex. The new targeted test then passes while a prose line with a comma is still ignored. On the existing V100 record the output changed from 0 to 3 run rows and 0 to 1 named failed fixture. All 18 parser/overview/CLI tests pass with that local change. The full suite still reports the same three failures involving the two records with missing required metadata.

AI-assisted with OpenAI Codex.

@aslan2142 aslan2142 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now ready for review, requesting changes before merge:

  • Test failures against current main's gpu-test-results/ corpus: as reproduced by @imShangLi, python -I tests/test_gpu_results.py fails 3 cases on current main (test_every_record_in_the_repository_has_the_required_fields on PR1608-Radeon860M-RTX5060Laptop-Win11.txt and RTX4080-Windows-62101-validated.txt, plus test_the_default_folder_is_the_repositorys because --check exits 1).
  • Comma-heading parser drop (tools/gpu_results.py:51): as confirmed by @wavehs and @akimfomin, FIELD rejects commas in field names, causing gpu-test-results/V100-SXM2.txt (run_gpu_tests.py, 256 fixtures; ...:) to drop all three runs and cs_imgstore_cube while --check still exits 0.
  • CI: no CI runs on the current head yet; please resolve the above and get fresh green CI.

(AI-assisted review.)

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.

6 participants