Repository navigation
Conversation
…hange `hot_runs` makes a block new to the watched ranges hot. To find those it kept a set of all blocks (2 MiB) of the ranges of the last look and, each time the ranges changed, made the set again over every block of every range while holding `HOT` (the walk thread takes it too). The ranges are made again whenever a tile is mapped, a texture is placed, a GPU-view page is shown: in a retail title's world that is ~3.5 GB in 16 ranges, ~1,800 blocks, and the ranges change between many of the submits. Now `new_blocks` compares the ranges with the last look's (both sorted and apart, as `watch_ranges` makes them): a range found among the old ones as it is has no new block, and a block of a changed range is new when no old range meets it, which is what the set said. 16 ranges with one changed: 4 µs against 1.4 ms for a set of all their blocks (debug build, the test's own timing; not measured in a release build or a game). Test: new_blocks_are_those_no_old_range_meets (against a set of all the old blocks: ranges grown, shifted, merged, new, gone, in part of a block). Ported from amd-dev without its reasons for a hot block (`HOT_NEW`, `look_stats::HOT_WHY`), which main does not have: a new block is put in with its time only, as before. (cherry picked from commit 5b660277a9460246eca668b144872fe4c66c1594) (cherry picked from commit 5ff2b66) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62895b1 to
d8c75c5
Compare
|
merge-check
|
|
merge-check claim |
|
merge-check |
Port of raylitebull's amd-dev commit
5ff2b663. To find blocks newly added to the watched ranges,hot_runsrebuilt a set of every 2 MiB block of every range each time the ranges changed, while holdingHOT, which the walk thread also takes. A retail title's world has about 1,800 such blocks.new_blocksnow compares the sorted ranges with the last look's:The result is the set's, but only changed ranges are walked.
What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs:new_blocks,hot_runsusing it (theknownset goes), and the testnew_blocks_are_those_no_old_range_meets. The test checks against a set of all old blocks for ranges grown, shifted, merged, new, gone, and in part of a block.HOT_NEW,look_stats::HOT_WHY), which main does not have. A new block is put in with its time only, as before.Review:
new_blocksrelies on the ranges being sorted and apart.watch_rangesmakes them so, andhot_runsalready relied on that. If two ranges ever overlapped, the error could only go one way: extra blocks marked hot, never a missed one.Tested
cargo test -p xcl --lib hle::d3d12x::title_textures: 66 passed, 0 failed, 1 ignoredcargo test --workspace --no-fail-fast -- --test-threads=4on d8c75c5, rebased on main 86e86fc (5070 Ti): 2890 passed, 0 failed, 51 ignored. SKIPPED: 28 notices, almost allno wave64(the others: no D3D12 debug layer, heap windows off, driver cache needs Developer Mode). The narrower runs listed here are from before the rebase.Regression run
main:
this PR:
Not tested
AI use
5ff2b663.🤖 Generated with Claude Code