ambient: the light estimate's passes build under Proton (no isnan, system compiler, root signature apart) #2160

Open
github-bot wants to merge 4 commits from github-bot/gh-2160 into main AGit
Owner

@⁠birdneststream on GitHub · 2026-11-29 10:02 UTC · original
birdneststream:ambient-passes-under-proton → main · +223 −19 · 2 files · 4 commits · open

Fixes #2158. Three commits on main, all in ambient.rs (+ hlsl.rs):

  1. No isnan/isinf intrinsics in the passes' source. Wine's system compiler is fxc, which has neither (E5005: Function "isnan" is not defined), and a shader that fails there never reaches the fallback whole. The two uses are a clamp that a max/min pair does the same.
  2. The passes by the system compiler, the root signature serialized apart. hlsl::system_code compiles the source as it is (no [RootSignature] check: fxc drops the block with W5302 and the check turned that into a DXC cs_6_0 fallback, which vkd3d-proton refuses with vsir_parse: Failed to parse shader). The signature is built in ambient.rs::root_signature() from the RS definition. (DXC's -extractrootsignature blob gives E_INVALIDARG under Wine, hence the builder.)
  3. The signature's constants read from RS (num32BitConstants=N): main's RS grew to 14; with a signature made for 13 the RAISE pass read zeros — raise_opt_in_chroma_scrub_… catches it on hardware.

What does not change on Windows: the passes are cs_5_x HLSL that fxc compiles on every Windows host too; the signature built from RS is the one the passes declare.

Rig (wine-staging 11.22, RTX 5090, vkd3d-proton master), ambient:: tests: main 10 passed / 4 failed (the_passes_build: Module not found; the_passes_compile: KEEP: … Module not found) → this branch 13 / 2, the two left being WARP-only (neutral_probe_…, raise_opt_in_chroma_scrub_…: "clamp shader must compile on WARP", no WARP DLL under Wine). In play under GE-Proton 11 the passes build and the light estimate acts (VICTORY_AMBIENT=0.8 default; 0 is #1957's fallback), indoors lit for the first time.

**@⁠birdneststream** on GitHub · 2026-11-29 10:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2160) `birdneststream:ambient-passes-under-proton` → `main` · +223 −19 · 2 files · 4 commits · open Fixes #2158. Three commits on main, all in `ambient.rs` (+ `hlsl.rs`): 1. **No `isnan`/`isinf` intrinsics** in the passes' source. Wine's system compiler is fxc, which has neither (`E5005: Function "isnan" is not defined`), and a shader that fails there never reaches the fallback whole. The two uses are a clamp that a `max`/`min` pair does the same. 2. **The passes by the system compiler, the root signature serialized apart.** `hlsl::system_code` compiles the source as it is (no `[RootSignature]` check: fxc drops the block with W5302 and the check turned that into a DXC cs_6_0 fallback, which vkd3d-proton refuses with `vsir_parse: Failed to parse shader`). The signature is built in `ambient.rs::root_signature()` from the `RS` definition. (DXC's `-extractrootsignature` blob gives E_INVALIDARG under Wine, hence the builder.) 3. **The signature's constants read from `RS`** (`num32BitConstants=N`): main's `RS` grew to 14; with a signature made for 13 the RAISE pass read zeros — `raise_opt_in_chroma_scrub_…` catches it on hardware. What does not change on Windows: the passes are cs_5_x HLSL that fxc compiles on every Windows host too; the signature built from `RS` is the one the passes declare. **Rig** (wine-staging 11.22, RTX 5090, vkd3d-proton master), `ambient::` tests: main **10 passed / 4 failed** (`the_passes_build`: `Module not found`; `the_passes_compile`: `KEEP: … Module not found`) → this branch **13 / 2**, the two left being WARP-only (`neutral_probe_…`, `raise_opt_in_chroma_scrub_…`: "clamp shader must compile on WARP", no WARP DLL under Wine). In play under GE-Proton 11 the passes build and the light estimate acts (`VICTORY_AMBIENT=0.8` default; `0` is #1957's fallback), indoors lit for the first time.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 10:06:42 +00:00
Author
Owner

@⁠ArturoWolff on GitHub · 2026-11-29 10:35 UTC · original

Source review of b727808d94bef8cca492198d5ab5c18655fba235: the separate root signature is a useful direction for Wine, but the neutral pass currently gets the wrong descriptor-table type.

  • ambient.rs:723–748 constructs parameters in the order constants, SRV table (ranges[0]), UAV table (ranges[1]), UAV u1, UAV u2.
  • root_signature(..., false) serializes the first two parameters (NumParameters = 2 at lines 761–764). That gives the neutral pass a t0 SRV table, not its u0 UAV table.
  • NEUTRAL_SOURCE at lines 932–935 declares three constants and DescriptorTable(UAV(u0)); make_neutral at lines 959–969 selects that false branch, and neutral_after at line 996 binds the image as the second parameter. The original main implementation derives the signature directly from this shader.

I would keep the five-parameter layout for the screen passes and explicitly select the UAV range as parameter 1 for the two-parameter neutral layout. This is a static binding mismatch, not a reproduced driver failure. It is also outside the coverage of the_passes_build (lines 1607–1612, which calls make, not make_neutral). The existing neutral pixel/bounds readback test starts by requiring WARP, so the reported Wine results do not establish the neutral path. A game-free root-layout check and the existing make_neutral colour/bounds readback on a physical adapter, as well as WARP where available, would make a good regression gate after correcting the layout.

For context, our two current-main RTX 4060/16 GiB Linux/GE-Proton11-14 startup trials have not reached visible gameplay. Their logs contain no ambient-module creation/failure records, and the requested RT builder stayed inactive with missing host pipelines. I therefore cannot yet corroborate the claimed lighting restoration or attribute our defective opening cinematic to the compiler path in #2158. Please keep the compiler fix and that separate builder-readiness problem distinct.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

**@⁠ArturoWolff** on GitHub · 2026-11-29 10:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2160#issuecomment-7254537496) Source review of `b727808d94bef8cca492198d5ab5c18655fba235`: the separate root signature is a useful direction for Wine, but the neutral pass currently gets the wrong descriptor-table type. - [`ambient.rs:723–748`](https://github.com/birdneststream/VIctory-NVIDIA/blob/b727808d94bef8cca492198d5ab5c18655fba235/crates/victory-gpu/src/ambient.rs#L723-L748) constructs parameters in the order constants, SRV table (`ranges[0]`), UAV table (`ranges[1]`), UAV u1, UAV u2. - `root_signature(..., false)` serializes the **first two** parameters (`NumParameters = 2` at lines 761–764). That gives the neutral pass a `t0` SRV table, not its `u0` UAV table. - `NEUTRAL_SOURCE` at lines 932–935 declares three constants and `DescriptorTable(UAV(u0))`; `make_neutral` at lines 959–969 selects that `false` branch, and `neutral_after` at line 996 binds the image as the second parameter. The original main implementation derives the signature directly from this shader. I would keep the five-parameter layout for the screen passes and explicitly select the UAV range as parameter 1 for the two-parameter neutral layout. This is a static binding mismatch, not a reproduced driver failure. It is also outside the coverage of `the_passes_build` (lines 1607–1612, which calls `make`, not `make_neutral`). The existing neutral pixel/bounds readback test starts by requiring WARP, so the reported Wine results do not establish the neutral path. A game-free root-layout check and the existing `make_neutral` colour/bounds readback on a physical adapter, as well as WARP where available, would make a good regression gate after correcting the layout. For context, our two current-main RTX 4060/16 GiB Linux/GE-Proton11-14 startup trials have not reached visible gameplay. Their logs contain no ambient-module creation/failure records, and the requested RT builder stayed inactive with missing host pipelines. I therefore cannot yet corroborate the claimed lighting restoration or attribute our defective opening cinematic to the compiler path in #2158. Please keep the compiler fix and that separate builder-readiness problem distinct. AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Author
Owner

@⁠birdneststream on GitHub · 2026-11-29 11:02 UTC · original

You were right, and thank you: root_signature(.., false) serialized the first two parameters — constants and the SRV table — while NEUTRAL_SOURCE's RS declares constants and DescriptorTable(UAV(u0)). So the neutral pass has been dispatching with an SRV handle where it binds its UAV: a silent no-op, which is why nothing failed here either.

Fixed in the branch (Layout: the neutral pass's one table is the u0 UAV range; the screen passes' first table the t0 SRV), with a game-free regression gate, the_signatures_lay_out_as_the_passes_declare, that reads the layout back for both signatures (count, parameter types, each table's range type, the constants' count) — it fails on the previous commit and passes now, under Wine on hardware, no WARP needed. The screen passes' build test is green again too (my first cut of the refactor moved the ranges array under the parameters' pointers; caught by the_passes_build, fixed by building the parameters over the ranges where they lie).

