Five contributions from the RPF9 side: mesh/GS ABI, wave64, typeless formats, pipeline library, XMem pages #564

Open
opened 2026-11-26 04:08:28 +00:00 by github-bot · 2 comments
Owner

@⁠JoshRob297 on GitHub · 2026-11-24 04:57 UTC · original

Following #22 — here is what we have that may be useful. One is already a pull request (#561); the other four are documents, written against 1dd7afd, that we can turn into code if any of them fits your direction.

Context for the bias: we have been working the same title from a different angle — a C++ fork of Leonida plus static analysis of the retail executable and an offline index of its archives. That gives us measurements where you have runtime behaviour, and it is why some of these are dossiers rather than patches.

1. Mesh and geometry stage ABI — 01-mesh-gs-abi.md
The two ABI tables a DXIL emitter has to reproduce — mesh and geometry, with the exact semantics, order and per-vertex fields — plus the wave64 criterion, all GPU-checked on our side. It is first in the list because your table says merged geometry stages are missing entirely, not 90% done. Does not cover the 315 mesh programs that already fail for reasons only your logs would show.

2. wave64 on a 32-wide host — 02-wave64.md
The emulation algorithm we verified for compute and mesh, the barrier placement it needs, and the test vectors. 23,841 of 26,503 shaders in the corpus are wave64, so this is the difference between "runs on the developer's card" and "runs on the NVIDIA machine in #16". Design, not code: it is a large change.

3. XMem: commit physical pages in pieces — pull request #561
Your #23: the title stops when Windows cannot commit 6.5 GB at once. The console ABI carries a page count and the title compares what it got, so the shim can commit what the host allows and report the real count. Type-checked against x86_64-pc-windows-msvc with the pinned 1.98.1; not run against a title.

4. Typeless resources for formats 86 and 115 — 04-typeless-86-115.md
The recipe for when the host has no TYPED_UNORDERED_ACCESS_VIEW for B5G5R5A1_UNORM or no RENDER_TARGET for B4G4R4A4_UNORM: create typeless with a two-format view list, pack on clear and copy, and decide by CheckFeatureSupport(FORMAT_SUPPORT) per use rather than by vendor name. Restores two 2560x1440 targets; does not touch the million-descriptor cap, which is the reporter's own prime suspect.

5. The pipeline library as a warm-up source — 05-pipeline-library.md
25,471 graphics and 2,693 compute pipeline records, with the stage pairing per record (13,383 VS+PS, 10,726 MS+PS, 1,336 MS-only, 24 VS-only, 2 with an unidentified slot). Turns first-use translation into a precomputed set and gives a coverage metric that is not "whatever the frame happened to touch". Unblocks nothing by itself.

Two notes on provenance: the first four are in Spanish — say the word and any of them gets translated. None of this carries game data: no asset paths, no archive names, no hashes of shipped content, only counts, offsets and structure sizes.

If none of it is what you need right now, that is a useful answer too — tell me which of your blockers is nearest and I will point the effort there instead.

