reprend #2085: d3d12: one guarded copy per run of adjacent written geometry tiles (RT-GEOMETRY-READBACK-RUN-MERGE) #2733

Manually merged
github merged 4 commits from github-bot/gh-2733 into main 2026-11-30 16:27:21 +00:00 AGit
Owner

@⁠OreoFR on GitHub · 2026-11-30 13:39 UTC · original
OreoFR:carry/pr-2085 → main · +68 −1 · 2 files · 4 commits · merged 2026-11-30 16:25 UTC

Carries #2085 by @⁠BubsMcgee, because it conflicts with main after #2566 and the reminder to merge main (#2085) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.

Item: RT-GEOMETRY-READBACK-RUN-MERGE-CARRY (claimed in #2570; original item RT-GEOMETRY-READBACK-RUN-MERGE).

What this branch is

  • The author's branch at 82169e0e0, unchanged (no rebase, author commits kept).
  • A merge of main (from the carry preparation of 29/11) that resolves the conflict, then a merge of current main f9f3ec4c6, which had a new conflict (below). Both merge commits carry Co-authored-by the author.
  • Nothing else: the change itself is the original PR's; see #2085 for what and why, and the verifications posted there.

What conflicted and how it was resolved

  • runtime/shims/d3d12_geometry_views.h: main's refresh() (over written_vas_ only) kept; run_needed() looks each tile up in tiles_ and skips dead views (no more Tile* pointers, as qhukz13 asked in the review).
  • New with f9f3ec4c6: runtime/test/geometry_views_test.cpp, header list: main added case 17 (the command-list-epoch guard); the PR's two cases become 18-19 (header and the comments at the cases). d3d12_geometry_views.h merged without conflict over main's epoch-guard change; CI's build and geometry_views run are the check of that.

#2569 (RT-LEAK-SWEEP) lists a textual overlap with #2085 in the same two files.

Tests

  • On this branch (main f9f3ec4c6 merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run).
  • Earlier merge: geometry_views passes, ctest 501; red (main's header): 2 FAIL (the 128 KiB copy and the 1 MiB cap).
  • python -I scripts/check_no_game_data.py on every file this PR changes: clean.
  • CI on this PR covers the rest (C++ build and ctest, the full translator suite).

Depends on: none.

Needs an independent verifier before merge (red/green on another machine), as for any carry.

AI-assisted (Claude Code, oreofr-agent).

🤖 Generated with Claude Code

**@⁠OreoFR** on GitHub · 2026-11-30 13:39 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2733) `OreoFR:carry/pr-2085` → `main` · +68 −1 · 2 files · 4 commits · merged 2026-11-30 16:25 UTC Carries #2085 by @⁠BubsMcgee, because it conflicts with `main` after #2566 and the reminder to merge `main` (https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2085) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped. Item: `RT-GEOMETRY-READBACK-RUN-MERGE-CARRY` (claimed in https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570; original item `RT-GEOMETRY-READBACK-RUN-MERGE`). ### What this branch is - The author's branch at `82169e0e0`, unchanged (no rebase, author commits kept). - A merge of `main` (from the carry preparation of 29/11) that resolves the conflict, then a merge of current `main` `f9f3ec4c6`, which had a new conflict (below). Both merge commits carry `Co-authored-by` the author. - Nothing else: the change itself is the original PR's; see #2085 for what and why, and the verifications posted there. ### What conflicted and how it was resolved - `runtime/shims/d3d12_geometry_views.h`: `main`'s `refresh()` (over `written_vas_` only) kept; `run_needed()` looks each tile up in `tiles_` and skips dead views (no more `Tile*` pointers, as qhukz13 asked in the review). - New with `f9f3ec4c6`: `runtime/test/geometry_views_test.cpp`, header list: `main` added case 17 (the command-list-epoch guard); the PR's two cases become 18-19 (header and the comments at the cases). `d3d12_geometry_views.h` merged without conflict over `main`'s epoch-guard change; CI's build and `geometry_views` run are the check of that. #2569 (RT-LEAK-SWEEP) lists a textual overlap with #2085 in the same two files. ### Tests - On this branch (`main` `f9f3ec4c6` merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run). - Earlier merge: `geometry_views` passes, `ctest` 501; red (`main`'s header): 2 FAIL (the 128 KiB copy and the 1 MiB cap). - `python -I scripts/check_no_game_data.py` on every file this PR changes: clean. - CI on this PR covers the rest (C++ build and `ctest`, the full translator suite). Depends on: none. **Needs an independent verifier before merge** (red/green on another machine), as for any carry. AI-assisted (Claude Code, oreofr-agent). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A GeometryViews refresh reads each written 64 KiB tile with its own
readability probe and guarded copy, even when the title wrote a run of
adjacent tiles across tile boundaries. Group the written tiles (already in
address order) into maximal runs whose addresses differ by one tile and read
each run a ready view needs as one guarded copy; the per-tile pass then reuses
those bytes through read_tile(). A run that cannot be read whole falls back to
the per-tile read, so an uncommitted page still zeroes only what it did before.

Same behaviour as DexNom/VIctory's copy_fetch_runs
(crates/victory-gpu/src/host.rs, GPL-3.0-or-later, commit 570a941),
re-implemented for this header; no identifiers or code copied.

Tested: geometry_views_test 14/14, including the new case (two adjacent written
tiles are one 128 KiB copy); gta6rt_d3d12_com builds. Synthetic only, no game
files or GPU. AI-assisted.
Each refresh now clears written_ and written_vas_ together at the start, so an exception from a read or a guarded copy cannot leave addresses the next refresh indexes past written_. Adjacent-tile runs are capped at 1 MiB (16 tiles), so a long contiguous write cannot force one large scratch resize.
geometry_views: main's written_vas_-only refresh kept; run_needed() looks each tile up again in tiles_ and skips dead views (no Tile* pointers, as qhukz13 asked). Test: main's tests 5-16 plus the PR's two as 17-18.

Co-authored-by: BubsMcgee <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Current main after #2566. New conflict on top of the earlier carry merge:
runtime/test/geometry_views_test.cpp, header list: main added case 17 (the
command-list-epoch guard); the PR's two cases, numbered 17-18 in the earlier
carry merge, become 18-19 (header and the comments at the cases).

Co-authored-by: BubsMcgee <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 13:40:40 +00:00
Author
Owner

@⁠KelboLive on GitHub · 2026-11-30 14:54 UTC · original

Independent check on Windows (not the author), at 696e72877.

  • Configured the branch's runtime and built geometry_views_test (MSVC 14.52.37025, Windows SDK 10.0.26100).
  • Ran it: 89 checks, 0 failures — exit 0, including the new adjacent-run merge cases and the epoch-guard cases.

Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01).

No regressions seen. Based on f9f3ec4c6; a rebase on current main before merge would keep history linear.

AI-assisted: yes (opencode).

**@⁠KelboLive** on GitHub · 2026-11-30 14:54 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2733#issuecomment-7282112527) Independent check on Windows (not the author), at `696e72877`. - Configured the branch's `runtime` and built `geometry_views_test` (MSVC 14.52.37025, Windows SDK 10.0.26100). - Ran it: **89 checks, 0 failures** — exit 0, including the new adjacent-run merge cases and the epoch-guard cases. Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01). No regressions seen. Based on `f9f3ec4c6`; a rebase on current `main` before merge would keep history linear. AI-assisted: yes (opencode).
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-30 15:47 UTC · original

Verified by MoonEyes (another owner than OreoFR) on head 696e72877 merged with main be7690805: Windows 11, MSVC 2022 x64, RelWithDebInfo, RTX 4060 8 GB (NVIDIA). ctest -R ^geometry_views$: 1/1 passed; with d3d12_geometry_views.h of main it fails on "two adjacent written tiles are one 128 KiB copy" and "a 32-tile adjacent run is two 1 MiB copies".

Unit test only: no run of the title (this is the Vulkan path).

AI-assisted (Claude Code).

**@⁠MoonEyes** on GitHub · 2026-11-30 15:47 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2733#issuecomment-7283608213) Verified by MoonEyes (another owner than OreoFR) on head `696e72877` merged with `main` `be7690805`: Windows 11, MSVC 2022 x64, RelWithDebInfo, RTX 4060 8 GB (NVIDIA). `ctest -R ^geometry_views$`: 1/1 passed; with `d3d12_geometry_views.h` of `main` it fails on "two adjacent written tiles are one 128 KiB copy" and "a 32-tile adjacent run is two 1 MiB copies". Unit test only: no run of the title (this is the Vulkan path). AI-assisted (Claude Code).
github manually merged commit 80355d34a8 into main 2026-11-30 16:27:21 +00:00
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-30 16:25 UTC · original · edited 2026-11-30 17:40 UTC

Merging. Head 696e72877 merges cleanly with main bd466f883 and 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, checked by another person too. Merged by MoonEyes.

AI-assisted (Claude Code).

**@⁠MoonEyes** on GitHub · 2026-11-30 16:25 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2733#issuecomment-7284634282) · edited 2026-11-30 17:40 UTC Merging. Head `696e72877` merges cleanly with `main` `bd466f883` and 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, checked by another person too. Merged by MoonEyes. AI-assisted (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/ubiquitarianism--leonida!2733
No description provided.