host: allow configuring in-flight list cap via VICTORY_LATE_MOST #385

Open
github-bot wants to merge 5 commits from github-bot/gh-385 into main AGit
Owner

@⁠MikeSouza1 on GitHub · 2026-12-03 22:48 UTC · original
MikeSouza1:perf/victory-late-most → main · +135 −7 · 3 files · 5 commits · open

Motivation

On multi-frame workloads where a single frame submits ~180–240 command lists, the hardcoded LATE_MOST = 256 cap in crates/victory-gpu/src/host.rs causes the submission thread to wait on 256 lists in the air every frame (~11.7–12.9 ms/frame average wait across 3,500+ log samples on RX 6750 XT / Ryzen 5 5600G).

Exposing this cap as an opt-in runtime knob lets users and developers benchmark and debug in-flight list pressure without changing the default 256 behavior (which remains important as back-pressure on GPU-bound setups).

Change

  • Add LateMostParse, parse_late_most(), and late_most() reading VICTORY_LATE_MOST (64..=512, defaulting to LATE_MOST = 256 when unset/empty, logging a tracing::warn! both when clamping out-of-range values and when falling back on unparseable/overflowing values).
  • Expose crate::list::IDLE_MOST as pub(crate) and enforce const _: () = assert!(LATE_MOST_MAX <= crate::list::IDLE_MOST.0); (plus LATE_MOST_MIN <= LATE_MOST <= LATE_MOST_MAX) at compile time so the upper bound stays tied to the 512-list idle pool (avoiding settle churn and keeping dynamic descriptor usage bounded on PORTABLE_VIEWS hosts).
  • Use late_most() in late_threads, late_line, and execute, and update the host.rs doc comment.
  • Add unit tests in host::relay_tests covering Default, Exact, Clamped { asked }, and Invalid.
  • Document VICTORY_LATE_MOST in docs/SETTINGS.md (under Runtime-only settings).

Verification

  • Build & unit tests: PKG=victory-gpu ./build.sh check (0 warnings), PROFILE=diag PKG=victory-gpu ./build.sh check (0 warnings), PKG=victory-gpu ./build.sh test -- relay_tests (2 passed; 0 failed).
  • Gameplay testing (Ryzen 5 5600G + RX 6750 XT 12 GB + 16 GB RAM, CONSOLE=series-s, VICTORY_BVH_BUILDER=1, VICTORY_PARTS_ONE_CALL=1):
    • 256 (default): lists_in_air = 12.94 ms/frame, avg_total_wait = 15.73 ms, gpu_wait = 18.5 ms.
    • VICTORY_LATE_MOST=512: lists_in_air = 0.00 ms/frame, avg_total_wait = 2.23 ms, gpu_wait = 2.2 ms, and dynamic_refused=0.0 across all 41 stats: recording samples in a diag run.
  • Note: On GPU-bound 4K setups (e.g., RX 9070 XT benchmarked in the comments below), raising the cap to 512 increased median FPS but hurt 1% lows / long presents and exposed tree-shadow flickering while driving — reinforcing keeping 256 as the default and VICTORY_LATE_MOST strictly opt-in.
