WIP: feat(perf): trace local frame-state intervals #1625
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1625
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Longshot:codex/issue1518-frame-state"
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: low · Tested on: Windows 11, RTX 4070, NVIDIA 621.01 · Needs: overhead measurements, Linux smoke, current-main rebase
TL;DR
Add an opt-in CSV that separates gameplay frame intervals from menu and decoded-movie activity. An interval with changing or missing state stays outside the gameplay sample.
Breakdown
Why
The existing per-map performance reports cannot distinguish a menu opening and closing within one map. This diagnostic makes the classification available for local testing before considering a field series. Shared frame record · Related dashboard work
What changed
The optional frame-state CSV records whether the game is being played, showing a menu or playing a decoded movie. It also records when the available signals leave an interval uncertain.
frame_state_present()inhost/rx_backend.crecords state before renderer dispatch and keeps the clock-bracket time outside stable-state totals.hos_frame_state_interval()inhost/frame_state.hexcludes mixed boundaries and decoder changes from gameplay. The trace includes the evidence mask and active decoder count.host/hos_main.caccepts the path from a dedicated diagnostic environment.tests/test_frame_state.pycompiles and exercises the sampler and classifiers with synthetic inputs.Measurements
Verdict: The Windows smoke separated stable gameplay, the Insert menu, guest menus, and the decoded title movie. The paired launches used the same build to check diagnostic behavior. Capture overhead remains unmeasured.
Hardware: Windows 11 build 26300, RTX 4070, NVIDIA driver 621.01, Intel Core i7-13700F, 32 GB RAM.
Scene: Title movie, repository Kokiri Forest checkpoint and a teleport to Hyrule Field. 1720 × 720 SDR swapchain, Vulkan mailbox, upscaler off, frame generation off, cap 60, threaded rendering Auto (on).
Method: One windowed capture-off launch and one capture-on launch of
49089983, plus one warmed capture-on launch for Insert. Compared the headers and frame order of the legacy streams and counted classified boundaries and intervals in the sidecar. No speed or overhead statistics were collected.How to reproduce: Start at the title with the
kokiri-startrepository checkpoint andHOS_SKIP_OPENING=0; setHOS_FPS_MAX=60,HOS_PRESENT_TRACE,HOS_PROFILE_DIR,RX_VK_FRAME_TRACE=1andRX_VK_FRAME_LOG. Run withHOS_FRAME_STATE_TRACEunset, then run with it pointing to a fresh CSV. Enter Kokiri Forest, open and close Pause, Items and Insert, then teleport to Hyrule Field. Compare the legacy CSV headers and the sidecar's states.876dc3604908998349089983Flags and settings
One local diagnostic switch.
HOS_FRAME_STATE_TRACE=<csv>Testing
Tested: The paired windowed launches ran exact head
49089983, with separate repository saves cloned for each launch. The capture-on trace recorded 763 stable gameplay intervals, 256 stable guest-menu intervals and 2,309 stable movie intervals. A warmed, windowed run at the same head recorded 360 Insert-menu observations within Kokiri Forest. The first and last crossings were transitions, and gameplay resumed on close. In both captures, each sampled duration plus its uncertain remainder matched the elapsed host time. The linked Windows pack built successfully. The Windows classifier, environment filter, guest-menu, opening, and video producer fixtures passed. All five modified host translation units passed a paired Windows syntax check with no new warnings. The full Windows suite reported 616 passes, 44 failures and 121 skips. All 44 failures also occur on pinned main.44 failures reproduced on pinned main
tests/test_auto_handheld.py,tests/test_bake_ds.py,tests/test_bug_report_defaults.py,tests/test_build_long_paths.py,tests/test_cpu_report.py,tests/test_crash_dialog.py,tests/test_crt_options.py,tests/test_damage_debug_menu.py,tests/test_dev_packs.py,tests/test_discover.py,tests/test_display_startup_failure.py,tests/test_dlss_feature_size.py,tests/test_failed_compile_keeps_objects.py,tests/test_fastfp_fma.py,tests/test_fpx_sticky.py,tests/test_game_menu_mouse_buttons.py,tests/test_guest_imported.py,tests/test_hud_layout_row.py,tests/test_invalidate_quick.py,tests/test_invalidate_vcore.py,tests/test_job_queue.py,tests/test_libc_hooks.py,tests/test_lift_lookups.py,tests/test_linux_preflight.py,tests/test_linux_pressure.py,tests/test_mirror_budget.py,tests/test_missing_nup.py,tests/test_pads_after_menu.py,tests/test_pending_guest_import.py,tests/test_pipeline_play_cache.py,tests/test_present_thread.py,tests/test_profiling_mode.py,tests/test_psychov35_fsr3_fg.py,tests/test_readback_timeout_source.py,tests/test_release.py,tests/test_run_all_changed.py,tests/test_sdiv_overflow.py,tests/test_slow_frames.py,tests/test_spawn_emit.py,tests/test_switch_table.py,tests/test_tested_configurations.py,tests/test_upscaler_rows.py,tests/test_walk_key.py,tests/test_walk.pyNot tested: Linux runtime, decoded mid-map movies, affirmative live
loadinghints, and capture overhead. The scripted Windows map change had no qualifying player-update load hint. The Windows synthetic fixture covers that positive hint.Must be tested:
loadingandmoviesamples while their evidence is fresh (by hand, verify the state and hint bit in the CSV).Risks
What could break: A title, load, or cutscene can lack a qualifying player observation. The CSV records those samples as unknown. An enabled capture performs extra clock reads and buffered file writes.
Turning it off: Leave
HOS_FRAME_STATE_TRACEunset.Compatibility: The existing saves, caches, renderer ABI, pacing controls, and exported metrics retain their current paths.
Issues
See #1518
See #1530 for the field producer boundary.
Checklist
Everyone
feat(perf): trace local frame-state intervals) of the status line's type.main. The reviewed and built head is based on876dc360. Current main is9dff58e6.python -I -B tests/run_all.pypasses apart from the pinned-main failures named in Testing.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.Tested in game: Windows 11 build 26300, RTX 4070, NVIDIA 621.01, windowed Vulkan mailbox at 1720 x 720. On
49089983, the opt-in trace separated Pause, Items and Insert from gameplay in Kokiri Forest and tagged the decoded title movie. Hyrule Field loaded, gameplay resumed, and both paired runs exited cleanly. The three legacy CSV headers matched, and capture off produced no sidecar.Possibly related, for context:
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.