Faster test loop: live switches, replay image gate, shader hot reload (optional agent on top) #1150

Closed
opened 2026-11-28 14:34:28 +00:00 by github-bot · 2 comments
Owner

@⁠yoysefA on GitHub · 2026-11-28 14:19 UTC · original

Summary

Each test today means: change a switch (the F1 menu restarts the title) or the
code, reload the save, wait for shaders and streaming, compare by eye, repeat.
This proposes tooling that keeps the title running for most of that loop and,
optionally, lets 1–2 AI agents observe and propose changes checked by an
evaluator they cannot modify. Each phase is useful on its own.

I can't run in-game tests myself, but I can help with the design and the
external tooling, and run cargo test on an RX 9060 XT (RDNA 4).

  • #1129 proposes standardized diagnostic reports from test sessions. This proposal
    is complementary: Phase 1's live channel could feed those reports, and Phases 2–3
    add what a report can't do: checking a change against a recorded frame and
    applying shader fixes without restarting.
  • #1053 (agent guidelines) and #1009 (offscreen window mode) would make the
    optional Phase 4 loop easier to run.

Phase 1: live metrics and switches

  • Expose the numbers the F3 panel already has (frame time, VRAM, pending
    uploads/pipelines, dropped draws, readback bytes) through a shared-memory
    ring buffer written once per frame. Cost: one copy per frame, no locks.
  • A small command ring read at the start of the next frame: change switches that
    are safe to change mid-session without the F1 restart, and trigger
    VICTORY_RECORD for the next frame.
  • An external tool reads it: graphs, and A/B of a switch in the same scene
    without restarting.

Phase 2: replay image gate

  • Use the existing record/replay (crates/victory-gpu/src/replay) to replay a
    captured frame before and after a change, comparing output images (SSIM or
    per-pixel diff) and per-pass GPU times.
  • Accept a change only if cargo test passes, the image matches the reference
    within a threshold, and timing improves over several runs. This catches
    "faster because it stopped drawing" (black or magenta materials, missing objects).
  • Captures stay local (asset policy). Only metrics and pass/fail are shared.

Phase 3: shader hot reload

  • Re-translate a shader with the current translator, recreate the pipelines
    that use it, and swap them at a frame boundary without restarting.
  • Many visual bugs live in shader translation, so they could be fixed and
    checked in-session.
  • Core changes (memory, texture residency, upload queues) still need a rebuild
    and restart; they get checked in replay first.

Phase 4 (optional): agent loop on top of 1–3

  • One agent watches the Phase 1 channel, records a frame when a metric or image
    check fails, and writes a short report.
  • A second agent proposes a fix: a live switch or shader change applied
    in-session, or a core change queued for the next rebuild.
  • The Phase 2 gate decides; a human reviews before any PR.
  • The agents must not be able to edit the gate, the tests or how timing and
    images are measured.

Precedents

  • DeepMind's AlphaEvolve: LLM-generated changes accepted only by automated
    evaluators; Google's guidance uses SSIM so loops can't win by skipping rendering.
  • Agentic debugging of a WebGPU shader stack (PLDI 2026, llama.cpp port).
  • Known failure mode: AI optimizers gaming their benchmark (Sakana's AI CUDA
    Engineer, METR reports). This is why the gate sits outside the agent's reach.

Questions

  1. Would a small Phase 1 PR (metrics ring + a reader) be welcome?
  2. Which switches are safe to change mid-session, without the F1 restart?
  3. Is anyone already working on shader hot reload or replay image comparison?
**@⁠yoysefA** on GitHub · 2026-11-28 14:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1150) ## Summary Each test today means: change a switch (the F1 menu restarts the title) or the code, reload the save, wait for shaders and streaming, compare by eye, repeat. This proposes tooling that keeps the title running for most of that loop and, optionally, lets 1–2 AI agents observe and propose changes checked by an evaluator they cannot modify. Each phase is useful on its own. I can't run in-game tests myself, but I can help with the design and the external tooling, and run `cargo test` on an RX 9060 XT (RDNA 4). ## Related - #1129 proposes standardized diagnostic reports from test sessions. This proposal is complementary: Phase 1's live channel could feed those reports, and Phases 2–3 add what a report can't do: checking a change against a recorded frame and applying shader fixes without restarting. - #1053 (agent guidelines) and #1009 (offscreen window mode) would make the optional Phase 4 loop easier to run. ## Phase 1: live metrics and switches - Expose the numbers the F3 panel already has (frame time, VRAM, pending uploads/pipelines, dropped draws, readback bytes) through a shared-memory ring buffer written once per frame. Cost: one copy per frame, no locks. - A small command ring read at the start of the next frame: change switches that are safe to change mid-session without the F1 restart, and trigger `VICTORY_RECORD` for the next frame. - An external tool reads it: graphs, and A/B of a switch in the same scene without restarting. ## Phase 2: replay image gate - Use the existing record/replay (`crates/victory-gpu/src/replay`) to replay a captured frame before and after a change, comparing output images (SSIM or per-pixel diff) and per-pass GPU times. - Accept a change only if `cargo test` passes, the image matches the reference within a threshold, and timing improves over several runs. This catches "faster because it stopped drawing" (black or magenta materials, missing objects). - Captures stay local (asset policy). Only metrics and pass/fail are shared. ## Phase 3: shader hot reload - Re-translate a shader with the current translator, recreate the pipelines that use it, and swap them at a frame boundary without restarting. - Many visual bugs live in shader translation, so they could be fixed and checked in-session. - Core changes (memory, texture residency, upload queues) still need a rebuild and restart; they get checked in replay first. ## Phase 4 (optional): agent loop on top of 1–3 - One agent watches the Phase 1 channel, records a frame when a metric or image check fails, and writes a short report. - A second agent proposes a fix: a live switch or shader change applied in-session, or a core change queued for the next rebuild. - The Phase 2 gate decides; a human reviews before any PR. - The agents must not be able to edit the gate, the tests or how timing and images are measured. ## Precedents - DeepMind's AlphaEvolve: LLM-generated changes accepted only by automated evaluators; Google's guidance uses SSIM so loops can't win by skipping rendering. - Agentic debugging of a WebGPU shader stack (PLDI 2026, llama.cpp port). - Known failure mode: AI optimizers gaming their benchmark (Sakana's AI CUDA Engineer, METR reports). This is why the gate sits outside the agent's reach. ## Questions 1. Would a small Phase 1 PR (metrics ring + a reader) be welcome? 2. Which switches are safe to change mid-session, without the F1 restart? 3. Is anyone already working on shader hot reload or replay image comparison?
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:34:28 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 14:19 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-28 14:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1150#issuecomment-7240588275) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
github-bot changed title from [Proposal] Faster test loop: live switches, replay image gate, shader hot reload (optional agent on top) to Faster test loop: live switches, replay image gate, shader hot reload (optional agent on top) 2026-11-28 21:37:31 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-30 15:47 UTC · original

Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is v2026.11.30.01.

If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run:

  1. The play log: the newest victory-nvidia-play-<date>-<time>-<number>.log in %LOCALAPPDATA%\victory\logs\.
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, plus the newest .crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\ if there is one from that run.
**@⁠trustno1-coder** on GitHub · 2026-11-30 15:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1150#issuecomment-7283601355) Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is [v2026.11.30.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.30.01). If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run: 1. The play log: the newest `victory-nvidia-play-<date>-<time>-<number>.log` in `%LOCALAPPDATA%\victory\logs\`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, plus the newest `.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\` if there is one from that run.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#1150
No description provided.