**@⁠MikeSouza1** on GitHub · 2026-12-03 22:48 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385) `MikeSouza1:perf/victory-late-most` → `main` · +135 −7 · 3 files · 5 commits · open ## Motivation On multi-frame workloads where a single frame submits ~180–240 command lists, the hardcoded `LATE_MOST = 256` cap in `crates/victory-gpu/src/host.rs` causes the submission thread to wait on `256 lists in the air` every frame (`~11.7–12.9 ms/frame` average wait across 3,500+ log samples on RX 6750 XT / Ryzen 5 5600G). Exposing this cap as an opt-in runtime knob lets users and developers benchmark and debug in-flight list pressure without changing the default `256` behavior (which remains important as back-pressure on GPU-bound setups). ## Change - Add `LateMostParse`, `parse_late_most()`, and `late_most()` reading `VICTORY_LATE_MOST` (`64..=512`, defaulting to `LATE_MOST = 256` when unset/empty, logging a `tracing::warn!` both when clamping out-of-range values and when falling back on unparseable/overflowing values). - Expose `crate::list::IDLE_MOST` as `pub(crate)` and enforce `const _: () = assert!(LATE_MOST_MAX <= crate::list::IDLE_MOST.0);` (plus `LATE_MOST_MIN <= LATE_MOST <= LATE_MOST_MAX`) at compile time so the upper bound stays tied to the 512-list idle pool (avoiding settle churn and keeping dynamic descriptor usage bounded on `PORTABLE_VIEWS` hosts). - Use `late_most()` in `late_threads`, `late_line`, and `execute`, and update the `host.rs` doc comment. - Add unit tests in `host::relay_tests` covering `Default`, `Exact`, `Clamped { asked }`, and `Invalid`. - Document `VICTORY_LATE_MOST` in `docs/SETTINGS.md` (under Runtime-only settings). ## Verification - Build & unit tests: `PKG=victory-gpu ./build.sh check` (0 warnings), `PROFILE=diag PKG=victory-gpu ./build.sh check` (0 warnings), `PKG=victory-gpu ./build.sh test -- relay_tests` (`2 passed; 0 failed`). - Gameplay testing (Ryzen 5 5600G + RX 6750 XT 12 GB + 16 GB RAM, `CONSOLE=series-s`, `VICTORY_BVH_BUILDER=1`, `VICTORY_PARTS_ONE_CALL=1`): - `256` (default): `lists_in_air = 12.94 ms/frame`, `avg_total_wait = 15.73 ms`, `gpu_wait = 18.5 ms`. - `VICTORY_LATE_MOST=512`: `lists_in_air = 0.00 ms/frame`, `avg_total_wait = 2.23 ms`, `gpu_wait = 2.2 ms`, and `dynamic_refused=0.0` across all 41 `stats: recording` samples in a `diag` run. - Note: On GPU-bound 4K setups (e.g., RX 9070 XT benchmarked in the comments below), raising the cap to `512` increased median FPS but hurt 1% lows / long presents and exposed tree-shadow flickering while driving — reinforcing keeping `256` as the default and `VICTORY_LATE_MOST` strictly opt-in.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 22:48:41 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 23:14 UTC · original

Went through this on native Windows 11 (MSVC). Short version: 256 really is just a soft trigger, nothing is sized by it, so raising it doesn't break any invariant I could find. A couple of things around it are worth a look though.

What I checked in crates/victory-gpu/src/host.rs:

  • LATE_MOST is only used for the check in send_late (4298), the wait right after it (4306) and the two log lines (3425, 3566). No array, ring, pool or heap is sized from it anywhere in the crate. I also grepped for literal 256s in this area and none of them are tied to it.
  • It's a soft cap. The check runs after *flying += order.len(), so one submission bigger than the limit goes out anyway, and execute_own (4334) adds the present without checking at all. relay_wait waits for lists < limit, and lists gets recounted from the flights still in the line every time something lands (around 4203-4215), so it can't hang even when a single flight is over the limit.
  • The relay thread waits on one fence and one event and keeps the line in a Vec (3470-3530). No fixed wait array or per-flight slot count.
  • Retire/bury: a flight carries the submission number taken from STARTED (4517, 4706) before it goes in the line. FINISHED only moves when flights land (around 4183), and bury subtracts BURY_LAG from that (393). Title submissions that haven't started yet are covered by queued() (queue/behind.rs 578/749/766). So more lists in the air doesn't let anything get dropped early. land() still holds back the last 128 landed flights (flights, not lists) before recycling (3382), same as before.

