Skip to content

Read PowerShell GPU test logs in the progress dashboard (BUILD-1564) - #5210

Open
lucasgillet2009-lab wants to merge 4 commits into
ItsNotRexed:mainfrom
lucasgillet2009-lab:fix/dashboard-gpu-log-bom
Open

lucasgillet2009-lab wants to merge 4 commits into
ItsNotRexed:mainfrom
lucasgillet2009-lab:fix/dashboard-gpu-log-bom

Conversation

@lucasgillet2009-lab

Copy link
Copy Markdown

Tracked as BUILD-1564. Claimed in the coordination issue as EGEN-DASHBOARD-GPU-LOG-BOM.

What and why

On 3faac557, a synthetic GPU check log redirected with > in Windows PowerShell 5.1 produced zero dashboard records. The log contained one pass, one failure and one skip. PowerShell wrote UTF-16LE with a byte-order mark (BOM), and --gpu-log read the file as UTF-8. A UTF-8 BOM could also hide the first result when the log started directly with a test name.

The GPU log reader now uses the BOM to select UTF-16 byte order and strips an optional BOM when decoding UTF-8. The regression test imports the same three results in four encodings and checks the individual verdicts, the non-ASCII failure detail and the source count. For each encoding it also checks that gpu.current has numerator 1, denominator 2 and value 0.5, excluding the skipped test from the pass rate.

Tested

Windows, CPython 3.12.14, CPU only. All inputs were synthetic.

  • python -I -B tests/test_progress_dashboard.py — 27 tests passed, including UTF-8 with and without a BOM and BOM-marked UTF-16LE and UTF-16BE. Before the fix, all three BOM-marked variants failed the verdict check.
  • Ran the dashboard CLI on the log written by Windows PowerShell 5.1. The output snapshot contained all three verdicts and reported gpu.current as 1/2 (0.5).
  • python -I -B tests/test_text_write_line_endings.py — 3 tests passed.
  • python -I -m compileall -q make_game.py tools tests and git diff --check passed for the proposed changes.

AI-assisted with OpenAI Codex.

Checklist

  • All test inputs were synthetic. No game data, keys or decryption were used.
  • Translator contract checklist item is inapplicable to this dashboard-only change.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 2b7f33c on Windows 11, CPython 3.14.7, CPU only: pass. AI-assisted.

Windows PowerShell 5.1 wrote a synthetic log with >. The file starts with FF FE. The reader returned all three results: cs_first passed, ps_skip skipped, and cs_fail failed with the detail "mismatch".

py -3.14 -I -B tests/test_progress_dashboard.py passed all 27 tests. py -3.14 -I -B tests/test_text_write_line_endings.py passed all three tests.

I ran the same dashboard tests against merge base 3faac55. The UTF-8 case with a byte-order mark lost the first result. Both UTF-16 cases lost all three results.

@Atomic258

Copy link
Copy Markdown
Contributor

Independent check — PASS (assertion-strengthening): test_progress_dashboard.py 32/32 at head. Note: parent passes too — gpu.current already exists at progress_dashboard.py:499; this adds pinning assertions for the per-encoding pass rate, it doesn't change behaviour. AI-assisted (Devin); no game files.

@Kam471 Kam471 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.

Ran this at 2b7f33c51 on Windows 11: pytest tests/test_progress_dashboard.py -q -> 27 passed, 10 subtests passed; git diff --check clean.

The dashboard now reads PowerShell GPU test logs as well as the existing encodings, and its tests assert the pass rate for each log encoding; the added subtests cover UTF-8/UTF-16/ANSI logs and the malformed encoding case. No blocking issue.

Sequence note: this and #5214 both touch tools/progress_dashboard.py and tests/test_progress_dashboard.py; they merge cleanly (git merge-tree exit 0) and address different inputs (PowerShell logs vs invalid durations), so both can land.

@kacper-serewis kacper-serewis 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.

At 2b7f33c two cached UTF-16LE gpu.log files containing only runtime diagnostics each generated a dashboard metric of 0 of 3 passed. The base decoded no records and emitted no metric. The encoding fix exposes a parser ambiguity: diagnostics can fit the runner’s column layout and get counted as failed fixtures. Please add a diagnostics-only control that yields zero records alongside the genuine runner control. Actual Windows PowerShell 5.1 redirection correctly recovered one pass, one failure and one skip, preserved the non-ASCII detail and yielded 1 of 2 passed. AI-assisted Windows CPU review.

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 2b7f33c on Windows Server 2022, CPython 3.13.12: pass

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

Claim: EGEN-DASHBOARD-GPU-LOG-BOM. AI-assisted with Codex.
@lucasgillet2009-lab

Copy link
Copy Markdown
Author

@kacper-serewis Thanks for the diagnostics-only control. I reproduced the three false failures on 2b7f33c and pushed the fix in 7bc3aea.

The dashboard now requires the final check.py summary. If extra lines look like results, it checks their names against the shader builder’s fixtures, including generated variants such as vs_clip_param4. A recovered report must match the total, passes and skips. An inconsistent log contributes zero GPU records and no pass-rate metric.

All 32 dashboard tests passed on Windows. The UTF-16LE diagnostics-only control now yields zero records. A regression inserts an aligned cs_pipeline_cache diagnostic at all four positions around three genuine results: the failure detail survives, and the pass rate stays at 1/2 (50%), with one pass, one failure and one skip. A synthetic PowerShell 5.1 redirect also retained the non-ASCII failure detail. Running the real check.py reporting code with simulated GPU process failures recovered all 185 failures and 3 skips in its 188-test summary.

The broader standard-library run passed 338 of 340 test files. The remaining failures in test_joaat_agreement.py and test_saves.py also reproduce on 2b7f33c. No game files were used. Codex assisted with the fix and verification. Ready for your re-review.

Keep the compute fixture register shifts and the shared shader catalog. Use main's unittest.mock import for the GPU regression tests.
@thiefyzheng

Copy link
Copy Markdown

checked: #5210 @ e027c14 — CPU only, no GPU: python3 -I tests/test_progress_dashboard.py → exit 0, "Ran 44 tests in 1.097s / OK"; the six log-parsing tests this PR adds are all ok, including test_utf16le_diagnostics_only_has_no_gpu_results and test_stage_prefixed_diagnostic_before_summary_is_not_a_fourth_result. Fresh worktree at the PR head. AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested e027c14 merged with main 00f5ce6 on Linux (WSL2), CPython 3.12.16, CPU only: pass. The merge was clean (tools/progress_dashboard.py, tests/test_progress_dashboard.py and runtime/test/shaders/build.py merged automatically); python -I tests/test_progress_dashboard.py ran 46 tests, OK. Negative control: with tools/progress_dashboard.py and runtime/test/shaders/build.py reverted to main's versions the new test file fails (13 failures, 1 error), and passes again once restored.

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.

7 participants