Ambient light floor for dark rooms (VICTORY_AMBIENT_LEAST); title thread placement logged; i9-13900KF + RTX 4080 measurements #475

Open
github-bot wants to merge 2 commits from github-bot/gh-475 into main AGit
Owner

@⁠s0ngo73 on GitHub · 2026-11-27 23:07 UTC · original
s0ngo73:pr/piso-de-luz-y-nucleos → main · +299 −4 · 6 files · 2 commits · open

Two switches, both off by default, plus what a day of A/B measuring on an Intel hybrid CPU found.

Test PC

CPU Intel Core i9-13900KF (8 P-cores with Hyper-Threading + 16 E-cores, 32 threads)
GPU NVIDIA GeForce RTX 4080 16 GB (PCIe 4.0 x16), driver 616.64
RAM 32 GB
OS Windows 11 Pro (26200), HAGS on
Resizable BAR off
Monitor 3840x2160, 60 Hz
Game 1.0.2.1, on an NVMe SSD

1. VICTORY_AMBIENT_LEAST: a floor for the indirect light (dark rooms and nights)

The ambient estimate is made from what is on screen, so at night outdoors and in rooms no lamp reaches it is almost nothing and those places are black. VICTORY_AMBIENT_LEAST=<level> keeps every point at least at that light, as constant:<level> would give it (same colour as the constant). Also in the F1 menu: LIGHT FLOOR (DARK ROOMS) (OFF / 0.1 / 0.05 / 0.16).

  • The floor is applied after the bound that keeps the title's own probe light to a multiple of the estimate. Applied before it (the first try), it raised that bound and let the probes' violet memory through outdoors: sky and trees in violet tones. Applied after it, only dark points change.
  • Same idea as VI-BR-PORT's estimate:<share>:<least> (edsuuu/VI-BR-PORT 849a20b3) and betterVIctory-Nvidia's VICTORY_AMBIENT_FLOOR; credited in the code.
  • Played with VICTORY_AMBIENT=0.8 VICTORY_AMBIENT_LEAST=0.1 VICTORY_AMBIENT_SHADE=0.5,0.4: interiors readable, no change in frame rate (18.5 real fps on Series S with DLSS Quality and frame generation, as without it).
  • ambient::tests::least_settings; the_passes_build builds the changed shader.

2. The title's thread placement: logged, and VICTORY_TITLE_FAST_CORES

The game imports SetThreadGroupAffinity and GetLogicalProcessorInformation and places its own threads. The HLE kernel module now takes SetThreadGroupAffinity (api-ms-win-core-processtopology-* added to its DLLs) and logs the first 128 placements with what the mask holds (logical processors, cores, fast/slow, cores holding two of them).

