WIP: feat(host): one frame is recorded and played with no game, and the shader preparation survives a shader that faults the driver #1334
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1334
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/trace-replay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: medium · Tested on: Linux, RTX 3090 · Needs: a Windows build and run
Why
M1 and track E of the renderer rework plan: tools. Every renderer change was tested by starting the game and walking to the spot, never the same frame twice; and the shader preparation after a build was all or nothing, so one shader that crashed the driver lost the whole run. This is the one pull request for both; it took in #1386. Stacked on #1309, #1339 and #1354: review the commits after them.
What changed
Read the commits in order; each stands alone.
HOS_RX_TRACE=<file>withHOS_RX_TRACE_AT=<present>, thenlongshot --play-trace <file>.MKWVK_API_VERSIONis 30 (three entries appended to the renderer's interface); the trace format is 4.nx2/prepare_supervisor.py) that names the culprit, quarantines it for that driver version and starts again past it.A trace is made from the game. It never leaves the PC.
docs/development/trace-replay.mdanddocs/development/shader-preparation.mdare new.Measurements
Verdict: a played Kokiri Forest frame differs from the live one by 0.009 of 1 (two live sessions differ by 0.007 to 0.018); the preparation survives forced crashes and a forced hang.
--carryfor timing.5 programs the driver faulted on in earlier runs are not asked of itand played.Testing
Tested:
python -I -B tests/run_all.py: 668 passed, 44 failed, 19 skipped. The suite found two bugs here, both fixed: the supervisor's result totals, and the player not marking pages it zeroes. Onmainat8e9cfc3athis PC has 46 checks failing (648 pass, 19 skipped); none of them is new here.Not tested:
Must be tested:
RX_VK_TEST_PREPARE_FAULT=crash:5000, thenhang:5000; and one record and play (by hand: a trace cannot go to the Test Farm).Risks
What could break: a slow but finite compile is left out; a program is blamed wrongly; recording stops the game for the seconds the snapshot takes.
Turning it off: both tools are off unless asked for;
LONGSHOT_PREPARE_ENTRY_S=0turns the per-entry limit off.Compatibility:
MKWVK_API_VERSION30: the game and the renderer must come from the same build, as always. The preparation's exit code 6 is new.Issues
See #1300
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
Tested in game: Linux, RTX 3090, NVIDIA 620.70: recorded a Kokiri Forest frame and a loading screen, played each 300 to 600 rounds with no game, exit 0; the forest frame plays all 2,686 draws but darker than the live picture (GPU-only state is not in a trace).
c25f89f44c8773f209dcA second commit is on this branch: a played frame is now the live picture.
The first commit's played forest frame was dusk-dark and had no button prompt, because what earlier frames left on the GPU (exposure, the sky's light, shadow maps, things drawn once) was not in a trace. Now the renderer reads every image the GPU wrote back at the snapshot, and the player puts them back before each round with guest memory rewound.
gpu/vk/vk_api.h: three entries appended toMkwVkRenderer(trace_images_capture,trace_image_restore,trace_images_report);MKWVK_API_VERSIONis 30. The trace format is version 4; older traces are refused.RX_VK_ASYNC=0and is refused otherwise.--carrystarts only the first round from the snapshot.Measured (RTX 3090, 1920x1080, Kokiri Forest, present 12000, a live picture five presents earlier):
Not tested: multisampled or sparse images (written without texels, named in the log), an upscaler or frame generation on (their history is not in a trace), Windows, and
tests/run_all.py.docs/development/trace-replay.mdhas all of this.407864c50d6bc46649d3WIP: feat(host): one frame of the renderer's work is recorded to a file and played with no gameto WIP: feat(host): one frame is recorded and played with no game, and the shader preparation survives a shader that faults the driverView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.