**@⁠JoshRob297** on GitHub · 2026-11-24 04:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/564) Following #22 — here is what we have that may be useful. One is already a pull request (#561); the other four are documents, written against `1dd7afd`, that we can turn into code if any of them fits your direction. Context for the bias: we have been working the same title from a different angle — a C++ fork of Leonida plus static analysis of the retail executable and an offline index of its archives. That gives us measurements where you have runtime behaviour, and it is why some of these are dossiers rather than patches. **1. Mesh and geometry stage ABI** — [01-mesh-gs-abi.md](https://github.com/JoshRob297/rpf9-research/blob/main/docs/aportes/01-mesh-gs-abi.md) The two ABI tables a DXIL emitter has to reproduce — mesh and geometry, with the exact semantics, order and per-vertex fields — plus the wave64 criterion, all GPU-checked on our side. It is first in the list because your table says merged geometry stages are missing *entirely*, not 90% done. Does not cover the 315 mesh programs that already fail for reasons only your logs would show. **2. wave64 on a 32-wide host** — [02-wave64.md](https://github.com/JoshRob297/rpf9-research/blob/main/docs/aportes/02-wave64.md) The emulation algorithm we verified for compute and mesh, the barrier placement it needs, and the test vectors. 23,841 of 26,503 shaders in the corpus are wave64, so this is the difference between "runs on the developer's card" and "runs on the NVIDIA machine in #16". Design, not code: it is a large change. **3. XMem: commit physical pages in pieces** — pull request #561 Your #23: the title stops when Windows cannot commit 6.5 GB at once. The console ABI carries a page count and the title compares what it got, so the shim can commit what the host allows and report the real count. Type-checked against `x86_64-pc-windows-msvc` with the pinned 1.98.1; **not run** against a title. **4. Typeless resources for formats 86 and 115** — [04-typeless-86-115.md](https://github.com/JoshRob297/rpf9-research/blob/main/docs/aportes/04-typeless-86-115.md) The recipe for when the host has no `TYPED_UNORDERED_ACCESS_VIEW` for `B5G5R5A1_UNORM` or no `RENDER_TARGET` for `B4G4R4A4_UNORM`: create typeless with a two-format view list, pack on clear and copy, and decide by `CheckFeatureSupport(FORMAT_SUPPORT)` per use rather than by vendor name. Restores two 2560x1440 targets; does not touch the million-descriptor cap, which is the reporter's own prime suspect. **5. The pipeline library as a warm-up source** — [05-pipeline-library.md](https://github.com/JoshRob297/rpf9-research/blob/main/docs/aportes/05-pipeline-library.md) 25,471 graphics and 2,693 compute pipeline records, with the stage pairing per record (13,383 VS+PS, 10,726 MS+PS, 1,336 MS-only, 24 VS-only, 2 with an unidentified slot). Turns first-use translation into a precomputed set and gives a coverage metric that is not "whatever the frame happened to touch". Unblocks nothing by itself. Two notes on provenance: the first four are in Spanish — say the word and any of them gets translated. None of this carries game data: no asset paths, no archive names, no hashes of shipped content, only counts, offsets and structure sizes. If none of it is what you need right now, that is a useful answer too — tell me which of your blockers is nearest and I will point the effort there instead.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:08:28 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-24 14:51 UTC · original

Thanks for the ABI dossier in #564 — I used the geometry-stage section to implement HwStage::Gs → DXIL gs_6_6 translation in victory-shader.

Since new PRs are currently paused, the branch is up on my fork: Androtim/VIctory@shaders/geometry-stage (commit c0ec8c1, based on main dd54de2).

Summary:

  • native.rs: parse HwStage::Gs RECORD_LDS into StageIo::Gs(GeometryIo).
  • io.rs: raise GFX10 merged ES+GS hardware inputs (s2, s3, v0/v1/v4 packed 16-bit vertex offsets, v2 SV_PrimitiveID, v3 SV_GSInstanceID).
  • emit/bitcode.rs, emit/shader.rs, emit/container.rs, emit/mod.rs: emit LLVM 3.7 alloca, gs_6_6 shader model, kDxilGSStateTag, 4-stream interleaved dx.viewIdState, and PSV0 GSInfo + MaxVertexCount (stream 0; multi-stream explicitly rejected).
  • emit/lower.rs: entry-block allocas for ES-to-GS inputs (populated via vertex-indexed dx.op.loadInput at high 16-bit synthetic offsets) and per-invocation GSVS output + emitted-vertex counter; lower ds_read*/ds_write*, s_sendmsg(MSG_GS | MSG_GS_DONE, EMIT/CUT/EMIT_CUT/NOP) → storeOutput + emitStream/cutStream/emitThenCutStream, s_bfm_b64 (pure 32-bit, no INT64), GS v_mbcnt_lo/hi (all-ones mask at virtual lane 0), and GS opaque EXEC masks.

Testing (Linux, synthetic data only — no game data):

  • cargo test -p victory-shader: 75 passed, 0 failed (6 new unit tests).
  • cargo clippy -p victory-shader --all-targets: 0 new warnings.
  • cargo xtask policy: 152 files ok.

The end-to-end GS test includes the #[cfg(windows)] dxil.dll validation hook, so if anyone on Windows can run cargo test -p victory-shader on this branch to check dxil.dll validation (or test against real GS containers), feedback is very welcome.

(AI-assisted with Gemini.)