What it showed on the 13900KF: every placed thread stays inside logical processors 0-13 (seven P-cores with HT, the console's layout): masks 0x3fff, 0xff (eight threads on four cores), 0x1f00 (about eleven threads on five logical processors), 0x3f00, 0x2000; some calls ask for mask 0, which Windows refuses. P-core 7 and all sixteen E-cores are never asked for.

VICTORY_TITLE_FAST_CORES=1 gives those threads all P-cores instead (re-placed live under VICTORY_AB). Measured: no gain (+3.4 % time per draw, better in 14 of 34 paired phases), most likely because our submitting thread and its helpers are kept on the same cores. Kept off; the log is the useful part. Tests in cores.rs.

What we measured (might save others some runs)

All on the traffic road, Series S profile, VICTORY_AB with 15 s phases, each phase compared with its neighbours in ms per 1000 draws.

  • VICTORY_FAULT_UNLOCKED=1 helps: -3 to -4 % time per draw (43 phases, better in 25), no crashes. Worth considering as a default.
  • Best setup for this PC: Series S, DLSS Quality, preset K, frame generation 2x: 18.7-20.4 real fps, 37-41 shown, frame generation costing no real fps (the card has room on Series S). Series X 1440p with frame generation: 14.3 real fps (the card waits ~21 ms a frame).
  • The submitting thread works ~51 of ~53 ms a frame (refreshes 20.8, planning card steps 7.1, card copies 6.9, write watch 3.7); waits for the guards' lock add up to ~97 ms a frame across threads.
  • Splitting whole copies of unwatched memory across the wide threads (a 20 MB range copied whole 1.4x a frame): no effect (-0.5 %, 17 of 33). Not included.
  • A new build's first run was 30-40 % slower for ~2-9 minutes here, then normal (close to what you saw on the 5070).

Problems found (not fixed here)

  • RTX 40: the F1 menu offers 2X-6X, but the driver reports a maximum of 2x; 3X/4X are clamped to 2x (the log warns "more frames asked than this card generates"). The menu could offer only 2X on RTX 40.
  • DLAA with the Series S profile crashes the title at start-up (title assert during init, Lockhart): Series S renders at 1280x720 at most.
  • Series X, frame generation switched off from F1: slDLSSGSetOptions returned 38 ("invalid state") 63 times and frame generation stayed on.
  • With the Series S profile the swap chain is always 1920x1080 whatever -Res, so FULLSCREEN (NO BORDER) on a 4K screen is Windows' bilinear stretch (soft).
  • On df2daaf, indirect::tests::host_list_budget_starts_empty_at_each_submission and indirect::tests::warp_batch_charges_every_execution fail on this PC with and without these changes.

Checks

  • cargo test --workspace --locked --no-fail-fast: everything passes except indirect::tests::host_list_budget_starts_empty_at_each_submission and indirect::tests::warp_batch_charges_every_execution, which fail the same way on df2daaf without these commits on this PC.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: nothing in the changed files. It does not pass on df2daaf either (e.g. victory-formats/src/texture.rs:1346, victory-gpu/src/queue.rs:1377, descriptor/host.rs:1324).
  • Release and diagnostics builds; played with the floor on (VICTORY_AMBIENT=0.8 VICTORY_AMBIENT_LEAST=0.1 VICTORY_AMBIENT_SHADE=0.5,0.4) and VICTORY_TITLE_FAST_CORES measured with VICTORY_AB.

🤖 Generated with Claude Code

**@⁠s0ngo73** on GitHub · 2026-11-27 23:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/475) `s0ngo73:pr/piso-de-luz-y-nucleos` → `main` · +299 −4 · 6 files · 2 commits · open Two switches, both off by default, plus what a day of A/B measuring on an Intel hybrid CPU found. ## Test PC | | | |---|---| | CPU | Intel Core i9-13900KF (8 P-cores with Hyper-Threading + 16 E-cores, 32 threads) | | GPU | NVIDIA GeForce RTX 4080 16 GB (PCIe 4.0 x16), driver 616.64 | | RAM | 32 GB | | OS | Windows 11 Pro (26200), HAGS on | | Resizable BAR | off | | Monitor | 3840x2160, 60 Hz | | Game | 1.0.2.1, on an NVMe SSD | ## 1. `VICTORY_AMBIENT_LEAST`: a floor for the indirect light (dark rooms and nights) The ambient estimate is made from what is on screen, so at night outdoors and in rooms no lamp reaches it is almost nothing and those places are black. `VICTORY_AMBIENT_LEAST=<level>` keeps every point at least at that light, as `constant:<level>` would give it (same colour as the constant). Also in the F1 menu: **LIGHT FLOOR (DARK ROOMS)** (OFF / 0.1 / 0.05 / 0.16). - The floor is applied **after** the bound that keeps the title's own probe light to a multiple of the estimate. Applied before it (the first try), it raised that bound and let the probes' violet memory through outdoors: sky and trees in violet tones. Applied after it, only dark points change. - Same idea as VI-BR-PORT's `estimate:<share>:<least>` (edsuuu/VI-BR-PORT 849a20b3) and betterVIctory-Nvidia's `VICTORY_AMBIENT_FLOOR`; credited in the code. - Played with `VICTORY_AMBIENT=0.8 VICTORY_AMBIENT_LEAST=0.1 VICTORY_AMBIENT_SHADE=0.5,0.4`: interiors readable, no change in frame rate (18.5 real fps on Series S with DLSS Quality and frame generation, as without it). - `ambient::tests::least_settings`; `the_passes_build` builds the changed shader. ## 2. The title's thread placement: logged, and `VICTORY_TITLE_FAST_CORES` The game imports `SetThreadGroupAffinity` and `GetLogicalProcessorInformation` and places its own threads. The HLE kernel module now takes `SetThreadGroupAffinity` (`api-ms-win-core-processtopology-*` added to its DLLs) and logs the first 128 placements with what the mask holds (logical processors, cores, fast/slow, cores holding two of them). What it showed on the 13900KF: **every placed thread stays inside logical processors 0-13** (seven P-cores with HT, the console's layout): masks `0x3fff`, `0xff` (eight threads on four cores), `0x1f00` (about eleven threads on five logical processors), `0x3f00`, `0x2000`; some calls ask for mask `0`, which Windows refuses. P-core 7 and all sixteen E-cores are never asked for. `VICTORY_TITLE_FAST_CORES=1` gives those threads all P-cores instead (re-placed live under `VICTORY_AB`). Measured: **no gain** (+3.4 % time per draw, better in 14 of 34 paired phases), most likely because our submitting thread and its helpers are kept on the same cores. Kept off; the log is the useful part. Tests in `cores.rs`. ## What we measured (might save others some runs) All on the traffic road, Series S profile, `VICTORY_AB` with 15 s phases, each phase compared with its neighbours in ms per 1000 draws. - **`VICTORY_FAULT_UNLOCKED=1` helps: -3 to -4 %** time per draw (43 phases, better in 25), no crashes. Worth considering as a default. - Best setup for this PC: Series S, DLSS Quality, preset K, frame generation 2x: **18.7-20.4 real fps, 37-41 shown**, frame generation costing no real fps (the card has room on Series S). Series X 1440p with frame generation: 14.3 real fps (the card waits ~21 ms a frame). - The submitting thread works ~51 of ~53 ms a frame (refreshes 20.8, planning card steps 7.1, card copies 6.9, write watch 3.7); waits for the guards' lock add up to ~97 ms a frame across threads. - Splitting whole copies of unwatched memory across the wide threads (a 20 MB range copied whole 1.4x a frame): no effect (-0.5 %, 17 of 33). Not included. - A new build's first run was 30-40 % slower for ~2-9 minutes here, then normal (close to what you saw on the 5070). ## Problems found (not fixed here) - **RTX 40: the F1 menu offers 2X-6X, but the driver reports a maximum of 2x**; 3X/4X are clamped to 2x (the log warns "more frames asked than this card generates"). The menu could offer only 2X on RTX 40. - **DLAA with the Series S profile crashes the title at start-up** (title assert during init, `Lockhart`): Series S renders at 1280x720 at most. - **Series X, frame generation switched off from F1: `slDLSSGSetOptions` returned 38 ("invalid state") 63 times** and frame generation stayed on. - With the Series S profile the swap chain is always 1920x1080 whatever `-Res`, so `FULLSCREEN (NO BORDER)` on a 4K screen is Windows' bilinear stretch (soft). - On `df2daaf`, `indirect::tests::host_list_budget_starts_empty_at_each_submission` and `indirect::tests::warp_batch_charges_every_execution` fail on this PC with and without these changes. ## Checks - `cargo test --workspace --locked --no-fail-fast`: everything passes except `indirect::tests::host_list_budget_starts_empty_at_each_submission` and `indirect::tests::warp_batch_charges_every_execution`, which fail the same way on `df2daaf` without these commits on this PC. - `cargo clippy --workspace --all-targets --all-features -- -D warnings`: nothing in the changed files. It does not pass on `df2daaf` either (e.g. `victory-formats/src/texture.rs:1346`, `victory-gpu/src/queue.rs:1377`, `descriptor/host.rs:1324`). - Release and diagnostics builds; played with the floor on (`VICTORY_AMBIENT=0.8 VICTORY_AMBIENT_LEAST=0.1 VICTORY_AMBIENT_SHADE=0.5,0.4`) and `VICTORY_TITLE_FAST_CORES` measured with `VICTORY_AB`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The estimate is made from what is on screen, so at night outdoors and in
rooms no lamp reaches it is about nothing and what no lamp reaches is black.
VICTORY_AMBIENT_LEAST=<level> keeps every point at least at that light, as
constant:<level> gives it. Applied after the bound of the title's own probe
light, which stays the estimate's: before it, the floor raised that bound and
let the probes' violet memory through outdoors (sky and trees in violet).
F1 menu: LIGHT FLOOR (DARK ROOMS). Same idea as VI-BR-PORT's
estimate:<share>:<least> and betterVIctory-Nvidia's VICTORY_AMBIENT_FLOOR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title places its threads itself (SetThreadGroupAffinity, from what
GetLogicalProcessorInformation says). The HLE kernel module now takes that
call and logs the first 128 placements with what each mask holds. On an
i9-13900KF every placed thread stays inside logical processors 0-13 (seven
P-cores with HT, the console's layout; masks 0x3fff, 0xff, 0x1f00, 0x3f00,
0x2000, some 0, which Windows refuses): P-core 7 and the sixteen E-cores are
never asked for. VICTORY_TITLE_FAST_CORES=1 gives those threads all P-cores
instead, re-placed live under VICTORY_AB: no gain measured (+3.4 % time per
draw, better in 14 of 34 paired phases).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:12:12 +00:00
Author
Owner