Agreed on keeping the builder-readiness problem separate: #2158/#2160 are about the passes compiling at all under Proton, nothing about the RT builder. Your GE-Proton 11-14 trials never reaching gameplay is a different matter — if you open it with the logs, I will read them, but not in this PR.

**@⁠birdneststream** on GitHub · 2026-11-29 11:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2160#issuecomment-7254840173) You were right, and thank you: `root_signature(.., false)` serialized the first two parameters — constants and the **SRV** table — while `NEUTRAL_SOURCE`'s `RS` declares constants and `DescriptorTable(UAV(u0))`. So the neutral pass has been dispatching with an SRV handle where it binds its UAV: a silent no-op, which is why nothing failed here either. Fixed in the branch (`Layout`: the neutral pass's one table is the `u0` UAV range; the screen passes' first table the `t0` SRV), with a game-free regression gate, `the_signatures_lay_out_as_the_passes_declare`, that reads the layout back for both signatures (count, parameter types, each table's range type, the constants' count) — it fails on the previous commit and passes now, under Wine on hardware, no WARP needed. The screen passes' build test is green again too (my first cut of the refactor moved the ranges array under the parameters' pointers; caught by `the_passes_build`, fixed by building the parameters over the ranges where they lie). Agreed on keeping the builder-readiness problem separate: #2158/#2160 are about the passes compiling at all under Proton, nothing about the RT builder. Your GE-Proton 11-14 trials never reaching gameplay is a different matter — if you open it with the logs, I will read them, but not in this PR.
Author
Owner

