shader: preserve scalar size bounds with wide loads #160

Closed
opened 2026-11-27 19:04:50 +00:00 by krofty · 2 comments
krofty commented 2026-11-27 19:04:50 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by krofty on 2026-11-27T19:04:50Z.


The opt-in WIDE scalar-buffer load lowering also takes count-one loads through its early-return path. That bypasses the existing default-on structure-size safety clamp for spilled-root reads at offset four.

Keep count-one loads on the existing scalar path; vectorize only multi-DWORD loads. This preserves scalar safety handling while retaining x4/x8/x16 vectorization.

Acceptance:

  • Preserve the scalar size clamp when WIDE is enabled.
  • Run the existing software-GPU scalar-buffer boundary regression with option masks 63 and 127, confirming actual dispatches rather than a skipped adapter.
  • Keep wave semantics, resource declarations and partial-resource-end behavior unchanged.
  • Validate before evaluating vectorized loads on NVIDIA, without changing output resolution or DLSS quality.

Claim: Codex / krofty will implement this isolated fix on its own branch. This supports the performance work at Snaacky/ztrx#249; it does not modify Snaacky's raw-pixel decoding or LDS work. PR stays open and unmerged. No performance gain is assumed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6652902968 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/160). Originally posted by [krofty](https://github.com/krofty) on 2026-11-27T19:04:50Z. --- The opt-in WIDE scalar-buffer load lowering also takes count-one loads through its early-return path. That bypasses the existing default-on structure-size safety clamp for spilled-root reads at offset four. Keep count-one loads on the existing scalar path; vectorize only multi-DWORD loads. This preserves scalar safety handling while retaining x4/x8/x16 vectorization. Acceptance: - Preserve the scalar size clamp when WIDE is enabled. - Run the existing software-GPU scalar-buffer boundary regression with option masks 63 and 127, confirming actual dispatches rather than a skipped adapter. - Keep wave semantics, resource declarations and partial-resource-end behavior unchanged. - Validate before evaluating vectorized loads on NVIDIA, without changing output resolution or DLSS quality. Claim: Codex / krofty will implement this isolated fix on its own branch. This supports the performance work at Snaacky/ztrx#249; it does not modify Snaacky's raw-pixel decoding or LDS work. PR stays open and unmerged. No performance gain is assumed.
krofty commented 2026-11-27 19:18:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by krofty on 2026-11-27T19:18:56Z.


Implemented in PR #177. Existing software-GPU boundary regression executed six actual dispatches under each option mask (63 and 127); all passed. Diagnostics build 294 passed via build.sh. Scalar clamp retention checked by source inspection. Releasing implementation claim; PR open and unmerged. No performance gain claimed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7226404720 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/160#issuecomment-7226404720). Originally posted by [krofty](https://github.com/krofty) on 2026-11-27T19:18:56Z. --- Implemented in PR #177. Existing software-GPU boundary regression executed six actual dispatches under each option mask (63 and 127); all passed. Diagnostics build 294 passed via build.sh. Scalar clamp retention checked by source inspection. Releasing implementation claim; PR open and unmerged. No performance gain claimed.
trustno1-coder commented 2026-11-27 21:08:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-27T21:08:28Z.


Thanks. This is implemented in PR #177, so the change is tracked there now. Closing the issue to keep one place for it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7228172182 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/160#issuecomment-7228172182). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-27T21:08:28Z. --- Thanks. This is implemented in PR #177, so the change is tracked there now. Closing the issue to keep one place for it.
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
trustno1-coder/VIctory-NVIDIA#160
No description provided.