Things that do interact with a higher value:

  1. Idle list pool. IDLE_MOST is (512 lists, 256 MiB) in list.rs:228. Above 512, a settle that lands everything at once (the sweep settle every 1.5 s at host.rs:4508, a blocking fence wait, a read-back) hands back more lists than the pool keeps. The extra ones get dropped (list.rs:293/305) and the next frames create new lists, which is the churn the comment above it describes. Either cap the clamp at 512 or scale IDLE_MOST with late_most().
  2. Descriptor slots. The 1,048,576 in the description only applies when the host heap is 2^21 views. dynamic_slots (descriptor/host.rs:1716) gives null - count capped there. A host that falls back to PORTABLE_VIEWS (1,000,000, title heap around 720k) gets about 280k, while lists hold their tables until they land (release_tables, host.rs:4166). Also, "no free dynamic descriptor slots" is only logged once per process (descriptor/host.rs:2032), so the DynamicRefused counter is a better check than counting warnings. It'd be good to note that 2048 is only tested at 512 so far.
  3. Parsing is fine: read once through OnceLock, default is 256, and 0/1 clamp to 64. Garbage, negative and overflowing values all quietly fall back to 256, so "99999999999999999999" gives 256 rather than 2048. The resolved value does show up in the startup info line, so it's not invisible. A warn on an unparseable value would still help.
  4. docs/SETTINGS.md lists the other VICTORY_* knobs, and this one should probably get a row there. The doc comment at 2677 still says LATE_MOST.

Tests, cargo test -p victory-gpu --lib (skipping descriptor::tests::views_die_with_their_resource), one NVIDIA desktop card. On the PR branch with the variable unset, set to 1024 and set to 1: 329 passed, 5 failed, 23 ignored every time. The failures are the same 5 as on current main: indirect::tests::host_list_reuses_and_grows_scratch_across_submissions, indirect::tests::host_list_window_executions_need_no_barrier_of_their_own, the two pipeline::host::tests mesh/depth-bounds ones, and the flaky watch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own. Main passes more tests in total only because it has newer tests since the branch point. No unit test reaches send_late (only queue/behind.rs:746/762 call into it), so the env runs only show nothing else moved. They don't exercise the cap.

I also pulled the parse into a pure function locally (not pushed) and checked unset, "", "abc", "-1", "0", "1", "63", "64", " 512 ", "1024", "2048", "2049", an overflowing number, "0x200" and "512.0". All came out as described above.

