WIP: Resume idle texture sweeps at unvisited candidates #628

Draft
holoslicer wants to merge 2 commits from holoslicer/Darner:fix/resume-idle-texture-sweep into Main
Contributor

Reproduced the idle-sweep issue offline on Windows x64. Tested the fix on an RTX 3090 during matched short drives and fixed-camera holds. A sustained dense-traffic comparison is still open.

Contributor role (optional)

  • Fluxer ID: 1577921940104949761. Please grant the Contributor role when eligible.

What it changes

On c8258f95, a time-limited idle texture sweep advances its cursor over candidates it has yet to inspect. With pinned candidates at the front, the age-ordered sweep can repeatedly run out of time before reaching releasable copies. Address-order sweeps can skip the candidate at a deadline boundary.

Remember the next unvisited candidate across bounded sweeps. Revalidate a pending address against the live registry and its last-use stamp before examining it. Existing idle, reference and mapping checks still decide whether a copy can be released.

How it was tested

  • Tested revision 55ece4c9d460fabc94e5144f5bb876ec9621caaa, based on c8258f95569c10fe75b5bfb785d3865b5deeefd9.
  • Reproduce with 1,024 generated 4 KiB copies, an additional reference to the first 255 and a deadline that expires at the first regular time check on each sweep. Run 16 sweeps in each order and count unique releases. The baseline harness uses the upstream traversal. The candidate uses the new production iterator.
