native shader cache ignores VICTORY_DEBUG_* and VICTORY_NO_LOCKSTEP: debug switches do nothing on a warm cache #284

Closed
opened 2026-11-27 08:44:31 +00:00 by maaalrey · 3 comments
maaalrey commented 2026-11-27 08:44:31 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by maaalrey on 2026-11-27T08:44:31Z.


The native shader cache keys on the translator's sources, the entry encoding, the loop limit and the translation Options. It doesn't key on the switches the translator reads from the environment while it translates: VICTORY_DEBUG_PS, _PS_RED, _VS_PARAM, _VS_POS, _VS_TRI and VICTORY_NO_LOCKSTEP.

  • On a warm cache those switches silently do nothing. A run with VICTORY_DEBUG_PS_RED=1 VICTORY_DEBUG_VS_TRI=1 translated no shader and left every target black.
  • A translation made with a switch is stored under the normal key and served to later runs without it.

Plan: list the switches next to the translator (TRANSLATION_SWITCHES), hash those that are set into the build key next to the loop limit, and add a test that fails when a new VICTORY_ switch read in emit is in no list. I have it ready.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6643033569 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/284). Originally posted by [maaalrey](https://github.com/maaalrey) on 2026-11-27T08:44:31Z. --- The native shader cache keys on the translator's sources, the entry encoding, the loop limit and the translation `Options`. It doesn't key on the switches the translator reads from the environment while it translates: `VICTORY_DEBUG_PS`, `_PS_RED`, `_VS_PARAM`, `_VS_POS`, `_VS_TRI` and `VICTORY_NO_LOCKSTEP`. - On a warm cache those switches silently do nothing. A run with `VICTORY_DEBUG_PS_RED=1 VICTORY_DEBUG_VS_TRI=1` translated no shader and left every target black. - A translation made with a switch is stored under the normal key and served to later runs without it. Plan: list the switches next to the translator (`TRANSLATION_SWITCHES`), hash those that are set into the build key next to the loop limit, and add a test that fails when a new `VICTORY_` switch read in `emit` is in no list. I have it ready.
maaalrey commented 2026-11-27 08:44:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by maaalrey on 2026-11-27T08:44:41Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213870999 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/284#issuecomment-7213870999). Originally posted by [maaalrey](https://github.com/maaalrey) on 2026-11-27T08:44:41Z. --- /claim
github-actions[bot] commented 2026-11-27 08:44:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T08:44:53Z.


Claimed by @maaalrey. Open a draft pull request with Refs #284 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213874838 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/284#issuecomment-7213874838). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T08:44:53Z. --- Claimed by @maaalrey. Open a draft pull request with `Refs #284` in its description within 24 hours, or the claim expires.
LakshanSivakumar commented 2026-11-27 11:46:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T11:46:03Z.


Fixed by #285, which is merged into main: the shader cache key now includes the translator's environment switches, so a debug switch can no longer be served a shader built without it. Thank you @maaalrey.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7217451019 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/284#issuecomment-7217451019). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T11:46:03Z. --- Fixed by #285, which is merged into main: the shader cache key now includes the translator's environment switches, so a debug switch can no longer be served a shader built without it. Thank you @maaalrey.
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
LakshanSivakumar/Native-Victory-macOS#284
No description provided.