tooling: report paired draw and compute paths #3941

Manually merged
github merged 3 commits from github-bot/gh-3939 into gh-pr/3939/base 2026-12-03 15:08:38 +00:00 AGit
Owner

@⁠lambirou on GitHub · 2026-12-03 14:16 UTC · original
lambirou:codex/amd-draw-path-report → main · +813 −21 · 10 files · 3 commits · merged 2026-12-03 15:03 UTC

**@⁠lambirou** on GitHub · 2026-12-03 14:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3939) `lambirou:codex/amd-draw-path-report` → `main` · +813 −21 · 10 files · 3 commits · merged 2026-12-03 15:03 UTC ## Problem`n`nThe startup triage reads `ExecuteIndirect` buckets, but it drops the `direct-draw` census that the runtime already emits. A paired run therefore cannot distinguish a placeholder signature, a compute-pipeline refusal, an indirect draw that reached the GPU, and a direct draw refused before recording.`n`n## Change`n`n- Report direct-draw refusals by reason, pipeline key and first frame.`n- Add `triage_run.py --compare <run A> <run B>` for a paired summary of direct draws, indirect buckets and compute dispatches. Each row states its source so absent and zero values stay distinct.`n- Document the AMD pair. Arm A uses the default settings. Arm B only adds `X2W_INDIRECT_PIPELINE_KEYS=1` so the bounded indirect census keeps every pipeline key instead of the first eight per code and kind.`n- Extend the source-built draw-path fixture with named paths for a placeholder signature, a compute-pipeline refusal, an indirect draw that is actually forwarded, and a direct `no_pipeline_bound` refusal.`n`nThe runtime behavior and defaults are unchanged. Switch B increases diagnostic census work, so this pair is for path counts rather than frame-rate or pixel claims.`n`n## Validation`n`n```powershell`n.\tools\dev.ps1`ncmake --build --preset dev --target startup_indirect_draw_indexed startup_clear_depth_stencil`nctest --preset dev --no-tests=error -j 1 -R '^(startup_draw_path_report_warp|startup_indirect_bucket_(placeholder|compute-pipeline)_warp|startup_indirect_draw_indexed_warp|startup_draw_clear_census_warp|startup_triage_run|runtime_startup_triage_run_cli_check)$'`n````n`n- Six passed, one capability skip: `startup_draw_clear_census_warp` has no debug-layer callback on WARP.`n- `startup_draw_indirect_counts_hardware` passed on the AMD Radeon RX 9060 XT, driver `32.0.32029.2010`.`n- `startup_triage_run_check.py`, the nine CLI cases, `startup_tools_lint_check.py tools/startup`, `startup_run_preset_check.py`, and `docs_links_check.py` passed. The documentation check covers 282 files and 1,007 links.`n- The paired source-built fixture reports the same counts for A and B on AMD: three forwarded indirect indexed draws, one placeholder signature, one compute-pipeline refusal, one direct `no_pipeline_bound` refusal, one graphics-pipeline refusal, and three other indexed refusals. The forwarded path also checks its pixels.`n`nThe fixture is intentionally short and does not reach a late 300-frame heartbeat, so the aggregate `translated draws` line can be absent even when the forwarded draw counter is nonzero.`n`nRefs #870, #3901. AI-assisted.`n
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 14:21:17 +00:00
github-bot force-pushed github-bot/gh-3939 from 514b1d68fa to 2740f59836 2026-12-03 14:32:52 +00:00 Compare
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 14:36 UTC · original · requested changes

I reproduced a crash in the new paired report on 2740f598. Pass format_path_comparison two summaries with indirect_peaks=None on A and Counter({('forwarded', 'drawindexed'): 7}) on B. The ExecuteIndirect Causes table raises KeyError: ('forwarded', 'drawindexed') because (indirect_a or {})[outcome, kind] indexes a plain empty dict. This occurs whenever one run reports indirect counters and the other has no such line. Please render the missing side as n/a consistently with the primary metric table and include a one-sided synthetic log pair in the CLI tests.

**@⁠R0Y00** on GitHub · 2026-12-03 14:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3939#pullrequestreview-6171871045) · **requested changes** I reproduced a crash in the new paired report on 2740f598. Pass format_path_comparison two summaries with indirect_peaks=None on A and Counter({('forwarded', 'drawindexed'): 7}) on B. The ExecuteIndirect Causes table raises KeyError: ('forwarded', 'drawindexed') because `(indirect_a or {})[outcome, kind]` indexes a plain empty dict. This occurs whenever one run reports indirect counters and the other has no such line. Please render the missing side as n/a consistently with the primary metric table and include a one-sided synthetic log pair in the CLI tests.
Author
Owner

@⁠lambirou on GitHub · 2026-12-03 14:40 UTC · original

Fixed in 9d7f08d57.

A missing indirect_peaks side now renders as n/a, while a reported zero remains 0. I added the requested one-sided CLI regression: run A has no indirect line, run B reports forwarded/drawindexed = 7, and both the metric and cause tables render n/a | 7 | n/a without crashing.

Targeted CTest: 8 passed, 1 existing debug-layer capability skip. The merged #3937 snapshot tests pass on both WARP and the AMD adapter.

**@⁠lambirou** on GitHub · 2026-12-03 14:40 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3939#issuecomment-7381845728) Fixed in `9d7f08d57`. A missing `indirect_peaks` side now renders as `n/a`, while a reported zero remains `0`. I added the requested one-sided CLI regression: run A has no indirect line, run B reports `forwarded/drawindexed = 7`, and both the metric and cause tables render `n/a | 7 | n/a` without crashing. Targeted CTest: 8 passed, 1 existing debug-layer capability skip. The merged #3937 snapshot tests pass on both WARP and the AMD adapter.
github-bot changed target branch from main to gh-pr/3939/base 2026-12-03 15:08:29 +00:00
github manually merged commit 9d7f08d57c into gh-pr/3939/base 2026-12-03 15:08:38 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 15:03 UTC · original · approved these changes

Re-reviewed 9d7f08d5. Both missing-side orientations now preserve n/a, and an empty but reported Counter yields zero. Independently checked n/a | 7 | n/a, 7 | n/a | n/a, and 0 | 7 | 7. The Python triage checks and all 10 CLI tests passed. Rebuilt the Windows MSVC Debug fixture and ran ctest --preset dev --no-tests=error -j 1 -V -R '^startup_(draw_path_report_warp|triage_run(_cli)?)$': 2/2 registered tests passed. This addresses my paired-report crash review.

**@⁠R0Y00** on GitHub · 2026-12-03 15:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3939#pullrequestreview-6172390440) · **approved these changes** Re-reviewed 9d7f08d5. Both missing-side orientations now preserve n/a, and an empty but reported Counter yields zero. Independently checked n/a | 7 | n/a, 7 | n/a | n/a, and 0 | 7 | 7. The Python triage checks and all 10 CLI tests passed. Rebuilt the Windows MSVC Debug fixture and ran `ctest --preset dev --no-tests=error -j 1 -V -R '^startup_(draw_path_report_warp|triage_run(_cli)?)$'`: 2/2 registered tests passed. This addresses my paired-report crash review.
This discussion has been locked. Commenting is limited to contributors.
No description provided.