victory warm: each pipeline without a host pipeline is told, with why (#1881) #1923

Open
kibagami-nc wants to merge 1 commit from upstream-pr/1923 into main
kibagami-nc commented 2026-11-29 02:51:54 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-29T02:51:54Z.


Rebased on main (cec481f4). Main's new pieces are kept:

  • Shared mode: a made pipeline is marked once the library has it.
  • The library pass: fill_library's own use of known::make counts a made pipeline when no reason comes back.
  • Shader.mirror: kept beside the changed translated field.

victory warm ends with N made in X s (27 have no host pipeline, …). Its processes' stderr goes to null, so that count says how many have no host pipeline but not which, or why. In #1881 a user took the 27 for an error, and @Jesper-Andersson asked for the key and the reason of each.

Now each one is told when its process reports it, the way one that ended its process already is:

pipeline 51234 <key>: no host pipeline: compute 660814153af43185 does not translate: converter shader.dxil v1: GFX10 code at 0x0: no wave32 lowering for this wave64 program is not supported
pipeline 60001 <key>: no host pipeline: refused [vertex 1122334455667788, pixel 99aabbccddeeff00]

Change

  • known::make now reports why there is no host pipeline, instead of whether there is one. The reason is one of:
    • each shader of the pipeline that does not translate, with the translator's error;
    • otherwise refused with its shaders;
    • or that its entry, or one of its shaders, could not be read.
  • Shader keeps the translator's error beside the translation (translated: OnceLock<Result<Translated, String>>, read through Shader::refusal). translated() is unchanged for its callers. The diagnostics' make::missing reads the error through refusal too.
  • The child process writes made <n> <ms> 0 <why>, and the parent takes the rest of the line.

Nothing changes in what is made, kept or counted.

Tests

  • why_a_pipeline_has_none_names_the_shader_and_the_reason (known.rs):
    • a compute shader that does not translate is named, with the translator's error;
    • shaders that translate, or were not tried, give refused [vertex …, pixel …];
    • of two shaders, the one that does not translate is named.
  • cargo test -p victory-gpu --locked --lib: 914 passed, the new test among them. Two others fail on main itself: every_switch_of_the_translator_is_in_the_key (VICTORY_SCALAR_SPLITS is no longer read by the translator) and records_copied_as_bytes_are_made_at_the_next_sync, which passes when run again.
  • A test of main's in pipeline/host.rs builds a Shader by hand; it now sets Ok(Translated).
  • cargo test -p victory --locked: 79, 1 and 2 passed.
  • cargo clippy -p victory-gpu -p victory --all-targets: nothing in the changed lines.

Not tried here on a full victory warm run. The new protocol runs between a parent and a child of the same executable.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5546962134 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1923). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-29T02:51:54Z. --- **Rebased on main (cec481f4).** Main's new pieces are kept: - **Shared mode:** a made pipeline is marked once the library has it. - **The library pass:** `fill_library`'s own use of `known::make` counts a made pipeline when no reason comes back. - **`Shader.mirror`:** kept beside the changed `translated` field. `victory warm` ends with `N made in X s (27 have no host pipeline, …)`. Its processes' stderr goes to null, so that count says how many have no host pipeline but not which, or why. In #1881 a user took the 27 for an error, and @Jesper-Andersson asked for the key and the reason of each. Now each one is told when its process reports it, the way one that ended its process already is: ``` pipeline 51234 <key>: no host pipeline: compute 660814153af43185 does not translate: converter shader.dxil v1: GFX10 code at 0x0: no wave32 lowering for this wave64 program is not supported pipeline 60001 <key>: no host pipeline: refused [vertex 1122334455667788, pixel 99aabbccddeeff00] ``` ## Change - **`known::make`** now reports why there is no host pipeline, instead of whether there is one. The reason is one of: - each shader of the pipeline that does not translate, with the translator's error; - otherwise `refused` with its shaders; - or that its entry, or one of its shaders, could not be read. - **`Shader`** keeps the translator's error beside the translation (`translated: OnceLock<Result<Translated, String>>`, read through `Shader::refusal`). `translated()` is unchanged for its callers. The diagnostics' `make::missing` reads the error through `refusal` too. - **The child process** writes `made <n> <ms> 0 <why>`, and the parent takes the rest of the line. Nothing changes in what is made, kept or counted. ## Tests - `why_a_pipeline_has_none_names_the_shader_and_the_reason` (`known.rs`): - a compute shader that does not translate is named, with the translator's error; - shaders that translate, or were not tried, give `refused [vertex …, pixel …]`; - of two shaders, the one that does not translate is named. - `cargo test -p victory-gpu --locked --lib`: 914 passed, the new test among them. Two others fail on main itself: `every_switch_of_the_translator_is_in_the_key` (`VICTORY_SCALAR_SPLITS` is no longer read by the translator) and `records_copied_as_bytes_are_made_at_the_next_sync`, which passes when run again. - A test of main's in `pipeline/host.rs` builds a `Shader` by hand; it now sets `Ok(Translated)`. - `cargo test -p victory --locked`: 79, 1 and 2 passed. - `cargo clippy -p victory-gpu -p victory --all-targets`: nothing in the changed lines. Not tried here on a full `victory warm` run. The new protocol runs between a parent and a child of the same executable.
tyr0nsur commented 2026-12-01 13:30:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-12-01T13:30:02Z.

