translator: reads of title memory by address share one directory look per block #176

Closed
github-bot wants to merge 0 commits from github-bot/gh-176 into main AGit
Owner

@⁠mahhnameisjeff on GitHub · 2026-12-03 14:30 UTC · original
mahhnameisjeff:main-translator-page-reuse → main · +131 −17 · 3 files · 2 commits · closed without merging

Base: origin/main (d284ef9). Independent of the other PRs from this batch.
The measurements below are from the amd branch (RX 6700 XT); not yet measured on main or on NVIDIA.
origin/main keys cached translations by the translator's source hash, so no version bump is needed: the changed shaders are translated again on their own.

Programs that read title memory by address (the ray-tracing structure
walks above all) looked each address up in the directory, picked the copy's
view, then read: three dependent memory round trips per read, and a record's
fields are read one load each from one pointer. Now:

  • Lower::memory_read: a read whose address register pair a look in the
    same machine block already served reuses that look for lanes whose
    address is in the same 64 KiB page with a copy; other lanes look again
    (in a branch). Emptied at each block.
  • the second half of a 128-byte BVH node reuses the first half's look
    unless the node ends its page.
  • JAXE_PAGE_REUSE=0 (translation listing only, not part of the cache
    key) turns it off, to tell which programs it changes.

Measured on RX 6700 XT, ray tracing on: the two structure-walking programs
37.6 -> 22.2 ms per frame (timing runs, JAXE_GPU_TIMING); frame rate after
the load 10.8-12.6 -> 13.0-13.7 fps; with JAXE_PAGE_REUSE=0 the same build
gave 11.7. Keeping looks across dominated blocks was tried and made both
programs slower (more registers live across their loops): not done.
jaxe-shader tests pass (313); the changed programs validate with dxil.dll
and compile on the card. Of 19,098 known shaders 77 change, all compute.

Related: general GPU-bound reports (#142, #130, #87, #108).

🤖 Generated with Claude Code

**@⁠mahhnameisjeff** on GitHub · 2026-12-03 14:30 UTC · [original](https://github.com/eikkapine/jaxe/pull/176) `mahhnameisjeff:main-translator-page-reuse` → `main` · +131 −17 · 3 files · 2 commits · closed without merging Base: origin/main (d284ef9). Independent of the other PRs from this batch. The measurements below are from the amd branch (RX 6700 XT); not yet measured on main or on NVIDIA. origin/main keys cached translations by the translator's source hash, so no version bump is needed: the changed shaders are translated again on their own. Programs that read title memory by address (the ray-tracing structure walks above all) looked each address up in the directory, picked the copy's view, then read: three dependent memory round trips per read, and a record's fields are read one load each from one pointer. Now: - `Lower::memory_read`: a read whose address register pair a look in the same machine block already served reuses that look for lanes whose address is in the same 64 KiB page with a copy; other lanes look again (in a branch). Emptied at each block. - the second half of a 128-byte BVH node reuses the first half's look unless the node ends its page. - `JAXE_PAGE_REUSE=0` (translation listing only, not part of the cache key) turns it off, to tell which programs it changes. Measured on RX 6700 XT, ray tracing on: the two structure-walking programs 37.6 -> 22.2 ms per frame (timing runs, JAXE_GPU_TIMING); frame rate after the load 10.8-12.6 -> 13.0-13.7 fps; with JAXE_PAGE_REUSE=0 the same build gave 11.7. Keeping looks across dominated blocks was tried and made both programs slower (more registers live across their loops): not done. jaxe-shader tests pass (313); the changed programs validate with dxil.dll and compile on the card. Of 19,098 known shaders 77 change, all compute. Related: general GPU-bound reports (#142, #130, #87, #108). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Base: origin/main (d284ef9). Independent of the other PRs from this batch.
The measurements below are from the amd branch (RX 6700 XT); not yet measured on main or on NVIDIA.
origin/main keys cached translations by the translator's source hash, so no version bump is needed: the changed shaders are translated again on their own.

Programs that read title memory by address (the ray-tracing structure
walks above all) looked each address up in the directory, picked the copy's
view, then read: three dependent memory round trips per read, and a record's
fields are read one load each from one pointer. Now:

- `Lower::memory_read`: a read whose address register pair a look in the
  same machine block already served reuses that look for lanes whose
  address is in the same 64 KiB page with a copy; other lanes look again
  (in a branch). Emptied at each block.
- the second half of a 128-byte BVH node reuses the first half's look
  unless the node ends its page.
- `JAXE_PAGE_REUSE=0` (translation listing only, not part of the cache
  key) turns it off, to tell which programs it changes.

Measured on RX 6700 XT, ray tracing on: the two structure-walking programs
37.6 -> 22.2 ms per frame (timing runs, JAXE_GPU_TIMING); frame rate after
the load 10.8-12.6 -> 13.0-13.7 fps; with JAXE_PAGE_REUSE=0 the same build
gave 11.7. Keeping looks across dominated blocks was tried and made both
programs slower (more registers live across their loops): not done.
jaxe-shader tests pass (313); the changed programs validate with dxil.dll
and compile on the card. Of 19,098 known shaders 77 change, all compute.

Related: general GPU-bound reports (#142, #130, #87, #108).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 14:36:02 +00:00
github-bot closed this pull request 2026-12-04 12:28:03 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.