Clippy: no new warnings on the changed lines.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-03 23:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7395296213) Went through this on native Windows 11 (MSVC). Short version: 256 really is just a soft trigger, nothing is sized by it, so raising it doesn't break any invariant I could find. A couple of things around it are worth a look though. What I checked in crates/victory-gpu/src/host.rs: - `LATE_MOST` is only used for the check in `send_late` (4298), the wait right after it (4306) and the two log lines (3425, 3566). No array, ring, pool or heap is sized from it anywhere in the crate. I also grepped for literal 256s in this area and none of them are tied to it. - It's a soft cap. The check runs after `*flying += order.len()`, so one submission bigger than the limit goes out anyway, and `execute_own` (4334) adds the present without checking at all. `relay_wait` waits for `lists < limit`, and `lists` gets recounted from the flights still in the line every time something lands (around 4203-4215), so it can't hang even when a single flight is over the limit. - The relay thread waits on one fence and one event and keeps the line in a Vec (3470-3530). No fixed wait array or per-flight slot count. - Retire/bury: a flight carries the submission number taken from `STARTED` (4517, 4706) before it goes in the line. `FINISHED` only moves when flights land (around 4183), and `bury` subtracts `BURY_LAG` from that (393). Title submissions that haven't started yet are covered by `queued()` (queue/behind.rs 578/749/766). So more lists in the air doesn't let anything get dropped early. `land()` still holds back the last 128 landed flights (flights, not lists) before recycling (3382), same as before. Things that do interact with a higher value: 1. Idle list pool. `IDLE_MOST` is (512 lists, 256 MiB) in list.rs:228. Above 512, a settle that lands everything at once (the sweep settle every 1.5 s at host.rs:4508, a blocking fence wait, a read-back) hands back more lists than the pool keeps. The extra ones get dropped (list.rs:293/305) and the next frames create new lists, which is the churn the comment above it describes. Either cap the clamp at 512 or scale `IDLE_MOST` with `late_most()`. 2. Descriptor slots. The 1,048,576 in the description only applies when the host heap is 2^21 views. `dynamic_slots` (descriptor/host.rs:1716) gives `null - count` capped there. A host that falls back to `PORTABLE_VIEWS` (1,000,000, title heap around 720k) gets about 280k, while lists hold their tables until they land (`release_tables`, host.rs:4166). Also, "no free dynamic descriptor slots" is only logged once per process (descriptor/host.rs:2032), so the `DynamicRefused` counter is a better check than counting warnings. It'd be good to note that 2048 is only tested at 512 so far. 3. Parsing is fine: read once through `OnceLock`, default is 256, and 0/1 clamp to 64. Garbage, negative and overflowing values all quietly fall back to 256, so "99999999999999999999" gives 256 rather than 2048. The resolved value does show up in the startup info line, so it's not invisible. A warn on an unparseable value would still help. 4. docs/SETTINGS.md lists the other `VICTORY_*` knobs, and this one should probably get a row there. The doc comment at 2677 still says `LATE_MOST`. Tests, `cargo test -p victory-gpu --lib` (skipping `descriptor::tests::views_die_with_their_resource`), one NVIDIA desktop card. On the PR branch with the variable unset, set to 1024 and set to 1: 329 passed, 5 failed, 23 ignored every time. The failures are the same 5 as on current main: `indirect::tests::host_list_reuses_and_grows_scratch_across_submissions`, `indirect::tests::host_list_window_executions_need_no_barrier_of_their_own`, the two `pipeline::host::tests` mesh/depth-bounds ones, and the flaky `watch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own`. Main passes more tests in total only because it has newer tests since the branch point. No unit test reaches `send_late` (only queue/behind.rs:746/762 call into it), so the env runs only show nothing else moved. They don't exercise the cap. I also pulled the parse into a pure function locally (not pushed) and checked unset, "", "abc", "-1", "0", "1", "63", "64", " 512 ", "1024", "2048", "2049", an overflowing number, "0x200" and "512.0". All came out as described above. Clippy: no new warnings on the changed lines. AI-assisted: yes
Author
Owner

@⁠MikeSouza1 on GitHub · 2026-12-03 23:37 UTC · original

Thanks a lot @⁠Kal0s-design for the thorough review and testing on Windows! I've pushed a follow-up commit addressing all four points:

  1. Upper bound capped at 512 (LATE_MOST_MAX = 512): Keeps the clamp aligned with list::IDLE_MOST.0 (512 idle host lists) so full settles don't trigger list-pool churn, and keeps it within the actually tested range (512 already eliminates the lists_in_air stall).
  2. Descriptor slots / DynamicRefused: Good catch on PORTABLE_VIEWS hosts (~280k dynamic slots) and the once-per-process warning log. Capping at 512 keeps descriptor pressure bounded, and I verified dynamic_refused=0.0 across all 41 stats: recording samples in a diag run at VICTORY_LATE_MOST=512.
  3. Pure parser + warning + unit tests: Extracted parse_late_most(Option<&str>) -> (usize, bool) with a tracing::warn! on unparseable/overflowing values (while treating unset/empty cleanly as default) and added unit tests in host::relay_tests covering bounds and invalid inputs (PKG=victory-gpu ./build.sh test --lib host::relay_tests passes).
  4. Docs: Added VICTORY_LATE_MOST to docs/SETTINGS.md (under Runtime-only settings) and updated the doc comment in host.rs to reference late_most.