Offline result Main Candidate
Eligible copies freed, age order 0 / 769 769 / 769
Eligible copies freed, address order 765 / 769 769 / 769
Held copies preserved, both modes 255 / 255 255 / 255
  • A second test interrupted a forced sweep over 16,384 candidates between regular sweeps. The earlier draft retained capacity for all 16,384 entries. This revision preserved the regular scan's three outstanding entries and its four-entry allocation. The whole-table allocation was local to the forced sweep.
  • The three idle-sweep tests, related eviction checks, both workspace Clippy gates with warnings denied, and the full asset-policy check passed. The two default-path fixes also passed seven combined checks on the local #547/#551 source, including the existing remap and full-queue alias-write regressions.
  • The default traversal changes when a sweep stops early. The configured time budget stays the same. The offline fixture measures which copies can be freed. The gameplay measurements below cover short matched drives and late-session stationary holds.
  • A baseline RTX 3090 trace recorded 5,355 idle sweeps. Of 5,352 rows with one sweep, 2,392 recorded at least 4 ms, with p95 at 31.07 ms. That wall timer includes work outside the deadline check and can run off-thread. The baseline does not identify which sweeps stopped early or how many were blocked by pinned candidates.
  • The full serial workspace gate remained red. The first GPU run passed 1,825 tests with 81 ignored and one failure in the capped pipeline wait. That same test passed 5/5 in isolation. A control with that test skipped reached the alias-write/full-queue test, which passed 3/3 in isolation. On the Windows host an unfiltered GPU rerun passed both of those tests and all idle-sweep tests. This run recorded 1,825 passed, 81 ignored and one failure in the unrelated worker owner-unwind test (#549), which then passed in five fresh standalone native processes. The three HLE loopback tests that failed under restricted permissions all passed on the host. Related upstream test investigations include #539, #547 and #565.

RTX 3090 gameplay comparison

Compared the local #547/#551 release 7659f0c against bebc803, the same source plus only this PR's two commits. Both matched the original release compiler, feature and shader configurations. Each process received a private copy of the same v38 save, graphics profile and warm player cache. Both used Series X, hardware RT, 2560 × 1440, 1484 × 835 DLSS Balanced input, frame generation off, normal game speed and a 60 FPS cap. The two long sessions ran 35m 15s and 35m 11s. Both exited normally with zero gaps in the present stream.

Start from the daylight storefront with the Ganado. Reverse from the parking wheel stop until the vehicle aligns between the two teal garage doors. Ordinary controller input and one-second landmark images confirmed the same segment. We scored complete successful intervals with visible displacement. Each pass covered about two seconds, so its 1% low is just one frame. Traffic and collisions prevented a repeatable high-speed route into a dense area.

Matched pass, control / PR Average FPS 1% low FPS p95 frame ms p99 frame ms Above 33.33 ms
Fresh parking maneuver at 3m 01s 19.77 / 17.20 14.11 / 14.19 60.72 / 65.61 70.87 / 70.46 100% / 100%
Fresh residential acceleration at 3m 39s 16.10 / 15.06 10.21 / 6.50 75.54 / 81.67 97.95 / 153.88 100% / 100%
First matched traversal in the long-run comparison at about 16 min 17.52 / 17.91 13.70 / 12.76 62.18 / 65.65 72.97 / 78.38 100% / 97.22%
Repeat at about 19.5 min 18.42 / 18.50 14.28 / 13.12 64.09 / 59.99 70.01 / 76.23 100% / 100%
Late at about 30 min 17.86 / 17.75 13.61 / 10.08 62.76 / 73.06 73.47 / 99.19 100% / 100%

For the two fresh rows we relaunched control with a pristine private copy and repeated the candidate's startup warm-up, parking maneuver and forward acceleration from the garage trailer to the pale apartment's exterior stairs and chimney. The control ran for 4m 17s. The matched starts were within one second of the candidate's elapsed time. Across all five rows, visually confirmed driving accounted for 10.869 seconds on control and 10.885 seconds on the candidate. Available system memory also differed during the fresh residential stretch, at 1,746 versus 376 MiB.

Pooling the raw inter-present intervals across those five windows yielded 17.76 / 17.09 average FPS, 11.03 / 7.90 FPS for the 1% low, 66.11 / 76.20 ms at p95, and 83.35 / 99.19 ms at p99. In total 193/193 control frames and 185/186 candidate frames exceeded 33.33 ms. The pooled 1% low uses two frames per build.

The same one-minute parked view at process age 27m 14s had 7,384 / 6,490 MB of tracked host texture copies, 10 / 7 median overdue emulator slots and 4.01 / 3.95 MB/s uploaded. Cleanup sweep p95 was 33.18 / 23.90 ms. The last two-minute parked view measured 6,727 / 6,445 MB of tracked host copies. Sweep p95 was 24.81 / 30.24 ms. Mean FPS there was 16.97 / 17.93, 1% low was 9.93 / 11.00, and frame p99 was 93.90 / 85.35 ms across 2,035 / 2,150 frames.

Process private memory grew by 10,312 / 10,606 MiB between the initial and final holds. Earlier travel and save-reload details differed. The PR sometimes reduced tracked texture copies and sweep times. This comparison did not establish lower overall process memory growth or a driving frame-time gain. The fixed-camera foliage disappearance described in #135 persisted on both builds. Keep this draft pending a longer matched traversal under streaming pressure.

Checklist

  • Reproduce a sustained fast drive into dense traffic on both builds. The matched short drives and stationary holds are reported above.
  • One change based on main.
  • Diff follows the asset policy.
  • Dependencies recorded. Depends on none.

Checked for overlap

  • Searched open and closed issues and PRs and the files changed by open PRs.
  • Related: #545 indexes a separate buffer descriptor sweep, #508 unpins idle shadow buffers, and #609 retires texture-residency records on release. Other open changes touching resource.rs include #50, #220, #335, #345, #416, #431, #443, #485, #561, #564, #565, #600 and #601.
  • No other PR found that resumes the idle host texture candidate scan after its deadline.
Reproduced the idle-sweep issue offline on Windows x64. Tested the fix on an RTX 3090 during matched short drives and fixed-camera holds. A sustained dense-traffic comparison is still open. ## Contributor role (optional) - Fluxer ID: 1577921940104949761. Please grant the Contributor role when eligible. ## What it changes On `c8258f95`, a time-limited idle texture sweep advances its cursor over candidates it has yet to inspect. With pinned candidates at the front, the age-ordered sweep can repeatedly run out of time before reaching releasable copies. Address-order sweeps can skip the candidate at a deadline boundary. Remember the next unvisited candidate across bounded sweeps. Revalidate a pending address against the live registry and its last-use stamp before examining it. Existing idle, reference and mapping checks still decide whether a copy can be released. ## How it was tested - Tested revision `55ece4c9d460fabc94e5144f5bb876ec9621caaa`, based on `c8258f95569c10fe75b5bfb785d3865b5deeefd9`. - Reproduce with 1,024 generated 4 KiB copies, an additional reference to the first 255 and a deadline that expires at the first regular time check on each sweep. Run 16 sweeps in each order and count unique releases. The baseline harness uses the upstream traversal. The candidate uses the new production iterator. | Offline result | Main | Candidate | | --- | ---: | ---: | | Eligible copies freed, age order | 0 / 769 | 769 / 769 | | Eligible copies freed, address order | 765 / 769 | 769 / 769 | | Held copies preserved, both modes | 255 / 255 | 255 / 255 | - A second test interrupted a forced sweep over 16,384 candidates between regular sweeps. The earlier draft retained capacity for all 16,384 entries. This revision preserved the regular scan's three outstanding entries and its four-entry allocation. The whole-table allocation was local to the forced sweep. - The three idle-sweep tests, related eviction checks, both workspace Clippy gates with warnings denied, and the full asset-policy check passed. The two default-path fixes also passed seven combined checks on the local #547/#551 source, including the existing remap and full-queue alias-write regressions. - The default traversal changes when a sweep stops early. The configured time budget stays the same. The offline fixture measures which copies can be freed. The gameplay measurements below cover short matched drives and late-session stationary holds. - A baseline RTX 3090 trace recorded 5,355 idle sweeps. Of 5,352 rows with one sweep, 2,392 recorded at least 4 ms, with p95 at 31.07 ms. That wall timer includes work outside the deadline check and can run off-thread. The baseline does not identify which sweeps stopped early or how many were blocked by pinned candidates. - The full serial workspace gate remained red. The first GPU run passed 1,825 tests with 81 ignored and one failure in the capped pipeline wait. That same test passed 5/5 in isolation. A control with that test skipped reached the alias-write/full-queue test, which passed 3/3 in isolation. On the Windows host an unfiltered GPU rerun passed both of those tests and all idle-sweep tests. This run recorded 1,825 passed, 81 ignored and one failure in the unrelated worker owner-unwind test (#549), which then passed in five fresh standalone native processes. The three HLE loopback tests that failed under restricted permissions all passed on the host. Related upstream test investigations include #539, #547 and #565. ### RTX 3090 gameplay comparison Compared the local #547/#551 release `7659f0c` against `bebc803`, the same source plus only this PR's two commits. Both matched the original release compiler, feature and shader configurations. Each process received a private copy of the same v38 save, graphics profile and warm player cache. Both used Series X, hardware RT, 2560 × 1440, 1484 × 835 DLSS Balanced input, frame generation off, normal game speed and a 60 FPS cap. The two long sessions ran 35m 15s and 35m 11s. Both exited normally with zero gaps in the present stream. Start from the daylight storefront with the Ganado. Reverse from the parking wheel stop until the vehicle aligns between the two teal garage doors. Ordinary controller input and one-second landmark images confirmed the same segment. We scored complete successful intervals with visible displacement. Each pass covered about two seconds, so its 1% low is just one frame. Traffic and collisions prevented a repeatable high-speed route into a dense area. | Matched pass, control / PR | Average FPS | 1% low FPS | p95 frame ms | p99 frame ms | Above 33.33 ms | | --- | ---: | ---: | ---: | ---: | ---: | | Fresh parking maneuver at 3m 01s | 19.77 / 17.20 | 14.11 / 14.19 | 60.72 / 65.61 | 70.87 / 70.46 | 100% / 100% | | Fresh residential acceleration at 3m 39s | 16.10 / 15.06 | 10.21 / 6.50 | 75.54 / 81.67 | 97.95 / 153.88 | 100% / 100% | | First matched traversal in the long-run comparison at about 16 min | 17.52 / 17.91 | 13.70 / 12.76 | 62.18 / 65.65 | 72.97 / 78.38 | 100% / 97.22% | | Repeat at about 19.5 min | 18.42 / 18.50 | 14.28 / 13.12 | 64.09 / 59.99 | 70.01 / 76.23 | 100% / 100% | | Late at about 30 min | 17.86 / 17.75 | 13.61 / 10.08 | 62.76 / 73.06 | 73.47 / 99.19 | 100% / 100% | For the two fresh rows we relaunched control with a pristine private copy and repeated the candidate's startup warm-up, parking maneuver and forward acceleration from the garage trailer to the pale apartment's exterior stairs and chimney. The control ran for 4m 17s. The matched starts were within one second of the candidate's elapsed time. Across all five rows, visually confirmed driving accounted for 10.869 seconds on control and 10.885 seconds on the candidate. Available system memory also differed during the fresh residential stretch, at 1,746 versus 376 MiB. Pooling the raw inter-present intervals across those five windows yielded 17.76 / 17.09 average FPS, 11.03 / 7.90 FPS for the 1% low, 66.11 / 76.20 ms at p95, and 83.35 / 99.19 ms at p99. In total 193/193 control frames and 185/186 candidate frames exceeded 33.33 ms. The pooled 1% low uses two frames per build. The same one-minute parked view at process age 27m 14s had 7,384 / 6,490 MB of tracked host texture copies, 10 / 7 median overdue emulator slots and 4.01 / 3.95 MB/s uploaded. Cleanup sweep p95 was 33.18 / 23.90 ms. The last two-minute parked view measured 6,727 / 6,445 MB of tracked host copies. Sweep p95 was 24.81 / 30.24 ms. Mean FPS there was 16.97 / 17.93, 1% low was 9.93 / 11.00, and frame p99 was 93.90 / 85.35 ms across 2,035 / 2,150 frames. Process private memory grew by 10,312 / 10,606 MiB between the initial and final holds. Earlier travel and save-reload details differed. The PR sometimes reduced tracked texture copies and sweep times. This comparison did not establish lower overall process memory growth or a driving frame-time gain. The fixed-camera foliage disappearance described in #135 persisted on both builds. Keep this draft pending a longer matched traversal under streaming pressure. ## Checklist - [ ] Reproduce a sustained fast drive into dense traffic on both builds. The matched short drives and stationary holds are reported above. - [x] One change based on main. - [x] Diff follows the asset policy. - [x] Dependencies recorded. Depends on none. ## Checked for overlap - [x] Searched open and closed issues and PRs and the files changed by open PRs. - Related: #545 indexes a separate buffer descriptor sweep, #508 unpins idle shadow buffers, and #609 retires texture-residency records on release. Other open changes touching `resource.rs` include #50, #220, #335, #345, #416, #431, #443, #485, #561, #564, #565, #600 and #601. - No other PR found that resumes the idle host texture candidate scan after its deadline.
TrustNo1 changed title from WIP: [pr-fix][memory] Resume idle texture sweeps at unvisited candidates to WIP: Resume idle texture sweeps at unvisited candidates 2026-12-06 03:25:56 +00:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/resume-idle-texture-sweep:holoslicer-fix/resume-idle-texture-sweep'
git switch 'holoslicer-fix/resume-idle-texture-sweep'

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 'holoslicer-fix/resume-idle-texture-sweep'
git switch 'holoslicer-fix/resume-idle-texture-sweep'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'holoslicer-fix/resume-idle-texture-sweep'
git switch 'holoslicer-fix/resume-idle-texture-sweep'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'holoslicer-fix/resume-idle-texture-sweep'
git switch 'Main'
git merge --squash 'holoslicer-fix/resume-idle-texture-sweep'
git switch 'Main'
git merge --ff-only 'holoslicer-fix/resume-idle-texture-sweep'
git switch 'Main'
git merge 'holoslicer-fix/resume-idle-texture-sweep'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
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!628
No description provided.