Skip to content

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

Merged
MoonEyes merged 4 commits into
ProjectLeonida:mainfrom
OreoFR:carry/pr-2085
Nov 30, 2026
Merged

MoonEyes merged 4 commits into
ProjectLeonida:mainfrom
OreoFR:carry/pr-2085

Conversation

@OreoFR

@OreoFR OreoFR commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Carries #2085 by @BubsMcgee, because it conflicts with main after #2566 and the reminder to merge main (#2085 (comment)) 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 (comment); original item RT-GEOMETRY-READBACK-RUN-MERGE).

What this branch is

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

BubsMcgee and others added 4 commits November 25, 2026 14:50
…T-GEOMETRY-READBACK-RUN-MERGE)

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.
… 1 MiB

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 <203599835+BubsMcgee@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Current main after ProjectLeonida#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 <203599835+BubsMcgee@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KelboLive

Copy link
Copy Markdown

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).

@MoonEyes

Copy link
Copy Markdown
Collaborator

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

MoonEyes commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

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
MoonEyes merged commit 80355d3 into ProjectLeonida:main Nov 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants