Repository navigation
Avoid RangeSet node reallocations for right-growing merges - #36
Majed-allababedi wants to merge 2 commits into
Conversation
|
I investigated the failed Windows check on this PR. The important finding is that the same five failures reproduce on unmodified upstream Failure and root causePR run 38451080651 fails all five Commit c42b55f94 deliberately changed INSERTQ emulation to zero bits 127:64, based on your Zen 4 measurements. Two Windows test expectations in
Instrumenting the first failure showed that the destination matched the expected result except for this quadword: actual Minimal local correction- output.destination[1] == (insert ? input[1] : 0) &&
+ output.destination[1] == 0 &&
- (host.sse4a || output[3] == input[1]) &&
+ (host.sse4a || output[3] == 0) &&The low-lane result oracle, upper YMM preservation, source/state checks, and existing native-host exception are unchanged. No production source changes, disabled tests, weakened masks, or added skips are needed. To be precise, the ISA documents these upper bits as undefined. This correction matches the behavior the project intentionally selected and your reported AMD measurement; it is not a claim that zero is universally mandated by the ISA or newly measured on AMD here. The local host is Intel i5-14600K. Verification
The same-base upstream main CI run passed 20/20, so I am not claiming it failed everywhere. The test has native-SSE4a-dependent paths/skips, which could explain different runner outcomes, but I have not established the runner CPU identity or proven that explanation. Remote CI has not been rerun with this correction yet. The correction is currently local and review-verified; this comment does not change the PR branch. It can be applied independently of the RangeSet optimization. |
Summary
Avoid erasing and reallocating the first
std::mapnode whenRangeSet::Addgrows an existing interval without changing its start.End()validation, synchronization, and all renderer/coherence ordering unchanged.range_set_teststarget, register it with CTest/kyty_tests, and explicitly include it in the Windows U59 CI build/test lists.This targets repeated dirty-range/scissor-row accumulation. It introduces no game-specific behavior, graphics-setting changes, shader changes, or quality reductions.
Why the merge is equivalent
The existing
lower_bound/predecessor selection guarantees that an anchor withit->first <= addresstouches or overlaps the incoming interval. The preceding containment check guaranteesend > it->secondon the new path. The key can therefore stay fixed while the endpoint grows; successor absorption uses the same<=touching rule andmaxendpoint as before. Erasing successors does not invalidate the retained iterator.Tests against this PR's actual base
Base:
f9e19582f0deac0d1226a7ce3faae30a9ab408ab(main), not the newer release branch used for playtesting.Windows, clang-cl 22.1.3, Release:
--semantics-onlypassed;--allocations-onlyfailed on the intended replacement-node allocation/free assertions. The contained control was already allocation-free.range_set,memory_tracker, andpage_managerpassed (3/3 CTest entries).UINT64_MAXboundaries.Reproduce the focused suite after normal project configuration:
cmake --build build --target range_set_tests memory_tracker_tests page_manager_tests ctest --test-dir build --output-on-failure -R "^(range_set|memory_tracker|page_manager)$"The standalone executable also accepts
--semantics-only,--allocations-only, and--bench.Component measurements — not game FPS
Measured on an i5-14600K / Windows using the byte-identical before/after
RangeSetheaders and test source in the AMD5b-based development build. The PR-base correctness tests above were rebuilt separately. Both measured variants used the same compiler/Release flags and allocation wrappers. Setup, destruction, and output validation were outside timing; counting was a separate pass. Ten A-B-B-A cycles yielded 20 measured samples per variant, excluding warmups.Representative medians, 64 seed groups and 32 adds per group:
A slower control is retained in the results: contained/one-group increased from 3.433 to 3.771 ns/add (about 9.86%, or 0.338 ns). Seed groups are not always map-node counts: the bridge case initially has 33 nodes per group. Benchmark allocation/free columns describe one counting pass; timing summaries describe run averages, not single-operation latency.
Playtesting and limits
I noticed a good improvement while playing Astro Bot on my i5-14600K / RX 6800 with this change on
u59-windows-20261011-int18.1-amd5b-pre. This is a qualitative observation, not a controlled same-scene FPS measurement or a claimed FPS percentage. The local builds use IPO with PGO disabled, so comparing them with an official release is not a source-only performance comparison. Existing local non-tiled-lighting/GI-probe workarounds were retained; none are part of this PR.The broader AMD5b test run was not all-green: GPU harness runs were blocked by rasterization-feature/validation-layer prerequisites, and the unrelated
thread_serviceprecise-wait assertion remained failing.draw_prepexceeded an initial 60-second cap but passed with a 120-second allowance. These are separately recorded release-based results, not a claim that the fullmaintest suite passed. No renderer barriers or test assertions were weakened.