Skip to content

Tools: graphics-path progress page counted from the code (D3D12→Vulkan milestones, interface coverage, RDNA2 ISA, formats) - #3420

Closed
AlxcBTW wants to merge 2 commits into
ItsNotRexed:mainfrom
AlxcBTW:graphics-progress
Closed

AlxcBTW wants to merge 2 commits into
ItsNotRexed:mainfrom
AlxcBTW:graphics-progress

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue #2300 (comment 7084780548).

What and why

A progress page for the graphics path only: the D3D12 to Vulkan layer under runtime/ and the RDNA2 to SPIR-V translator tools/rdna2spirv.py. It leads with "Counted from the code; says nothing about whether the game runs.", then an overview grid of six tiles (milestones, D3D12 methods, RDNA2 instructions, buffer formats, graphics tests, refusal sites), then one section per area. Each section states how its number is counted. Per-interface and per-format cell grids show which methods and format codes are covered; names are on hover and in the tables.

Inspired by the layout of AnyPS5's progress page (per-area tables, a method statement, JSON, history). No code, markup, styles or wording were taken from it; everything here is written from scratch.

How it complements the open trackers: #762 (PROC-26 subsystem source tracker) and #2681 (tools/progress_dashboard) count the whole project. This counts only graphics-path facts. Output names are docs/progress/graphics*, so they do not collide with #762's docs/progress files. Both of those PRs also edit README.md; this PR changes one other line of it, and git merge-tree against current main is clean.

Outputs are not committed. docs/isa_coverage.md is a hand-committed snapshot, while #762 pushes bot commits to main. A daily bot commit would add churn and would collide with #762's pushes to docs/progress/. The workflow regenerates the page, uploads it as an artifact and deploys to Pages only when Pages is enabled (it is not enabled on this repository today, so the guard skips it). .gitignore keeps local runs out of git status.

How each number is counted

Details are in docs/graphics_progress.md and on the page.

  • Milestones: rows of the section 6 table in docs/d3d12_vulkan.md, each id once. Status is read from the row's own words ("Met by" / "**Met", "Synthetic part met", "Partly met", else open). Open PRs are not known offline.
  • D3D12 interfaces: the interfaces handed to tools/gen_d3d12_stubs.py in runtime/CMakeLists.txt. Methods per interface come from tools/graphics_progress_data.json (names only, from the Windows SDK d3d12.h; regenerate with --refresh-data). Real: an override with a body in the class derived from the generated stub class, or in the shared object template. Refuses: body is only return E_NOTIMPL;. Stub: no override. Matching is by name, like gen_d3d12_stubs.py --report.
  • RDNA2 ISA: tools/isa_coverage.py as a library on the translator text. AMD's XML is not in the repo, so the total and share are the ones docs/isa_coverage.md states (labelled as such); --isa gives a fresh one.
  • Formats: Gen.FORMATS keys (read with ast) out of the codes in tools/gfx10_formats.json; DXGI names in vulkan_format() and vertex_format() out of the DXGI list in the data file.
  • Tests: distinct add_test(NAME ...) names in runtime/CMakeLists.txt, by area.
  • Unsupported sites: raise Unsupported(...) per translator function; E_NOTIMPL tokens and "unsupported" / "not implemented" strings outside comments in the graphics-path files of runtime/.

The tool never imports or runs measured code, opens no socket, and runs only git (for --tree <ref>). Output is deterministic (sorted keys, LF, no clock); a date appears only with --date, which also appends one point to the history file. In CI the history is carried in the Actions cache.

Findings

  • README's D3D12 to Vulkan line said root signatures, pipelines, draws, placed resources, 1D textures and a swapchain were missing. The counts show the interfaces (ID3D12RootSignature 5 of 5, ID3D12PipelineState 6 of 6, ID3D12Heap 6 of 6) and registered tests (d3d12_draw, d3d12_texture1d, d3d12_present, d3d12_compute) for all of them. I changed that one sentence and left the rest of the status table alone.
  • docs/d3d12_vulkan.md section 6 lists the M2 and M3 rows twice. The page counts each id once and says so.
  • tools/isa_coverage.py accepted_names(): _in_skipped walks the comparator and finds the shared ast.Load singleton that the refusing test's op name also holds, so any tuple or list of names (op in (a, b)) is treated as skipped whenever the file has a refusing-only test. That undercounts exact names. I did not change it here; this page does its own count from scan_translator() and uses accepted_names() only with --isa.

