docs(debt): measure NaN texel bits through sampling and gathers on RDNA2 and NVIDIA #22727

Merged
MichonGoddijn231849 merged 1 commit from upstream-pr/22727 into main 2026-11-18 06:18:06 +00:00
MichonGoddijn231849 commented 2026-11-18 05:37:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-11-18T05:37:01Z.


What

A debt entry records how NaN texels come back through the sampler on RDNA2 and through AnyPS5 on NVIDIA, which differ:

  • image_sample_lz (point filter) on RDNA2 returns the canonical 0xffc00000 for any NaN texel. AnyPS5 on NVIDIA returns the texel's own NaN.
  • image_gather4 on RDNA2 returns the texel's NaN bit for bit. AnyPS5 on NVIDIA returns one canonical NaN for every NaN texel (0x7fffffff for 32_FLOAT, 0x7fffe000 for 16_FLOAT).
  • image_load agrees everywhere, and AnyPS5 on the AMD GPU matches the hardware for all three.

Only docs/dev/debt/changes/docs-nvidia-sampled-nan-texels.md is added; no code changes.

Measurement: tools/hw-oracle with the default (hardware) runtime and the vulkan runtime (agc_oracle_runner), on an 8×1 2D texture with one texel per lane. The 16_FLOAT texels were 0x7c01, 0xfdee, 0x7e00, 0xfe00, 0x7fff, 0x7d23, -inf and 1.0. The 32_FLOAT texels were 0x7f800001, 0xffbfffff, 0x7fc00000, 0xffc00000, 0x7fffffff, 0x7fa46000, -inf and 1.0. Each was read by image_load, by image_sample_lz with a point sampler at the texel centre, and by image_gather4 (DMASK 0x1). For 16_FLOAT:

image_load image_sample_lz image_gather4
gfx1036 hardware 0x7f802000, 0xffbdc000, 0x7fc00000, 0xffc00000, 0x7fffe000, 0x7fa46000 0xffc00000 ×6 same as the load
AnyPS5, AMD gfx1036 same as hardware same as hardware same as hardware
AnyPS5, NVIDIA RTX 5080 (610.74) same as hardware same as the load 0x7fffe000 ×6

32_FLOAT gives the same split, with NVIDIA's gather returning 0x7fffffff. -inf and 1.0 agree in every cell. The difference first showed in a differential image_gather4 sweep over formats, swizzles and masks, where it was the only NVIDIA-only difference.

Tested

Windows 11 Pro 10.0.26200; NVIDIA GeForce RTX 5080 (driver 610.74) and AMD Radeon(TM) Graphics (RDNA2 iGPU, gfx1036, driver 32.0.21045.16010), AnyPS5 at main. The fragment passes tools/debt_fold.py --check and tools/check_conventions.py. Not tested on a PS5.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 610.74, Windows 11 Pro 10.0.26200; AMD Radeon(TM) Graphics (RDNA2 iGPU, gfx1036), driver 32.0.21045.16010, Windows 11 Pro 10.0.26200
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5370576847 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22727). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-11-18T05:37:01Z. --- ### What A debt entry records how NaN texels come back through the sampler on RDNA2 and through AnyPS5 on NVIDIA, which differ: - `image_sample_lz` (point filter) on RDNA2 returns the canonical `0xffc00000` for any NaN texel. AnyPS5 on NVIDIA returns the texel's own NaN. - `image_gather4` on RDNA2 returns the texel's NaN bit for bit. AnyPS5 on NVIDIA returns one canonical NaN for every NaN texel (`0x7fffffff` for 32_FLOAT, `0x7fffe000` for 16_FLOAT). - `image_load` agrees everywhere, and AnyPS5 on the AMD GPU matches the hardware for all three. Only `docs/dev/debt/changes/docs-nvidia-sampled-nan-texels.md` is added; no code changes. **Measurement:** `tools/hw-oracle` with the default (hardware) runtime and the `vulkan` runtime (`agc_oracle_runner`), on an 8×1 2D texture with one texel per lane. The 16_FLOAT texels were 0x7c01, 0xfdee, 0x7e00, 0xfe00, 0x7fff, 0x7d23, -inf and 1.0. The 32_FLOAT texels were 0x7f800001, 0xffbfffff, 0x7fc00000, 0xffc00000, 0x7fffffff, 0x7fa46000, -inf and 1.0. Each was read by `image_load`, by `image_sample_lz` with a point sampler at the texel centre, and by `image_gather4` (DMASK 0x1). For 16_FLOAT: | | `image_load` | `image_sample_lz` | `image_gather4` | | --- | --- | --- | --- | | gfx1036 hardware | 0x7f802000, 0xffbdc000, 0x7fc00000, 0xffc00000, 0x7fffe000, 0x7fa46000 | 0xffc00000 ×6 | same as the load | | AnyPS5, AMD gfx1036 | same as hardware | same as hardware | same as hardware | | AnyPS5, NVIDIA RTX 5080 (610.74) | same as hardware | same as the load | 0x7fffe000 ×6 | 32_FLOAT gives the same split, with NVIDIA's gather returning 0x7fffffff. -inf and 1.0 agree in every cell. The difference first showed in a differential `image_gather4` sweep over formats, swizzles and masks, where it was the only NVIDIA-only difference. ### Tested Windows 11 Pro 10.0.26200; NVIDIA GeForce RTX 5080 (driver 610.74) and AMD Radeon(TM) Graphics (RDNA2 iGPU, gfx1036, driver 32.0.21045.16010), AnyPS5 at `main`. The fragment passes `tools/debt_fold.py --check` and `tools/check_conventions.py`. Not tested on a PS5. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 5080, driver 610.74, Windows 11 Pro 10.0.26200; AMD Radeon(TM) Graphics (RDNA2 iGPU, gfx1036), driver 32.0.21045.16010, Windows 11 Pro 10.0.26200 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-18 05:51:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T05:51:04Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this documentation change; the measured distinctions are clearly scoped to the listed GPUs, drivers, and operations.

What I ran

Reviewed head 6e70a2fec75109688cddc5341e2d8468ba0280e0. I did not run commands or tests; this change adds only a debt entry.

Results

Check Result Note
Changed file review passed One added debt entry
Tests and conventions not run Not independently checked

Findings

Blocking

None.

Non-blocking

None.

Not verified

I read docs/dev/debt/changes/docs-nvidia-sampled-nan-texels.md and the provided description, commit summary, manifest, and diff. The measurement results and author-reported checks were not independently verified. The description says tools/debt_fold.py --check and tools/check_conventions.py passed; I did not run them. No other changed files were listed in the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5951453000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22727#pullrequestreview-5951453000). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T05:51:04Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this documentation change; the measured distinctions are clearly scoped to the listed GPUs, drivers, and operations. ## What I ran Reviewed head `6e70a2fec75109688cddc5341e2d8468ba0280e0`. I did not run commands or tests; this change adds only a debt entry. ## Results | Check | Result | Note | | --- | --- | --- | | Changed file review | passed | One added debt entry | | Tests and conventions | not run | Not independently checked | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I read `docs/dev/debt/changes/docs-nvidia-sampled-nan-texels.md` and the provided description, commit summary, manifest, and diff. The measurement results and author-reported checks were not independently verified. The description says `tools/debt_fold.py --check` and `tools/check_conventions.py` passed; I did not run them. No other changed files were listed in the manifest. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
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
boykopovar/AnyPS5!22727
No description provided.