@⁠ArturoWolff on GitHub · 2026-11-29 11:10 UTC · original

Thanks for fixing that. I independently rechecked the exact new head 3fe250a8a79c26634ae23cd326a7cb585d6d300a (the previous reviewed head is its direct parent, and hlsl.rs is unchanged in the follow-up). Layout::parameters now chooses ranges[1] for the neutral table and ranges[0] for the screen table, with counts 2 and 5 respectively. The owning layout remains alive through the synchronous serialization call. This resolves the specific descriptor-type mismatch I reported at source level.

The new game-free test does use the production layout construction and catches the former neutral-table selection. One small coverage suggestion: its map_or(0, ...) can also yield the SRV range-type value when a range pointer is absent. I would explicitly assert the non-null range and its one descriptor/register, and regard this test as pre-serialization layout coverage, not GPU colour/bounds readback. The existing neutral-output readback still requires WARP. Your reported Wine build/layout results are useful; I have not yet executed the revised head on our RTX 4060.

Agreed on scope. Our separate startup observations are in the #2148 discussion, with the independently confirmed Proton compiler-memory measurement issue. The correction to that measurement is being qualified separately. I will keep startup evidence out of this lighting PR.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).

**@⁠ArturoWolff** on GitHub · 2026-11-29 11:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2160#issuecomment-7254925318) Thanks for fixing that. I independently rechecked the exact new head `3fe250a8a79c26634ae23cd326a7cb585d6d300a` (the previous reviewed head is its direct parent, and `hlsl.rs` is unchanged in the follow-up). [`Layout::parameters`](https://github.com/birdneststream/VIctory-NVIDIA/blob/3fe250a8a79c26634ae23cd326a7cb585d6d300a/crates/victory-gpu/src/ambient.rs#L737-L765) now chooses `ranges[1]` for the neutral table and `ranges[0]` for the screen table, with counts 2 and 5 respectively. The owning layout remains alive through the synchronous serialization call. This resolves the specific descriptor-type mismatch I reported at source level. The new game-free test does use the production layout construction and catches the former neutral-table selection. One small coverage suggestion: its `map_or(0, ...)` can also yield the SRV range-type value when a range pointer is absent. I would explicitly assert the non-null range and its one descriptor/register, and regard this test as pre-serialization layout coverage, not GPU colour/bounds readback. The existing neutral-output readback still requires WARP. Your reported Wine build/layout results are useful; I have not yet executed the revised head on our RTX 4060. Agreed on scope. Our separate startup observations are in [the #2148 discussion](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/2148), with the independently confirmed [Proton compiler-memory measurement issue](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/2148). The correction to that measurement is being qualified separately. I will keep startup evidence out of this lighting PR. AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Author
Owner

@⁠birdneststream on GitHub · 2026-11-29 12:49 UTC · original

Taken: the test now asserts each table's range pointer (expect), NumDescriptorRanges == 1 and the range's NumDescriptors == 1 before its type, and its doc says what it is — pre-serialization layout coverage; the neutral pass's colour/bounds readback still needs WARP. Pushed as the branch's head.

**@⁠birdneststream** on GitHub · 2026-11-29 12:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2160#issuecomment-7256088973) Taken: the test now asserts each table's range pointer (`expect`), `NumDescriptorRanges == 1` and the range's `NumDescriptors == 1` before its type, and its doc says what it is — pre-serialization layout coverage; the neutral pass's colour/bounds readback still needs WARP. Pushed as the branch's head.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2160/head:github-bot/gh-2160'
git switch 'github-bot/gh-2160'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2160'
git switch 'github-bot/gh-2160'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2160'
git switch 'github-bot/gh-2160'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2160'
git switch 'main'
git merge --squash 'github-bot/gh-2160'
git switch 'main'
git merge --ff-only 'github-bot/gh-2160'
git switch 'main'
git merge 'github-bot/gh-2160'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!2160
No description provided.