[pr-fix] DARNER_ROOT_SRV_DIRECT=0 is off: it chose the unbounded root descriptors #413

Open
iBooM72 wants to merge 1 commit from iboom72/fix/root-srv-direct-zero into main AGit
Contributor

What it changes

  • The problem on main: read from the code only. bounded_root_srvs() (crates/darner-gpu/src/pipeline/host.rs:409) tested var_os("DARNER_ROOT_SRV_DIRECT").is_none().

DARNER_ROOT_SRV_DIRECT=0 (typed to be explicit, or left from comparing two runs) turned the switch on: the title's root SRVs went back to root descriptors, the path whose reads past a buffer's end removed the device (the function's own doc, which cites an upstream pull request numbered 493, which is not number 493 on this forge). The README row says "1 = on, off (not set)".

It is read through crate::switch::on now: on when set and not 0, the same rule switch.rs records for DARNER_D3D12_WARP=0. Unset and 1 behave as before. One line.

How it was tested

  • Tested revision: b89f06df
  • Commands and results:
    • cargo clippy -p darner-gpu --all-targets --locked -- -D warnings: clean.
    • cargo test -p darner-gpu --lib --locked switch: 27 passed, 0 failed.
    • cargo test -p darner-gpu --lib --locked (all 1,837 unit tests of the crate), 20 runs: 9 passed all 1,756 that are not ignored; 11 failed one to three tests. Failed: watch::tests::ask_once_by_res_splits_reservations_without_refusals 7 times; gpu_owned::tests::concurrent_faults_on_same_block_serialize_single_readback and watch::watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs twice each; four other tests in watch and shadow::wide_tests once each. All of these are concurrency tests of the write watch, GPU-owned memory and the wide copy; none reads anything this PR changes. main itself was not run. Another branch from the same main commit (f3840d73), without this change, fails the same way (6 of 10 runs, and one more hung), so the tests look flaky on main. Open PRs #261 (the gpu_owned test of eight faults) and #262 (a refresh_tests test and the watch journal's lock) are already about tests of this family failing by chance.
  • Changes a default: no
  • A/B result: not applicable (no default changes, no speed claim). Checked by reading: switch::on is covered by switch.rs's own tests.
  • Gates run on that revision (the three in AGENTS.md; there is no CI): none of the three in full. Run instead: clippy for darner-gpu with all targets, and the unit tests named above. Not run: clippy over the whole workspace, clippy with --all-features, cargo test --workspace.
  • Gameplay, when relevant: not run in the game.
  • Shader wave sizes tested, when relevant: not relevant.
  • Hardware dependence: likely general.
  • Coverage gaps: no test reads the environment variable itself (it is cached in a OnceLock). Nobody is known to have set =0; no launcher, menu or play.rs path writes it.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • Not run in the game: the changed case (=0) is not a setting any launcher writes.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #394 adds a block to pipeline/host.rs at line 436, 27 lines below this one; it does not change bounded_root_srvs. #32, #39, #40, #41, #46 and #349 change the file elsewhere.
  • Replaces or overlaps: none found. The forge's search over open and closed issues and PRs finds nothing for DARNER_ROOT_SRV_DIRECT or bounded_root_srvs. No open PR's diff names either (195 open PRs checked on 2026-12-04: 161 by their full diff, and the 70 opened or updated since then by their file lists and, where a file matched, by diff; #48 at an older head because its current one could not be fetched.)

🤖 Generated with Claude Code

## What it changes - The problem on main: read from the code only. `bounded_root_srvs()` (`crates/darner-gpu/src/pipeline/host.rs:409`) tested `var_os("DARNER_ROOT_SRV_DIRECT").is_none()`. `DARNER_ROOT_SRV_DIRECT=0` (typed to be explicit, or left from comparing two runs) turned the switch **on**: the title's root SRVs went back to root descriptors, the path whose reads past a buffer's end removed the device (the function's own doc, which cites an upstream pull request numbered 493, which is not number 493 on this forge). The README row says "1 = on, off (not set)". It is read through `crate::switch::on` now: on when set and not `0`, the same rule `switch.rs` records for `DARNER_D3D12_WARP=0`. Unset and `1` behave as before. One line. ## How it was tested - Tested revision: `b89f06df` - Commands and results: - `cargo clippy -p darner-gpu --all-targets --locked -- -D warnings`: clean. - `cargo test -p darner-gpu --lib --locked switch`: 27 passed, 0 failed. - `cargo test -p darner-gpu --lib --locked` (all 1,837 unit tests of the crate), 20 runs: 9 passed all 1,756 that are not ignored; 11 failed one to three tests. Failed: `watch::tests::ask_once_by_res_splits_reservations_without_refusals` 7 times; `gpu_owned::tests::concurrent_faults_on_same_block_serialize_single_readback` and `watch::watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs` twice each; four other tests in `watch` and `shadow::wide_tests` once each. All of these are concurrency tests of the write watch, GPU-owned memory and the wide copy; none reads anything this PR changes. `main` itself was not run. Another branch from the same `main` commit (`f3840d73`), without this change, fails the same way (6 of 10 runs, and one more hung), so the tests look flaky on `main`. Open PRs #261 (the `gpu_owned` test of eight faults) and #262 (a `refresh_tests` test and the watch journal's lock) are already about tests of this family failing by chance. - Changes a default: no - A/B result: not applicable (no default changes, no speed claim). Checked by reading: `switch::on` is covered by `switch.rs`'s own tests. - Gates run on that revision (the three in AGENTS.md; there is no CI): none of the three in full. Run instead: clippy for `darner-gpu` with all targets, and the unit tests named above. Not run: clippy over the whole workspace, clippy with `--all-features`, `cargo test --workspace`. - Gameplay, when relevant: not run in the game. - Shader wave sizes tested, when relevant: not relevant. - Hardware dependence: likely general. - Coverage gaps: no test reads the environment variable itself (it is cached in a `OnceLock`). Nobody is known to have set `=0`; no launcher, menu or `play.rs` path writes it. ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). - Not run in the game: the changed case (`=0`) is not a setting any launcher writes. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #394 adds a block to `pipeline/host.rs` at line 436, 27 lines below this one; it does not change `bounded_root_srvs`. #32, #39, #40, #41, #46 and #349 change the file elsewhere. - Replaces or overlaps: none found. The forge's search over open and closed issues and PRs finds nothing for `DARNER_ROOT_SRV_DIRECT` or `bounded_root_srvs`. No open PR's diff names either (195 open PRs checked on 2026-12-04: 161 by their full diff, and the 70 opened or updated since then by their file lists and, where a file matched, by diff; #48 at an older head because its current one could not be fetched.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`bounded_root_srvs()` took the variable's presence as "go back to root
descriptors", so `DARNER_ROOT_SRV_DIRECT=0` (typed to be explicit, or left
from comparing two runs) chose the unbounded path whose reads past a
buffer's end removed the device (upstream PR #493). It is read through
`crate::switch::on` now: on when set and not `0`, as the README's
"1 = on" row says. Unset and `1` are as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/413/head:iboom72/fix/root-srv-direct-zero'
git switch 'iboom72/fix/root-srv-direct-zero'

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 'iboom72/fix/root-srv-direct-zero'
git switch 'iboom72/fix/root-srv-direct-zero'
git rebase 'main'
git switch 'main'
git merge --ff-only 'iboom72/fix/root-srv-direct-zero'
git switch 'iboom72/fix/root-srv-direct-zero'
git rebase 'main'
git switch 'main'
git merge --no-ff 'iboom72/fix/root-srv-direct-zero'
git switch 'main'
git merge --squash 'iboom72/fix/root-srv-direct-zero'
git switch 'main'
git merge --ff-only 'iboom72/fix/root-srv-direct-zero'
git switch 'main'
git merge 'iboom72/fix/root-srv-direct-zero'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
TrustNo1/Darner!413
No description provided.