Code review location: crates/victory-gpu/src/pipeline/known.rs; line 364

@@ -337,10 +337,33 @@ pub fn make(dir: &Path, which: &[usize], mut each: impl FnMut(usize, Option<(f64
         let Some(entry) = entries.get(n) else { continue };
         each(*n, None);
         let began = std::time::Instant::now();
-        let made = parse(entry, &mut read)
-            .and_then(|(shaders, g)| HostPipeline::new(&shaders, g.as_deref()))
+        let parsed = parse(entry, &mut read);
+        let made = parsed
+            .as_ref()
+            .and_then(|(shaders, g)| HostPipeline::new(shaders, g.as_deref()))
             .is_some();
-        each(*n, Some((began.elapsed().as_secs_f64() * 1e3, made)));
+        let ms = began.elapsed().as_secs_f64() * 1e3;
+        let why = (!made).then(|| match &parsed {
+            Some((shaders, _)) => why_none(shaders),
+            None => "its entry or one of its shaders could not be read".to_owned(),
+        });
+        each(*n, Some((ms, why)));
+    }
+}
+
+/// Why `shaders` got no host pipeline, in short: each of them that does not
+/// translate, with the translator's reason; else "refused" (a stage, or mesh
+/// shaders, the host has no form for, or a root signature or pipeline the
+/// driver did not make: a run's log says which).
+fn why_none(shaders: &[Arc<Shader>]) -> String {
+    let failed: Vec<String> = shaders
+        .iter()
+        .filter_map(|s| Some(format!("{s:?} does not translate: {}", s.refusal()?)))
+        .collect();
+    if failed.is_empty() {
+        format!("refused {shaders:?}")

#4896 is a concrete case for this branch. Its two preload logs contain the same 227 mesh and 17 graphics shader keys refused with 0x8007000E. Its later warm --used logs only show the aggregate failures. This fallback would identify the entries as refused, but would still leave the failing D3D12 stage and HRESULT in the worker's discarded stderr.

Could the summary preserve the stage and HRESULT when host creation reports them? The generic fallback still makes sense when there is no D3D12 error. A smaller alternative is to point users to VICTORY_LOG_FILE with VICTORY_LOG_SYNC=1 for driver details. I verified that both parent and child log to that file in a synthetic Windows test with the same stderr and stdout setup.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review-comment:4754838992 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1923#discussion_r4754838992). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-12-01T13:30:02Z. **Code review location:** `crates/victory-gpu/src/pipeline/known.rs`; line 364 ~~~~diff @@ -337,10 +337,33 @@ pub fn make(dir: &Path, which: &[usize], mut each: impl FnMut(usize, Option<(f64 let Some(entry) = entries.get(n) else { continue }; each(*n, None); let began = std::time::Instant::now(); - let made = parse(entry, &mut read) - .and_then(|(shaders, g)| HostPipeline::new(&shaders, g.as_deref())) + let parsed = parse(entry, &mut read); + let made = parsed + .as_ref() + .and_then(|(shaders, g)| HostPipeline::new(shaders, g.as_deref())) .is_some(); - each(*n, Some((began.elapsed().as_secs_f64() * 1e3, made))); + let ms = began.elapsed().as_secs_f64() * 1e3; + let why = (!made).then(|| match &parsed { + Some((shaders, _)) => why_none(shaders), + None => "its entry or one of its shaders could not be read".to_owned(), + }); + each(*n, Some((ms, why))); + } +} + +/// Why `shaders` got no host pipeline, in short: each of them that does not +/// translate, with the translator's reason; else "refused" (a stage, or mesh +/// shaders, the host has no form for, or a root signature or pipeline the +/// driver did not make: a run's log says which). +fn why_none(shaders: &[Arc<Shader>]) -> String { + let failed: Vec<String> = shaders + .iter() + .filter_map(|s| Some(format!("{s:?} does not translate: {}", s.refusal()?))) + .collect(); + if failed.is_empty() { + format!("refused {shaders:?}") ~~~~ --- #4896 is a concrete case for this branch. Its two preload logs contain the same 227 mesh and 17 graphics shader keys refused with `0x8007000E`. Its later `warm --used` logs only show the aggregate failures. This fallback would identify the entries as `refused`, but would still leave the failing D3D12 stage and HRESULT in the worker's discarded stderr. Could the summary preserve the stage and HRESULT when host creation reports them? The generic fallback still makes sense when there is no D3D12 error. A smaller alternative is to point users to `VICTORY_LOG_FILE` with `VICTORY_LOG_SYNC=1` for driver details. I verified that both parent and child log to that file in a synthetic Windows test with the same stderr and stdout setup.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1923:upstream-pr/1923'
git switch 'upstream-pr/1923'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1923'
git switch 'upstream-pr/1923'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1923'
git switch 'upstream-pr/1923'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1923'
git switch 'main'
git merge --squash 'upstream-pr/1923'
git switch 'main'
git merge --ff-only 'upstream-pr/1923'
git switch 'main'
git merge 'upstream-pr/1923'
git push origin 'main'
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!1923
No description provided.