Tested

  • python -I tests/test_graphics_progress.py: 38 tests. Synthetic fixture trees for every counter, determinism, history, --tree on a throwaway git repo, the stdout guard (including a path outside the code page), and a no-network / no-exec check (AST imports, no exec/eval, subprocess only runs git, a full run with sockets blocked).
  • test_tool_stdout_encoding.py, test_docs_links.py, test_docs_design_rows.py, test_docs_list_items.py, test_docs_repo_paths.py, test_isa_coverage.py, test_gen_d3d12_stubs.py, test_d3d12_stubs_generation.py, test_text_write_line_endings.py, test_i18n_index.py pass, also under pytest. python -m compileall -q make_game.py tools tests is clean. The full tests/ pytest run was started and stopped at about 21% with no failures; I did not let it finish.
  • actionlint 1.7.12 on the new workflow: clean. The workflow itself has not run on GitHub yet.
  • Hand spot checks against the code: ID3D12Fence1 (9 methods: 4 object, GetDevice, 3 fence, GetCreationFlags), ID3D12CommandQueue (16: 11 queue methods plus 5 inherited, all 11 overridden in d3d12_com.cpp), ID3D12GraphicsCommandList8 (14 stubs, including DispatchMesh, BeginRenderPass, SOSetTargets, none overridden); format codes 22 and 56 are Gen.FORMATS keys, 36 and 3 are not; R8G8B8A8_UNORM and BC7_UNORM are cases in vulkan_format(), R1_UNORM and A8_UNORM are not; milestones M1 ("**Met") and M7 ("Partly met") match their rows.
  • The page was rendered in headless Chrome at 1100 px and 360 px, light and dark. The grid goes 3, 2 and 1 columns. Text contrast is at least 5.6:1 in both themes.
  • No GPU was involved; nothing here needs one.

Checklist

  • No game data, keys, decryption or protection workarounds. No shaders or logs in the fixtures.
  • Standard library only, runs under python -I.
  • Nothing online in the tool; the workflow is the only thing that talks to GitHub.
  • git merge-tree --write-tree origin/main HEAD is clean.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

tools/graphics_progress.py reads the committed source (working tree or a git
ref) and writes graphics.json, graphics.html and graphics.md: D3D12 to Vulkan
milestones from docs/d3d12_vulkan.md, per-interface method coverage, RDNA2 ISA
counts via tools/isa_coverage.py, GFX10 buffer and DXGI formats, registered
ctest names per area and the places that refuse work. Nothing is built, run or
imported. A workflow regenerates and publishes it; outputs are not committed.

README: the D3D12 to Vulkan status line said root signatures, pipelines, draws,
placed resources, 1D textures and a swapchain were missing; the layer has all
of them and a registered test each, so the line is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n carry

A buffer V# holds FORMAT in 7 bits, and the table's codes from 128 (sRGB, BC,
FMASK, ...) are image-only, so the buffer share is now over codes 1 to 127 of
tools/gfx10_formats.json (1 to 77 in the table) instead of all 159. The image-only
codes are listed apart, counted as the codes runtime/src/gfx10_descriptors.h maps.

The data file names its SDK version, a method is counted once per vtable slot
(the two spellings of GetDesc were counted twice in the data), and the page says
where the DXGI total comes from. The live ISA count uses isa_coverage's
accepted_names() again now that main fixed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ICUMADETHIS

Copy link
Copy Markdown
Contributor

Ran f499c6a1 on Windows 11 (Python 3.12): tests/test_graphics_progress.py passes, and tools/graphics_progress.py --print works here too (2 of 9 milestones, 227 of 254 D3D12 methods real).

One thing in the new README row: buffer shader-resource views are still missing on main, so I think they should stay in the "still open" list. CreateShaderResourceView stubs a buffer (runtime/shims/d3d12_vulkan_device.cpp:5021, "Buffer views are not implemented"). The method counts as real because the texture path is real, and the page itself says a real body can be partial. Constant-buffer views and buffer UAVs are in; #1773 is the open PR for buffer SRVs.

Small one too: placed resources on main are 2D (plus tiled 3D) only for now. 1D and 3D come with #3351.

AI-assisted.

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

Independent CPU/source review of f499c6a16156f1e290f5c47c54bb0fa09b536461 (AI-assisted with Codex).

Verified the revised buffer count of 41/77 against the source. The runtime packs and unpacks a seven-bit FORMAT field at bit 12, and the translator uses the matching mask. The named, non-invalid table entries within that range are exactly 1 through 77, and all 41 Gen.FORMATS keys are in that set. The report lists the 82 higher codes separately. Stock uv-managed CPython 3.12.13 on Windows produced 63 passes and 3 AMD XML skips across four focused suites, including all 41 graphics report tests. Two runs from the pinned tree produced byte-identical JSON, HTML, and Markdown. This review covered source and local CPU checks only.

Two ISA labels could be more precise:

  • branches_that_raise and the matching report row count 162 distinct opcode names in scan["partial"]. For example, the single conditional branch at tools/rdna2spirv.py:6614 contributes both names in its comparison. Please label the metric ?distinct opcode names in branches that can raise? and align the JSON field with that unit.
  • The report's 533 live source matches come from comparisons and tables via accepted_names(). I'd label the live row ?opcode names matched in source? and make ?snapshot? explicit on the 844/1,153 tile, which reports the documented 41f44826 XML result. The existing PR description still says accepted_names() is used only with --isa and drops the tuple comparisons. This head uses the helper for both paths, and the existing tuple regression passed.

@AlxcBTW

AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing this. We've decided not to add a progress page for now. #762 and #2681 already cover that area.

AI-assisted (Claude Code).

@AlxcBTW AlxcBTW closed this Nov 22, 2026
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