reprend #2029: runtime: guard overflow/div-by-zero and remove duplicate passes in d3d12_xs_alloc_size #2739
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2739"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T13:39:53Z.
Carries #2029 by @IlyassRS3, because it conflicts with
mainafter #2566 and the reminder to mergemain(https://github.com/ProjectLeonida/mandy/pull/2029#issuecomment-7232641357) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.Item:
RT-XS-ALLOC-SIZE-OVERFLOW-AND-SINGLE-PASS-CARRY(claimed in https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; original itemRT-XS-ALLOC-SIZE-OVERFLOW-AND-SINGLE-PASS).What this branch is
0c4bdde51, unchanged (no rebase, author commits kept).main(from the carry preparation of 29/11) that resolves the conflict, then a merge of currentmainf9f3ec4c6, which had a new conflict (below). Both merge commits carryCo-authored-bythe author.What conflicted and how it was resolved
runtime/shims/d3d12_xs_alloc_size.h: the PR's one-passconsole_placement, withmain'stitle_descs/title_layoutandconsole_unordered_access_sizeadded to the per-description overloads.runtime/CMakeLists.txt(2 hunks):xs_alloc_size_testandappnotify_testboth kept.f9f3ec4c6:runtime/shims/d3d12_xs_alloc_size.h,align_up_saturating:main(#2027) returnsvaluewhento == 0, the PR whento <= 1; forto == 1the rounding givesvalueas well, so both agree; the PR's guard and comment kept.main'sd3d12_xs_alloc_size_test(#2027) and the PR'sxs_alloc_size_testare both built: CI runsmain's test against the PR's rewrite.A function is rewritten (
console_placementin one pass): please read it againstmain's version.Tests
mainf9f3ec4c6merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run).ctest502 tests,xs_alloc_sizepasses; red (main's header): 6 FAIL.python -I scripts/check_no_game_data.pyon every file this PR changes: clean.ctest, the full translator suite).Depends on: none.
Needs a careful human read of the resolution and an independent verifier before merge (red/green on another machine).
AI-assisted (Claude Code, oreofr-agent).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T14:13:31Z.
Independent red/green on another machine, as the description asks. Head
ff55c339emerged onto currentmainb17b22d33(no conflict, treed87fc9b6b). Native Windows 11, MSVC 19.50 x64. Each test was built alone with the CMake target's include dirs and defines (/Ishims /Isrc /DWIN32_LEAN_AND_MEAN /DNOMINMAX /W4 /permissive- /utf-8), under AddressSanitizer with the debug CRT (/Od /MDd /fsanitize=address).Red:
main's runtime + this PR'stest/xs_alloc_size_test.cpp:FAILED (4 failures):render target multi-mip slice accumulation overflow returns 0depth-stencil multi-plane slice accumulation overflow returns 0pc_one called exactly once per descriptor even when each is non-nullcount > 16 heap-spill path calls pc_one once per entry(The earlier merge's "6 FAIL" was against an older
main.) Same at/O2 /MD: exit 1.Green: the merged tree:
xs_alloc_size_test: OK (0 failures)under ASan, no report; also OK at/O2 /MD.The rewritten
console_placementagainstmain's own test:main'stest/d3d12_xs_alloc_size_test.cpp(#2027) built against this PR's header:62/62 checks passedunder ASan, the same as againstmain's header (62/62).Only warnings:
xg_xs_layout.h(163)C4996 (getenv) and(347)C4334, identical onmain. Not in this PR's files.I didn't do a line-by-line read of the conflict resolution beyond these two test files.
GPUs tested: n/a (CPU unit tests). AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T15:30:15Z.
Independent check on Windows (not the author), at
ff55c339e.runtimeand builtxs_alloc_size_test(MSVC 14.52.37025, Windows SDK 10.0.26100).xs_alloc_size_test: OK (0 failures)— exit 0.Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711.
Based on
f9f3ec4c6; a rebase on currentmainbefore merge would keep history linear.AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T15:48:11Z.
Verified by MoonEyes (another owner than OreoFR) on head
ff55c339emerged withmainbe7690805: Windows 11, MSVC 2022 x64, RelWithDebInfo, RTX 4060 8 GB (NVIDIA).ctest -R ^xs_alloc_size$: 1/1 passed; withd3d12_xs_alloc_size.hofmain4 failures.Unit test only: no run of the title (this is the Vulkan path).
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T16:50:45Z.
Merging. Head
ff55c339emerges cleanly withmain6dbbe6df5and does not force a rebase of #2566. Vulkan path: Moon's written OK for this PR without a run in the game; ctest red and green on Windows 11, and by another person. Merged by MoonEyes.AI-assisted (Claude Code).