**@⁠Androtim** on GitHub · 2026-11-24 14:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/564#issuecomment-7135073919) Thanks for the ABI dossier in #564 — I used the geometry-stage section to implement `HwStage::Gs` → DXIL `gs_6_6` translation in `victory-shader`. Since new PRs are currently paused, the branch is up on my fork: [Androtim/VIctory@`shaders/geometry-stage`](https://github.com/Androtim/VIctory/tree/shaders/geometry-stage) (commit `c0ec8c1`, based on `main` `dd54de2`). **Summary:** - `native.rs`: parse `HwStage::Gs` `RECORD_LDS` into `StageIo::Gs(GeometryIo)`. - `io.rs`: raise GFX10 merged ES+GS hardware inputs (`s2`, `s3`, `v0`/`v1`/`v4` packed 16-bit vertex offsets, `v2` `SV_PrimitiveID`, `v3` `SV_GSInstanceID`). - `emit/bitcode.rs`, `emit/shader.rs`, `emit/container.rs`, `emit/mod.rs`: emit LLVM 3.7 `alloca`, `gs_6_6` shader model, `kDxilGSStateTag`, 4-stream interleaved `dx.viewIdState`, and `PSV0` `GSInfo` + `MaxVertexCount` (stream 0; multi-stream explicitly rejected). - `emit/lower.rs`: entry-block `alloca`s for ES-to-GS inputs (populated via vertex-indexed `dx.op.loadInput` at high 16-bit synthetic offsets) and per-invocation GSVS output + emitted-vertex counter; lower `ds_read*`/`ds_write*`, `s_sendmsg(MSG_GS | MSG_GS_DONE, EMIT/CUT/EMIT_CUT/NOP)` → `storeOutput` + `emitStream`/`cutStream`/`emitThenCutStream`, `s_bfm_b64` (pure 32-bit, no `INT64`), GS `v_mbcnt_lo/hi` (all-ones mask at virtual lane 0), and GS opaque EXEC masks. **Testing (Linux, synthetic data only — no game data):** - `cargo test -p victory-shader`: 75 passed, 0 failed (6 new unit tests). - `cargo clippy -p victory-shader --all-targets`: 0 new warnings. - `cargo xtask policy`: 152 files ok. The end-to-end GS test includes the `#[cfg(windows)]` `dxil.dll` validation hook, so if anyone on Windows can run `cargo test -p victory-shader` on this branch to check `dxil.dll` validation (or test against real GS containers), feedback is very welcome. *(AI-assisted with Gemini.)*
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:48 UTC · original

Automated triage for the maintainers.

Thanks for the offer. These all fit the project's scope (Windows hosts, this title, files the user supplies). Whether to take any of them is up to the maintainers. Where each topic stands on main and in open PRs:

  1. Merged geometry stages: still listed as missing in the README (195 programs). Open PRs: #1399 and its rebase #1924. Androtim's fork branch shaders/geometry-stage (comment above) is a third implementation. Pull requests are open to everyone, so please open it as a PR if it adds something #1924 doesn't.
  2. wave64 on 32-lane hosts: open PRs #1929 (rebase of #233), #1890 and #1922.
  3. XMem pages in pieces: #561 is open and needs a rebase.
  4. Formats 86/115 without typed UAV / RT support: related open PRs are #1843, #1926 and #1832.
  5. Pipeline library warm-up: translate --cache --pipelines on main already pre-builds every pipeline in the title's shader pack (README, Getting started).

Code that lands needs to stand on its own here, with synthetic tests and no material taken from the game. These documents are hosted off this repository, and this triage did not review them.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/564#issuecomment-7149983304) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T14:51:52Z at=2026-11-25T01:49:50Z --> Automated triage for the maintainers. Thanks for the offer. These all fit the project's scope (Windows hosts, this title, files the user supplies). Whether to take any of them is up to the maintainers. Where each topic stands on `main` and in open PRs: 1. **Merged geometry stages:** still listed as missing in the README (195 programs). Open PRs: #1399 and its rebase #1924. Androtim's fork branch `shaders/geometry-stage` (comment above) is a third implementation. Pull requests are open to everyone, so please open it as a PR if it adds something #1924 doesn't. 2. **wave64 on 32-lane hosts:** open PRs #1929 (rebase of #233), #1890 and #1922. 3. **XMem pages in pieces:** #561 is open and needs a rebase. 4. **Formats 86/115 without typed UAV / RT support:** related open PRs are #1843, #1926 and #1832. 5. **Pipeline library warm-up:** `translate --cache --pipelines` on `main` already pre-builds every pipeline in the title's shader pack (README, Getting started). Code that lands needs to stand on its own here, with synthetic tests and no material taken from the game. These documents are hosted off this repository, and this triage did not review them. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#564
No description provided.