Pipelines: scalar ops s_pack/s_bitreplicate/s_bfm; device method 0x218 read, off by default (VICTORY_LOOSE_COMPUTE=1) #506

Merged
Quicexo28 merged 5 commits from upstream-pr/506 into main 2026-11-29 08:16:59 +00:00
Quicexo28 commented 2026-11-27 23:41:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Quicexo28 on 2026-11-27T23:41:56Z.


Corrected after review (see the comment below)

The first version of this description said that answering device method 0x218 with E_NOTIMPL leaves the title without the pipeline, and that nothing was worse off with this change. That was wrong: the title then makes the same compute pipeline from a container through method 0x1f0, and those translate far better than the loose parts. Thanks to wildheathen for catching it. The loose compute pipelines are now off by default (VICTORY_LOOSE_COMPUTE=1 turns them on); what stays on is the scalar operations and the tools.

What this PR does now

  • Scalar operations the translator refused: s_pack_{ll,lh,hh}_b32_b16, s_bitreplicate_b64_b32, s_bfm_b64. They apply to every program, not only to loose ones (found by putting 600 dumped loose programs through the translator: 20 shaders stopped at s_pack_*, 5 at s_bitreplicate, 1 at s_bfm_b64). Tested on the device against the definitions, over both result dwords.
  • Reading 0x218 (pipeline::create_loose_compute), opt-in: the five (address, size) pairs of the description are the entries of an FSPX part (kinds 0, 1, 6, 7); they are put into a container with one ACCC part and go the existing way. fspx_program also takes root constants now (resource type 2, root type 0, 4 dwords at b500...), which 189 of 600 dumps had.
  • Tools: VICTORY_DUMP_PSO=<dir> saves the first 600 calls of each unknown method (the description, then each pair's address, size and bytes), and the log of an unimplemented call shows the first bytes of each part (pairs=).
  • docs/loose-pipelines.md: what is known of 0x218 and of 0x1c8 (not read), and why 0x218 is off.

Measured

On one RTX 5070 (driver 610.88), the same scripted start, play sessions of two minutes:

compute programs translated did not translate draws dropped, steady state
VICTORY_LOOSE_COMPUTE=0 (the fallback, now the default) 765 1 116 of 3,575 (3 %)
VICTORY_LOOSE_COMPUTE=1 225 893 840 of 2,891 (29 %)

So with it on, the 0x1f0 fallback is lost for the loose programs that do not translate. Of 600 dumped loose programs 204 translate (loose_compute_dumps_translate, needs the dumps, #[ignore]d). The user who ran these sessions also saw the world come out grey with it on; I did not check that this is the cause.

Tests

  • cargo test -p victory-shader: 291 passed. cargo test -p victory-gpu --lib: 435 passed, 2 failed (indirect::tests::host_list_budget_starts_empty_at_each_submission, warp_batch_charges_every_execution), which fail the same on main at 64d4931.
  • clippy: none of the files touched has a finding; main has 39 in victory-gpu and a few elsewhere on 1.98.1.

Not here

0x1c8 (a graphics pipeline): same shape, six pairs; what is missing is in docs/loose-pipelines.md. And the follow-up the review suggests for 0x218: answer S_OK only for a loose program that translates, E_NOTIMPL for the rest, which needs the translation in the call.

🤖 Generated with Claude Code

https://claude.ai/code/session_019EHxy7BaFL4hoYL2bnHQKT

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5534543945 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/506). Originally posted by [Quicexo28](https://github.com/Quicexo28) on 2026-11-27T23:41:56Z. --- ## Corrected after review (see the comment below) The first version of this description said that answering device method 0x218 with `E_NOTIMPL` leaves the title without the pipeline, and that nothing was worse off with this change. **That was wrong**: the title then makes the same compute pipeline from a container through method 0x1f0, and those translate far better than the loose parts. Thanks to wildheathen for catching it. The loose compute pipelines are now **off by default** (`VICTORY_LOOSE_COMPUTE=1` turns them on); what stays on is the scalar operations and the tools. ## What this PR does now - **Scalar operations** the translator refused: `s_pack_{ll,lh,hh}_b32_b16`, `s_bitreplicate_b64_b32`, `s_bfm_b64`. They apply to every program, not only to loose ones (found by putting 600 dumped loose programs through the translator: 20 shaders stopped at `s_pack_*`, 5 at `s_bitreplicate`, 1 at `s_bfm_b64`). Tested on the device against the definitions, over both result dwords. - **Reading 0x218** (`pipeline::create_loose_compute`), **opt-in**: the five (address, size) pairs of the description are the entries of an `FSPX` part (kinds 0, 1, 6, 7); they are put into a container with one `ACCC` part and go the existing way. `fspx_program` also takes root constants now (resource type 2, root type 0, 4 dwords at `b500`...), which 189 of 600 dumps had. - **Tools**: `VICTORY_DUMP_PSO=<dir>` saves the first 600 calls of each unknown method (the description, then each pair's address, size and bytes), and the log of an unimplemented call shows the first bytes of each part (`pairs=`). - `docs/loose-pipelines.md`: what is known of 0x218 and of 0x1c8 (not read), and why 0x218 is off. ## Measured On one RTX 5070 (driver 610.88), the same scripted start, play sessions of two minutes: | | compute programs translated | did not translate | draws dropped, steady state | |---|---|---|---| | `VICTORY_LOOSE_COMPUTE=0` (the fallback, now the default) | 765 | 1 | 116 of 3,575 (3 %) | | `VICTORY_LOOSE_COMPUTE=1` | 225 | 893 | 840 of 2,891 (29 %) | So with it on, the 0x1f0 fallback is lost for the loose programs that do not translate. Of 600 dumped loose programs 204 translate (`loose_compute_dumps_translate`, needs the dumps, `#[ignore]`d). The user who ran these sessions also saw the world come out grey with it on; I did not check that this is the cause. ## Tests - `cargo test -p victory-shader`: 291 passed. `cargo test -p victory-gpu --lib`: 435 passed, 2 failed (`indirect::tests::host_list_budget_starts_empty_at_each_submission`, `warp_batch_charges_every_execution`), which fail the same on `main` at 64d4931. - clippy: none of the files touched has a finding; `main` has 39 in `victory-gpu` and a few elsewhere on 1.98.1. ## Not here 0x1c8 (a graphics pipeline): same shape, six pairs; what is missing is in `docs/loose-pipelines.md`. And the follow-up the review suggests for 0x218: answer `S_OK` only for a loose program that translates, `E_NOTIMPL` for the rest, which needs the translation in the call. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_019EHxy7BaFL4hoYL2bnHQKT
wildheathen commented 2026-11-28 01:25:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by wildheathen on 2026-11-28T01:25:04Z.


One thing to check before this goes on by default: when 0x218 answers E_NOTIMPL the title does not go without the pipeline, it makes it another way.

fxceless/victory-fork#113 (the corrected version and its last comment) counted it on an RTX 5080: for each of the 26 root signatures that see 0x218, the number of failed 0x218 calls equals the number of compute pipelines then made from a container through method 0x1f0, signature by signature (2,689 = 2,689 in that run). The same comment tried what this PR does (parts, native program, container, the existing path) and got 228 of 2,689 programs through the translator, against 2,720 of 2,734 for the containers the fallback uses, and did not open a PR for that reason: a 0x218 that succeeds makes the title skip the fallback.

Here 204 of 600 translate. If that fallback holds on this tree too, the other 396 would lose a pipeline they have today (the container's program would have translated), and "Nothing that did not translate before is worse off: those pipelines had none" would not hold.

Two ways I can see to keep what this PR reads without that risk:

  • answer S_OK only when the loose program translates, and E_NOTIMPL otherwise, so the title falls back for the rest (translation would have to happen in the call, or its result be known by then);
  • or leave VICTORY_LOOSE_COMPUTE off by default until the count is done here: compute pipelines made through 0x1f0 with the switch on against off, and the frame line's "dropped without a host pipeline".

I can run that count on an RTX 5080 (3-minute scripted runs, diagnostics build) if it helps. I dumped the descriptions independently tonight (the first 600 distinct ones of a three-minute run: 558 from 0x1c8, 42 from 0x218; calls past 16,384 and 2,048). For 0x218 what I saw matches what is written here as far as I looked: a 28-byte block, a 20-byte block, then the code and a table of tagged 32-byte entries.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231651289 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/506#issuecomment-7231651289). Originally posted by [wildheathen](https://github.com/wildheathen) on 2026-11-28T01:25:04Z. --- One thing to check before this goes on by default: when 0x218 answers `E_NOTIMPL` the title does not go without the pipeline, it makes it another way. fxceless/victory-fork#113 (the corrected version and its last comment) counted it on an RTX 5080: for each of the 26 root signatures that see 0x218, the number of failed 0x218 calls equals the number of compute pipelines then made from a container through method 0x1f0, signature by signature (2,689 = 2,689 in that run). The same comment tried what this PR does (parts, native program, container, the existing path) and got 228 of 2,689 programs through the translator, against 2,720 of 2,734 for the containers the fallback uses, and did not open a PR for that reason: a 0x218 that succeeds makes the title skip the fallback. Here 204 of 600 translate. If that fallback holds on this tree too, the other 396 would lose a pipeline they have today (the container's program would have translated), and "Nothing that did not translate before is worse off: those pipelines had none" would not hold. Two ways I can see to keep what this PR reads without that risk: - answer `S_OK` only when the loose program translates, and `E_NOTIMPL` otherwise, so the title falls back for the rest (translation would have to happen in the call, or its result be known by then); - or leave `VICTORY_LOOSE_COMPUTE` off by default until the count is done here: compute pipelines made through 0x1f0 with the switch on against off, and the frame line's "dropped without a host pipeline". I can run that count on an RTX 5080 (3-minute scripted runs, diagnostics build) if it helps. I dumped the descriptions independently tonight (the first 600 distinct ones of a three-minute run: 558 from 0x1c8, 42 from 0x218; calls past 16,384 and 2,048). For 0x218 what I saw matches what is written here as far as I looked: a 28-byte block, a 20-byte block, then the code and a table of tagged 32-byte entries.
Quicexo28 commented 2026-11-28 02:35:57 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Quicexo28 on 2026-11-28T02:35:57Z.


You are right, and it holds on this tree too. I counted it from the logs of two play sessions of the same scripted start on an RTX 5070:

  • fallback (0x218 answers E_NOTIMPL): 765 compute programs translated, 1 not; steady state 116 of 3,575 draws dropped for want of a host pipeline (3 %);
  • this PR's loose pipelines on: 225 translated, 893 not; 840 of 2,891 dropped (29 %).

So "nothing that did not translate before is worse off" was false: a 0x218 that succeeds makes the title skip the 0x1f0 fallback. I pushed a commit that makes the loose compute pipelines off by default (VICTORY_LOOSE_COMPUTE=1 turns them on), corrected the description and the doc, and kept the scalar operations (s_pack_*, s_bitreplicate, s_bfm_b64), which help the container path too.

One thing in the commit message is more than I checked: it says the world came out grey with the loose pipelines on. The person who ran them saw a grey world in such a session, but I did not show that this is the cause; read it as unconfirmed.

I would take the first of your two options as the follow-up (answer S_OK only for a loose program that translates, E_NOTIMPL for the rest), with the translation in the call and the cost of that at load measured. Your count on the 5080 of 0x1f0 pipelines with the switch on against off would be the check I cannot run; if you do run it, I would rather know the numbers before touching this again.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232470848 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/506#issuecomment-7232470848). Originally posted by [Quicexo28](https://github.com/Quicexo28) on 2026-11-28T02:35:57Z. --- You are right, and it holds on this tree too. I counted it from the logs of two play sessions of the same scripted start on an RTX 5070: - fallback (0x218 answers `E_NOTIMPL`): 765 compute programs translated, 1 not; steady state 116 of 3,575 draws dropped for want of a host pipeline (3 %); - this PR's loose pipelines on: 225 translated, 893 not; 840 of 2,891 dropped (29 %). So "nothing that did not translate before is worse off" was false: a 0x218 that succeeds makes the title skip the 0x1f0 fallback. I pushed a commit that makes the loose compute pipelines **off by default** (`VICTORY_LOOSE_COMPUTE=1` turns them on), corrected the description and the doc, and kept the scalar operations (`s_pack_*`, `s_bitreplicate`, `s_bfm_b64`), which help the container path too. One thing in the commit message is more than I checked: it says the world came out grey with the loose pipelines on. The person who ran them saw a grey world in such a session, but I did not show that this is the cause; read it as unconfirmed. I would take the first of your two options as the follow-up (answer `S_OK` only for a loose program that translates, `E_NOTIMPL` for the rest), with the translation in the call and the cost of that at load measured. Your count on the 5080 of 0x1f0 pipelines with the switch on against off would be the check I cannot run; if you do run it, I would rather know the numbers before touching this again.
wildheathen commented 2026-11-28 08:32:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by wildheathen on 2026-11-28T08:32:31Z.


Ran it on the RTX 5080 (driver 621.24, 32 GB, Windows 11), head 3453125, diagnostics build, the same 3-minute scripted start twice. Medians of the last 40 seconds in the world:

default (0x218 answers E_NOTIMPL) VICTORY_LOOSE_COMPUTE=1
compute shaders that do not translate 2 698
draws dropped without a host pipeline 212 of 3,298 (6 %) 1,380 of 3,457 (40 %)

So it holds here as on your 5070: off by default is right. I counted untranslated shaders and dropped draws, not the 0x1f0 creations themselves (the log does not tell them apart). No device removal in either run; one run each.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7236649451 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/506#issuecomment-7236649451). Originally posted by [wildheathen](https://github.com/wildheathen) on 2026-11-28T08:32:31Z. --- Ran it on the RTX 5080 (driver 621.24, 32 GB, Windows 11), head 3453125, diagnostics build, the same 3-minute scripted start twice. Medians of the last 40 seconds in the world: | | default (0x218 answers `E_NOTIMPL`) | `VICTORY_LOOSE_COMPUTE=1` | |---|---|---| | compute shaders that do not translate | 2 | 698 | | draws dropped without a host pipeline | 212 of 3,298 (6 %) | 1,380 of 3,457 (40 %) | So it holds here as on your 5070: off by default is right. I counted untranslated shaders and dropped draws, not the 0x1f0 creations themselves (the log does not tell them apart). No device removal in either run; one run each.
JeremRuiz commented 2026-11-28 23:48:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by JeremRuiz on 2026-11-28T23:48:08Z.


The 0x1c8 side, counted: when 0x1c8 answers E_NOTIMPL the title makes the pipeline from a stream through 0x2b0, as 0x218 falls back to 0x1f0. So the sentence in docs/loose-pipelines.md "For 0x1c8 nothing was seen to take its place" does not hold, and neither does the log line's "the title goes without this pipeline", for either method.

How it was counted. A diagnostics-only counter (not part of this PR, local branch) records each failed 0x1c8 and 0x218 call by root signature (word 0 of the description), and each pipeline created through 0x2b0, 0x50, 0x1f0 and 0x58 by the root signature it names, then logs the table every 5 seconds. Its unit test fails when the 0x2b0 count is taken out. Base: the v2026.11.28.03 release (f4608f0) with local CPU changes (#1653 among them) that touch neither the device methods nor pipeline creation; the translator fingerprint is the release's.

One run to the open world and 38 minutes in it (RTX 3080 Ti, driver 621.40, i5-9600K, Series S profile). Last table:

failed made on the same root signatures
0x218 2,689 2,689 through 0x1f0, none short
0x1c8 25,450 81,681 through 0x2b0 (0 through 0x50), on the same 74 signatures
  • For 0x218 it is the same count as in fxceless/victory-fork#113 on an RTX 5080: 2,689 = 2,689.
  • For 0x1c8, 72 of the 74 signatures have at least as many stream creations as failures. 2 have fewer; the largest gap is 424 failures against 355 creations. The title creates the fallback when it first draws with it, so a run does not reach every one. I have not shown that pipeline by pipeline: the count is by signature.
  • All 25,450 failures and 53,308 of the stream creations were already there 12 seconds into the run: 0x1c8 is a bulk fill at load that fails, and the streams follow.

The title's side, read in the binary (consistent with the count above): 0x1c8 is called only from a worker job that walks the title's pipeline cache entries, and on a failed HRESULT it moves on to the next entry. The graphics creation path looks the pipeline up in that same cache object and, on a miss, builds a 0x2b0-byte stream and calls 0x2b0. 0x218 is called from a lookup helper whose caller calls 0x1f0 when it returns null.

So for 0x1c8 the trade-off is the one this PR found for 0x218: a 0x1c8 that answers S_OK would make the title skip a stream path that works today. And 0x1c8 is the harder of the two to read, because it comes with no signature parts and the graphics state is in raw registers. If useful, I can send the counter as a separate diagnostics PR. The other cheap change would be the log line's wording: four reports (#855, #1301, #1374, #586) cite it as missing pipelines.

AI use: Claude Code (Claude Opus 5.5) read the binary and the code, wrote the counter and read the logs; I ran the game.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247672835 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/506#issuecomment-7247672835). Originally posted by [JeremRuiz](https://github.com/JeremRuiz) on 2026-11-28T23:48:08Z. --- The 0x1c8 side, counted: when 0x1c8 answers `E_NOTIMPL` the title makes the pipeline from a stream through 0x2b0, as 0x218 falls back to 0x1f0. So the sentence in `docs/loose-pipelines.md` "For 0x1c8 nothing was seen to take its place" does not hold, and neither does the log line's "the title goes without this pipeline", for either method. **How it was counted.** A diagnostics-only counter (not part of this PR, local branch) records each failed 0x1c8 and 0x218 call by root signature (word 0 of the description), and each pipeline created through 0x2b0, 0x50, 0x1f0 and 0x58 by the root signature it names, then logs the table every 5 seconds. Its unit test fails when the 0x2b0 count is taken out. Base: the v2026.11.28.03 release (`f4608f0`) with local CPU changes (#1653 among them) that touch neither the device methods nor pipeline creation; the translator fingerprint is the release's. **One run** to the open world and 38 minutes in it (RTX 3080 Ti, driver 621.40, i5-9600K, Series S profile). Last table: | | failed | made on the same root signatures | |---|---|---| | 0x218 | 2,689 | 2,689 through 0x1f0, none short | | 0x1c8 | 25,450 | 81,681 through 0x2b0 (0 through 0x50), on the same 74 signatures | - For 0x218 it is the same count as in fxceless/victory-fork#113 on an RTX 5080: 2,689 = 2,689. - For 0x1c8, 72 of the 74 signatures have at least as many stream creations as failures. 2 have fewer; the largest gap is 424 failures against 355 creations. The title creates the fallback when it first draws with it, so a run does not reach every one. I have not shown that pipeline by pipeline: the count is by signature. - All 25,450 failures and 53,308 of the stream creations were already there 12 seconds into the run: 0x1c8 is a bulk fill at load that fails, and the streams follow. **The title's side**, read in the binary (consistent with the count above): 0x1c8 is called only from a worker job that walks the title's pipeline cache entries, and on a failed HRESULT it moves on to the next entry. The graphics creation path looks the pipeline up in that same cache object and, on a miss, builds a 0x2b0-byte stream and calls 0x2b0. 0x218 is called from a lookup helper whose caller calls 0x1f0 when it returns null. So for 0x1c8 the trade-off is the one this PR found for 0x218: a 0x1c8 that answers `S_OK` would make the title skip a stream path that works today. And 0x1c8 is the harder of the two to read, because it comes with no signature parts and the graphics state is in raw registers. If useful, I can send the counter as a separate diagnostics PR. The other cheap change would be the log line's wording: four reports (#855, #1301, #1374, #586) cite it as missing pipelines. **AI use:** Claude Code (Claude Opus 5.5) read the binary and the code, wrote the counter and read the logs; I ran the game.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!506
No description provided.