@⁠hazben on GitHub · 2026-11-28 02:13 UTC · original

Data point for the dark-room floor (#475): measurements of the ambient pass on main f3534e6 plus a counters-only change (a per-5 s line of the estimate's levels). RTX 4070 SUPER, DLSS Quality 1706x960 to 2560x1440, same save and spot in both runs, one run each, outdoors around the start area.

1. The floor matters where little sky is on screen. The ambient pass's own level for the darkest 30 % of cells, by sky share of the screen (run at VICTORY_AMBIENT=1.2, 108 lines):

sky on screen lines level, median darkest 30 %
< 1 % 39 0.36 0.12
1-5 % 22 0.56 0.29
5-15 % 18 6.0 3.3
> 15 % 29 8.4 5.1

Garages and dense trees sit at 0.3-0.9 against 5-10 in the open. That is the case VICTORY_AMBIENT_LEAST covers. (Unverified: I did not check that these units are the ones LEAST=<level> uses.)

2. It will not fix open-shade foliage. At one sunny tree-shade spot the estimate gave 3.4 to the darkest 30 % of cells, yet a quarter of the picture was 0-1/255 (foliage, a car's rear). So that black comes from somewhere downstream of the estimate (Likely: an occlusion term the left-out ray passes leave at about 0). A floor at 0.1 does nothing there.

3. AMBIENT above 1 overshoots its ratio. 1.2 to 2.5 should be 2.08x; the darkest 30 % of cells measured 3.17x (56 place-matched line pairs), because the stand-in's light comes back through next frame's estimate (the loop ambient.rs documents). Darkest 25 % of one like-for-like shot: 2.65 to 5.70 of 255, pixels at 0-1/255 2.9 % to 0.4 %. VICTORY_AMBIENT_ONCE=1 removes the loop.

4. The 4x bound did not bind. Cells cut by it: mean 0.06 %, max 3 %.

**@⁠hazben** on GitHub · 2026-11-28 02:13 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/475#issuecomment-7232221525) Data point for the dark-room floor (#475): measurements of the ambient pass on main f3534e6 plus a counters-only change (a per-5 s line of the estimate's levels). RTX 4070 SUPER, DLSS Quality 1706x960 to 2560x1440, same save and spot in both runs, one run each, outdoors around the start area. **1. The floor matters where little sky is on screen.** The ambient pass's own level for the darkest 30 % of cells, by sky share of the screen (run at `VICTORY_AMBIENT=1.2`, 108 lines): | sky on screen | lines | level, median | darkest 30 % | |---|---|---|---| | < 1 % | 39 | 0.36 | 0.12 | | 1-5 % | 22 | 0.56 | 0.29 | | 5-15 % | 18 | 6.0 | 3.3 | | > 15 % | 29 | 8.4 | 5.1 | Garages and dense trees sit at 0.3-0.9 against 5-10 in the open. That is the case `VICTORY_AMBIENT_LEAST` covers. (Unverified: I did not check that these units are the ones `LEAST=<level>` uses.) **2. It will not fix open-shade foliage.** At one sunny tree-shade spot the estimate gave 3.4 to the darkest 30 % of cells, yet a quarter of the picture was 0-1/255 (foliage, a car's rear). So that black comes from somewhere downstream of the estimate (Likely: an occlusion term the left-out ray passes leave at about 0). A floor at 0.1 does nothing there. **3. `AMBIENT` above 1 overshoots its ratio.** 1.2 to 2.5 should be 2.08x; the darkest 30 % of cells measured 3.17x (56 place-matched line pairs), because the stand-in's light comes back through next frame's estimate (the loop `ambient.rs` documents). Darkest 25 % of one like-for-like shot: 2.65 to 5.70 of 255, pixels at 0-1/255 2.9 % to 0.4 %. `VICTORY_AMBIENT_ONCE=1` removes the loop. **4. The 4x bound did not bind.** Cells cut by it: mean 0.06 %, max 3 %.
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/475/head:github-bot/gh-475'
git switch 'github-bot/gh-475'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-475'
git switch 'github-bot/gh-475'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-475'
git switch 'github-bot/gh-475'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-475'
git switch 'main'
git merge --squash 'github-bot/gh-475'
git switch 'main'
git merge --ff-only 'github-bot/gh-475'
git switch 'main'
git merge 'github-bot/gh-475'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.