Ideas for features / improvements (performance & quality) #1270

Closed
opened 2026-11-26 08:21:06 +00:00 by JayFoxRox · 4 comments
JayFoxRox commented 2026-11-26 08:21:06 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by JayFoxRox on 2026-11-26T08:21:06Z.


Was keeping notes for myself as I was curious how AI designed this thing.
However, I then noticed some shortcomings.

I was looking into implementing some of this myself, but then noticed a bunch of people were using more powerful AI to do some of this already.
Instead I'm dropping it here and hope someone else (or rather their agent) picks this up, tries to implement these and sends PRs (if deemded useful) or splits this meta-issue into new issues.


Common functionality:

[1] Avoiding guard pages by patching (as in: overwriting with trampoline / emulating) the instruction which tried the write / read.
Instead of the exception, code could itself call a handler (similar to the exception handler).
The page can remain locked, because another view of that same page could be used to finish the actual write (by emulating the behaviour and modifying the destination).

Specific applications:

<!-- greyfinch-sync:fxceless/victory-fork:issue:6622474158 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1273). Originally posted by [JayFoxRox](https://github.com/JayFoxRox) on 2026-11-26T08:21:06Z. --- Was keeping notes for myself as I was curious how AI designed this thing. However, I then noticed some shortcomings. I was looking into implementing some of this myself, but then noticed a bunch of people were using more powerful AI to do some of this already. Instead I'm dropping it here and hope someone else (or rather their agent) picks this up, tries to implement these and sends PRs (if deemded useful) or splits this meta-issue into new issues. --- ### Common functionality: [1] Avoiding guard pages by patching (as in: overwriting with trampoline / emulating) the instruction which tried the write / read. Instead of the exception, code could itself call a handler (similar to the exception handler). The page can remain locked, because another view of that same page could be used to finish the actual write (by emulating the behaviour and modifying the destination). ### Specific applications: - GPU -> CPU pages on change (GPU marks page dirty) https://github.com/fxceless/victory-fork/pull/1014 Clever solution as GPU has free resources apparently. Why not track these writes in the shader as they happen? Which shaders do these writes? Will these resources be moved to system-ram? Could the GPU simply set a flag that a specific page needs to be guarded so the CPU only tries to readback when the page has changed (instead of being downloaded directly). How much of the CPU code is affected by this? It could be using [1] https://github.com/fxceless/victory-fork/issues/1238 ? - CPU -> GPU pages on changes (CPU marks page dirty) Catch page write: https://github.com/fxceless/victory-fork/blob/988aa41608cace81a54923e7d26ff6b561e3cf30/crates/victory-gpu/src/watch.rs#L1838 Upload page [not sure where exactly; might be wrong file?]: https://github.com/fxceless/victory-fork/blob/main/crates/victory-gpu/src/shadow.rs?utm_source=chatgpt.com#L3411-L3487 Lock page again: https://github.com/fxceless/victory-fork/blob/988aa41608cace81a54923e7d26ff6b561e3cf30/crates/victory-gpu/src/watch.rs#L501 If the page exception handler gets triggered to often, this could be fixed by [1] https://github.com/fxceless/victory-fork/issues/1169 ? - DXR 1.1 Only 17 shaders which contain `image_bvh_...` instructions, at least some of them can be trivially made to use DXR 1.1 (tested locally using weak model Gemini 3.8-Flash). https://github.com/xcl-dev/xcl/issues/1751 https://github.com/fxceless/victory-fork/issues/17 - mesa NIR instead direct DXIL target Idea is to port the translator to be RDNA2 -> NIR -> mesa NIR optimized -> NIR -> DXIL. mesa NIR optimizer is probably more powerful than the optimizer in VIctory and it will eventually enable easier ports to SPIR-V / Vulkan. - Resource labels for more powerful debugging Hash the textures/meshes/shaders/.. in resource files to label buffers on GPU upload for debugging. The API is ID3D12Object::SetName().
liuycsbxbxn commented 2026-11-26 14:03:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by liuycsbxbxn on 2026-11-26T13:36:41Z.


Split into six, each with its code pointers and its verification cost, as this issue asked for:

  • #1305 guard-page patching (trampoline / emulate the faulting access) - [GPU][TITLE]
  • #1306 GPU -> CPU: let the GPU mark the pages that need a read-back - [GPU][TITLE]
  • #1307 CPU -> GPU: the write-watch round trip (catch -> upload -> re-lock) - [GPU]
  • #1310 DXR 1.1 for the image_bvh_* node tests - [GPU][TITLE]
  • #1308 Translator: RDNA2 -> NIR -> DXIL, scoped as a spike - [CPU] for translation, [GPU] for output quality
  • #1309 Resource labels: name GPU resources with content hashes - [CPU] plus one capture

[CPU] = needs neither a card nor the title; [GPU] = needs a real card; [TITLE] = needs the game dump.

Of the six, #1309 is the one a contributor can land without hardware; #1308 is deliberately written as a ten-program spike rather than a port, so it can be closed cheaply if the instruction counts do not improve.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7193590606 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1273#issuecomment-7193590606). Originally posted by [liuycsbxbxn](https://github.com/liuycsbxbxn) on 2026-11-26T13:36:41Z. --- Split into six, each with its code pointers and its verification cost, as this issue asked for: - #1305 guard-page patching (trampoline / emulate the faulting access) - `[GPU][TITLE]` - #1306 GPU -> CPU: let the GPU mark the pages that need a read-back - `[GPU][TITLE]` - #1307 CPU -> GPU: the write-watch round trip (catch -> upload -> re-lock) - `[GPU]` - #1310 DXR 1.1 for the `image_bvh_*` node tests - `[GPU][TITLE]` - #1308 Translator: RDNA2 -> NIR -> DXIL, scoped as a spike - `[CPU]` for translation, `[GPU]` for output quality - #1309 Resource labels: name GPU resources with content hashes - `[CPU]` plus one capture `[CPU]` = needs neither a card nor the title; `[GPU]` = needs a real card; `[TITLE]` = needs the game dump. Of the six, #1309 is the one a contributor can land without hardware; #1308 is deliberately written as a ten-program spike rather than a port, so it can be closed cheaply if the instruction counts do not improve.
JayFoxRox commented 2026-11-26 16:35:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by JayFoxRox on 2026-11-26T16:35:04Z.


Thanks for slpitting into issues; I'll close - use the new issues to discuss / implement.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7197835592 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1273#issuecomment-7197835592). Originally posted by [JayFoxRox](https://github.com/JayFoxRox) on 2026-11-26T16:35:04Z. --- Thanks for slpitting into issues; I'll close - use the new issues to discuss / implement.
JayFoxRox commented 2026-11-26 17:56:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by JayFoxRox on 2026-11-26T17:56:16Z.


I also created #1355 for another aspect (potential GPU hasher performance impact) of "GPU -> CPU pages on change (GPU marks page dirty)" which was lost in the existing issues

<!-- greyfinch-sync:fxceless/victory-fork:comment:7199866143 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1273#issuecomment-7199866143). Originally posted by [JayFoxRox](https://github.com/JayFoxRox) on 2026-11-26T17:56:16Z. --- I also created #1355 for another aspect (potential GPU hasher performance impact) of "GPU -> CPU pages on change (GPU marks page dirty)" which was lost in the existing issues
JayFoxRox commented 2026-11-26 18:24:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by JayFoxRox on 2026-11-26T18:24:36Z.


Added #1363 which is similar to #1305

<!-- greyfinch-sync:fxceless/victory-fork:comment:7200429973 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1273#issuecomment-7200429973). Originally posted by [JayFoxRox](https://github.com/JayFoxRox) on 2026-11-26T18:24:36Z. --- Added #1363 which is similar to #1305
Sign in to join this conversation.
No labels
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.

Reference
fxceless/victory-fork#1270
No description provided.