Skip to content

Port upstream world-unblock chain (PRs #1127, #1122, #1215, #1198) - #2

Merged
devin-ai-integration[bot] merged 13 commits into
mainfrom
devin/world-unblock
Nov 24, 2026
Merged

devin-ai-integration[bot] merged 13 commits into
mainfrom
devin/world-unblock

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Second upstream port wave — the world-rendering blockers, merged into the fork with semantic conflicts resolved. All merges applied cleanly; one test-integration fix was needed.

Upstream PRs ported

Fork-side fixes

  • emit/mod.rs: HostShader test initializer now sets address_map: false / descriptor_words: false (new required fields).
  • watch.rs tests: guard(a, a + BLOCK) calls updated to the 3-arg signature (known_mapped = true — the test views are known mapped).

Testing

  • cargo test --workspace --locked --target x86_64-pc-windows-msvc: all pass except the 15 victory-shader emit tests that require an SM 6.6 GPU/WARP device — identical failures on main (no GPU on this machine).
  • cargo clippy --workspace --all-targets --locked -D warnings: clean.

Link to Devin session: https://app.devin.ai/sessions/39a24dfe2c184165b42b2108a96286b6
Open in Devin Desktop: https://app.devin.ai/desktop/session/39a24dfe2c184165b42b2108a96286b6?variant=devin
Requested by: @Personed

tightfall and others added 11 commits November 24, 2026 15:52
…ll its views

The title writes physical pages through one view (a pool) while the GPU
reads them through another (map_alias). A read-only guard on one view did
not see writes through the other, so its host copy kept what it first
took (seen as stale mesh data in the world, before the page faults).
xmem keeps an index of the views showing each physical page; guarding a
block also guards its aliases, and a write to one opens them all. Only
blocks with guarded aliases are looked up on a write, so a huge kernel
write range costs no more than before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tersection

- An access whose address traces to no root parameter but which the
  program computes (a pointer it loads, picks or builds) now goes through
  an address map instead of failing: the host copies of title memory
  sorted by address, searched in the shader, then read or written
  through a raw view in the heap. Loads, stores and 32-bit atomics,
  scalar and vector. An address in an SGPR the hardware fills (the spill
  table) is still refused.
- image_bvh_intersect_ray and image_bvh64_intersect_ray are emulated: the
  node is read through the map and tested as Microsoft's software model
  of the instruction does (SoftwareBvhIntersectRay in the XDXR traversal
  headers): box16 and box32 nodes with sorting, the four triangles of a
  leaf with the watertight edge rules, both triangle return modes.
- A descriptor the program reads as numbers (a buffer's address, an
  acceleration structure's location) reads the console words of the view
  heap's slot from a copy the host keeps, 32 bytes a slot.

HostShader gets address_map and descriptor_words; the shader cache format
moves to VSH2.
- The address map lists the host copies of title memory made so far,
  each through raw views in dynamic slots of the list's view heap, cut
  where copies overlap (the innermost wins, as shadow::find picks) and at
  512 MiB. It is made once per list and view heap; the copies it lists
  are brought up to date when the list is submitted.
- Each view heap keeps the console words of its slots: buffer views,
  constant buffers and acceleration structures as buffer descriptors at
  their title address, written whenever a slot is made.
- Pipelines get the two root SRVs their shaders ask for; a draw or
  dispatch that cannot have them is dropped.

What shaders write through the map stays in the host copies.
…py into the title, VICTORY_PROFILE

WriteProcessMemory asks the kernel about the destination region first
(NtQueryVirtualMemory, about 2 ms a call in the title's big pools), so the
copy back after a world submission spent over a second there. write_mapped
now calls NtWriteVirtualMemory directly (falls back to WriteProcessMemory if
the symbol is missing) and reports an unmapped page the same way.

copy_mapped no longer calls VirtualQuery before copying into title memory;
the check runs only after the first attempt failed, so a copy into fully
mapped memory costs one call.

Diagnostics only: VICTORY_PROFILE=<ms> samples every thread's stack and
prints the hottest ones every 5 s.

Measured (i7-13700KF, RTX 4070 Super, world stage, DRED off): copy back of
one frame 1.5 s -> 0.13 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwHrL6fhkpeG9ByE1rJxrt
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Personed and others added 2 commits November 24, 2026 17:24
…ndows))

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot merged commit 4115d3b into main Nov 24, 2026
4 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