**@⁠MikeSouza1** on GitHub · 2026-12-03 23:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7395791697) Thanks a lot @⁠Kal0s-design for the thorough review and testing on Windows! I've pushed a follow-up commit addressing all four points: 1. **Upper bound capped at 512 (`LATE_MOST_MAX = 512`):** Keeps the clamp aligned with `list::IDLE_MOST.0` (512 idle host lists) so full settles don't trigger list-pool churn, and keeps it within the actually tested range (`512` already eliminates the `lists_in_air` stall). 2. **Descriptor slots / `DynamicRefused`:** Good catch on `PORTABLE_VIEWS` hosts (~280k dynamic slots) and the once-per-process warning log. Capping at 512 keeps descriptor pressure bounded, and I verified `dynamic_refused=0.0` across all 41 `stats: recording` samples in a `diag` run at `VICTORY_LATE_MOST=512`. 3. **Pure parser + warning + unit tests:** Extracted `parse_late_most(Option<&str>) -> (usize, bool)` with a `tracing::warn!` on unparseable/overflowing values (while treating unset/empty cleanly as default) and added unit tests in `host::relay_tests` covering bounds and invalid inputs (`PKG=victory-gpu ./build.sh test --lib host::relay_tests` passes). 4. **Docs:** Added `VICTORY_LATE_MOST` to `docs/SETTINGS.md` (under *Runtime-only settings*) and updated the doc comment in `host.rs` to reference `late_most`.
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-03 23:45 UTC · original

Rechecked at f02f958, thanks for the quick turnaround. All four points look addressed: the clamp is now 64 to 512 (LATE_MOST_MAX, host.rs:2530), parse_late_most is pure and warns only on unparseable input, the doc comment at host.rs:2725 points at late_most, and the SETTINGS.md row matches the code (64 to 512, default 256).

host::relay_tests passed 10 times in debug and 10 in release. The full victory-gpu --lib run gives 340 passed, 5 failed, 23 ignored, and the 5 are the same known failures as on main. No new clippy warnings on the changed lines.

Two small things, neither blocking. A value above 512 (say 2048) is clamped to 512 silently, which is fine since the startup line shows the resolved value, but a short note in the warn or the docs could save someone a confused moment. The PR description still says 64..=2048 and mentions the 1,048,576 slots, so it's worth updating to match the new cap.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-03 23:45 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7395949923) Rechecked at f02f958, thanks for the quick turnaround. All four points look addressed: the clamp is now 64 to 512 (`LATE_MOST_MAX`, host.rs:2530), `parse_late_most` is pure and warns only on unparseable input, the doc comment at host.rs:2725 points at `late_most`, and the SETTINGS.md row matches the code (64 to 512, default 256). `host::relay_tests` passed 10 times in debug and 10 in release. The full `victory-gpu --lib` run gives 340 passed, 5 failed, 23 ignored, and the 5 are the same known failures as on main. No new clippy warnings on the changed lines. Two small things, neither blocking. A value above 512 (say 2048) is clamped to 512 silently, which is fine since the startup line shows the resolved value, but a short note in the warn or the docs could save someone a confused moment. The PR description still says `64..=2048` and mentions the 1,048,576 slots, so it's worth updating to match the new cap. AI-assisted: yes
Author
Owner

@⁠joaowtrdev on GitHub · 2026-12-04 00:05 UTC · original

Tried VICTORY_LATE_MOST=512 against the default 256 (d444868, merged on main with #354, #364, #382 and #376). Ryzen 7 5700X3D, RX 9070 XT, 4K output, FSR 4 Performance, RT on, VICTORY_PARTS_ONE_CALL=1, lsfg-vk 2x. One run each, back to back, from the same save: 1 min standing, then ~5 min driving through the city.

It does what it says on the wait, but here the run got worse:

driving 256 512
256/512 lists in the air, ms per frame 8.2 0.0
gpu_wait_ms, mean 10.1 0.6
fps, median 21.8 23.4
1% low 6.5 5.5
presents > 100 ms, per min 78.7 99.4
presents > 250 ms, per min 0.4 1.1

Also, with 512 the tree shadows flickered while driving. I didn't see that with 256, nor in any earlier run on this build. So with more lists in the air something that the shadows read seems to get reused or rewritten before the card is done with it, even if I couldn't say what. BeanieMen saw lows drop with 512 in #369 too.

On this machine the card is already the limit most of the time, so the 8 ms wait at 256 seems to be mostly back-pressure rather than a stall. I'm keeping 256.

**@⁠joaowtrdev** on GitHub · 2026-12-04 00:05 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7396363414) Tried `VICTORY_LATE_MOST=512` against the default 256 (`d444868`, merged on `main` with #354, #364, #382 and #376). Ryzen 7 5700X3D, RX 9070 XT, 4K output, FSR 4 Performance, RT on, `VICTORY_PARTS_ONE_CALL=1`, lsfg-vk 2x. One run each, back to back, from the same save: 1 min standing, then ~5 min driving through the city. It does what it says on the wait, but here the run got worse: | driving | 256 | 512 | |---|---|---| | `256/512 lists in the air`, ms per frame | 8.2 | 0.0 | | `gpu_wait_ms`, mean | 10.1 | 0.6 | | fps, median | 21.8 | 23.4 | | 1% low | 6.5 | 5.5 | | presents > 100 ms, per min | 78.7 | 99.4 | | presents > 250 ms, per min | 0.4 | 1.1 | Also, with 512 the tree shadows flickered while driving. I didn't see that with 256, nor in any earlier run on this build. So with more lists in the air something that the shadows read seems to get reused or rewritten before the card is done with it, even if I couldn't say what. BeanieMen saw lows drop with 512 in #369 too. On this machine the card is already the limit most of the time, so the 8 ms wait at 256 seems to be mostly back-pressure rather than a stall. I'm keeping 256.
Author
Owner

@⁠MikeSouza1 on GitHub · 2026-12-04 00:49 UTC · original

Thanks @⁠Kal0s-design for rechecking f02f958! I'll update the PR description to match the 64..=512 cap and note silent clamping clearly.

And thanks a lot @⁠joaowtrdev for the detailed back-to-back driving benchmark on the 9070 XT! That's super useful data: it matches what I saw on the wait reduction and median FPS bump, while showing that on a GPU-bound 4K setup 256 acts as helpful back-pressure for 1% lows — and the tree shadow flickering at 512 is a great catch (definitely reinforces keeping 256 as the default and keeping VICTORY_LATE_MOST strictly opt-in for experimentation/debugging).

**@⁠MikeSouza1** on GitHub · 2026-12-04 00:49 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7397198712) Thanks @⁠Kal0s-design for rechecking `f02f958`! I'll update the PR description to match the `64..=512` cap and note silent clamping clearly. And thanks a lot @⁠joaowtrdev for the detailed back-to-back driving benchmark on the 9070 XT! That's super useful data: it matches what I saw on the wait reduction and median FPS bump, while showing that on a GPU-bound 4K setup `256` acts as helpful back-pressure for 1% lows — and the tree shadow flickering at `512` is a great catch (definitely reinforces keeping `256` as the default and keeping `VICTORY_LATE_MOST` strictly opt-in for experimentation/debugging).
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 11:16 UTC · original

The conversion is complete — I checked that no bare LATE_MOST use survives in the four paths (crates/victory-gpu/src/host.rs:3480, :3620, :4329, :4351, :4360), the doc at :2725 was updated with the constant, and parse_late_most has a real table test.

Two nits, both about the constant staying honest:

  • LATE_MOST_MAX = 512 is justified at host.rs:2527-2529 by crate::list::IDLE_MOST.0, which is private at crates/victory-gpu/src/list.rs:228. Nothing ties them, so if that pool shrinks the clamp silently stops being a bound. A const _: () = assert!(LATE_MOST_MAX <= 512); next to it, or re-exporting the constant, would make the claim enforceable instead of a comment.
  • parse_late_most returns valid = true for out-of-range numbers, so VICTORY_LATE_MOST=5120 becomes 512 with no log line while abc warns. You say "clamped silently" in the body and the test pins it, so this is a choice — but a one-line warning for "asked for X, using Y" would save the next person the confusion, and valid currently reads as "used as given", which is only true after the clamp.

On the risk: this threshold was also what kept a frame's dynamic descriptor slots and scratch chunks from being held at once, so 512 is a real raise of that pressure. Default 256 plus your dynamic_refused=0.0 samples is the right conservative call.

**@⁠Luxuride** on GitHub · 2026-12-04 11:16 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7409869747) The conversion is complete — I checked that no bare `LATE_MOST` use survives in the four paths (`crates/victory-gpu/src/host.rs:3480`, `:3620`, `:4329`, `:4351`, `:4360`), the doc at `:2725` was updated with the constant, and `parse_late_most` has a real table test. Two nits, both about the constant staying honest: - `LATE_MOST_MAX = 512` is justified at `host.rs:2527-2529` by `crate::list::IDLE_MOST.0`, which is private at `crates/victory-gpu/src/list.rs:228`. Nothing ties them, so if that pool shrinks the clamp silently stops being a bound. A `const _: () = assert!(LATE_MOST_MAX <= 512);` next to it, or re-exporting the constant, would make the claim enforceable instead of a comment. - `parse_late_most` returns `valid = true` for out-of-range numbers, so `VICTORY_LATE_MOST=5120` becomes 512 with no log line while `abc` warns. You say "clamped silently" in the body and the test pins it, so this is a choice — but a one-line warning for "asked for X, using Y" would save the next person the confusion, and `valid` currently reads as "used as given", which is only true after the clamp. On the risk: this threshold was also what kept a frame's dynamic descriptor slots and scratch chunks from being held at once, so 512 is a real raise of that pressure. Default 256 plus your `dynamic_refused=0.0` samples is the right conservative call.
Author
Owner

@⁠MikeSouza1 on GitHub · 2026-12-04 17:05 UTC · original

Thanks for the review @⁠Luxuride! Addressed both points in e0cb97d:

  • Exposed crate::list::IDLE_MOST as pub(crate) and added const _: () = assert!(LATE_MOST_MAX <= crate::list::IDLE_MOST.0); (alongside LATE_MOST_MIN <= LATE_MOST <= LATE_MOST_MAX) so the idle-pool upper bound is enforced at compile time rather than only in comments.
  • Replaced (usize, bool) in parse_late_most with an explicit LateMostParse enum (Default, Exact, Clamped { asked }, Invalid), added a tracing::warn! in late_most() when clamping out-of-range values (asked, using, min, max), and updated relay_tests and the PR description accordingly.

Verified with PKG=victory-gpu ./build.sh check, PROFILE=diag PKG=victory-gpu ./build.sh check (0 warnings on both), and PKG=victory-gpu ./build.sh test -- relay_tests (2 passed; 0 failed).

**@⁠MikeSouza1** on GitHub · 2026-12-04 17:05 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/385#issuecomment-7418403736) Thanks for the review @⁠Luxuride! Addressed both points in `e0cb97d`: - Exposed `crate::list::IDLE_MOST` as `pub(crate)` and added `const _: () = assert!(LATE_MOST_MAX <= crate::list::IDLE_MOST.0);` (alongside `LATE_MOST_MIN <= LATE_MOST <= LATE_MOST_MAX`) so the idle-pool upper bound is enforced at compile time rather than only in comments. - Replaced `(usize, bool)` in `parse_late_most` with an explicit `LateMostParse` enum (`Default`, `Exact`, `Clamped { asked }`, `Invalid`), added a `tracing::warn!` in `late_most()` when clamping out-of-range values (`asked`, `using`, `min`, `max`), and updated `relay_tests` and the PR description accordingly. Verified with `PKG=victory-gpu ./build.sh check`, `PROFILE=diag PKG=victory-gpu ./build.sh check` (0 warnings on both), and `PKG=victory-gpu ./build.sh test -- relay_tests` (`2 passed; 0 failed`).
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/385/head:github-bot/gh-385'
git switch 'github-bot/gh-385'

Merge

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