Repository navigation
Conversation
A title starting on a Series S profile maps 4.3 GB of physical pages in small pieces (MapTitlePhysicalPages -> sparse::committed), and each new tile cost one UpdateTileMappings + signal (~0.4 ms). Its loading thread was held ~25 s with nothing presented and its stall watchdog ended it. New tiles now get their pool tile in `mapped` at once and their mapping call is queued (`pending`); `flush_pending` sends them, one call per window, before the title's next submit, before XCL's own copies and readbacks on the windows, or past 4,096 tiles. A tile decommitted before the flush is skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
# Conflicts: # crates/xcl/src/hle/d3d12x/sparse.rs
fladit123
left a comment
There was a problem hiding this comment.
Independent validation on RTX 4060 confirms the substantial potential of batching, but I found a threshold-related performance regression that should be addressed before merging.
Results
Tested against base 930e8b4 and PR HEAD b52f7cb67236473c8a4d9a07eabaf01694d72de0.
| Synthetic workload | Baseline | PR |
|---|---|---|
| 4,096 individual commits: UpdateTileMappings calls | 4,096 | 4 |
| Median elapsed time through mapping fence | 750.89 ms | 1.24 ms |
| Parked-address stress case | 3.47 ms | 4.26 ms |
Finding
commit_range triggers flush_pending() when pending.len() >= PENDING_MAX.
However, flush_pending() retains parked addresses whose mappings have not yet been submitted. These entries continue contributing to the threshold even though they are not ready to be mapped.
With 4,095 such parked addresses, the next 32 commits triggered 32 early flushes, examining 135,167 entries including the final flush.
This effectively defeats batching in that workload and increased median elapsed time by approximately 22.8%.
I recommend tracking only unique, currently eligible mappings toward the flush threshold while preserving the necessary pending state for parked addresses that are subsequently recommitted.
A regression test covering this parked-address workload would be valuable.
Rebase considerations
Current main also has fence-based tile quarantine and per-title-queue synchronization. Please preserve these guarantees when resolving the conflicts in sparse.rs.
Correctness validation
- 14 targeted tests passed on each revision, with one ignored per revision.
- Additional integrity fixture verified nine sentinels, remapping to a different slot, and reading from a second queue.
- No D3D12 validation errors or warnings, and no device removal in the additional fixture.
- Final measurements used separate build targets and verified executable hashes.
The measurements cover synthetic mapping through fence completion, not game FPS or frame times. Integration with current main has not been validated.
The batching approach looks promising. My
Follows 7f94c6f (#532), which parks decommitted tiles; this does the same for new ones. A title starting on a Series S profile maps 4.3 GB of physical pages in small pieces (
MapTitlePhysicalPages→sparse::committed), and each new tile cost oneUpdateTileMappingsplus a signal (~0.4 ms on this PC). Its loading thread was held ~25 s with nothing presented, and its stall watchdog ended it. Related: #1268 (the firstUpdateTileMappingscalls holding the render thread).New tiles now get their pool tile in
mappedat once, and their mapping call is queued (pending).flush_pendingsends them, one call per window, before the title's next submit, before XCL's own copies and readbacks on the windows, or past 4,096 tiles. A tile decommitted before the flush is skipped. One decommitted and parked before its mapping was sent stays pending, because taking it back fromparkedsends no mapping.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:pending,flush_pending, called frombefore_execute, the upload and readback paths, andcommit_rangepastPENDING_MAX; the existing parking test extended to commit, decommit, flush and commit againTested
cargo test -p xcl --lib sparse -- --test-threads=1: 16 passed, 0 failed, 1 ignoredmain, presenting every 2 s window at the end.Regression run
main:
PR (this PR's head commit; the title is run through a folder named RetailTitle):
Not tested
AI use
🤖 Generated with Claude Code