No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2797
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/dev-tools-organized-logs"
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?
Summary
dev.py ab(mise run dev -- ab) can't measure on currentmain, for three reasons, all met in one A/B. This pull request fixes all three, and supersedes #2186 and #2443, whose authors found and fixed two of them first. Their work is here as they wrote it:HOS_CONTROLfix. Its commit is here unchanged, with dyst as its author.Co-authored-by: Cal.I had written the same two fixes myself before I found theirs. My versions were close to theirs (the same
RUN_ONLYchange; the same move of the menu read to after the warm-up), and theirs went further (the check thatHOS_CONTROL_MEMis still compared; the unready rows), so theirs are what this pull request carries. The only edits to their commits are the conflicts with currentmain: an adjacent line inRUN_ONLY, and a mock ofpacks.runtime_romfs, whichmainno longer has. Mine on top: the trace path,update --logs, the measured window starting at the menu read on the trace's own clock, andHOS_CONTROLcompared as on or off (from the reviews).data/image.bin) writes its logs and traces indiagnostics/logs/and its crash records indiagnostics/bug-reports/(gpu/vk/vk_paths.hlog_path,game/game_layout.c).abstill read the frame trace fromlogs/: every timing run warmed up for the whole 120 s, measured nothing, and failedno frame trace at …\logs\longshot_frames.csv (RX_VK_FRAME_TRACE)while the trace sat indiagnostics/logs/.dev.py update --logszipped neither folder. It now takes both places, since a folder built flat before a later build organized it keeps its older records at the top level. What it takes from them ismain's rule unchanged: the logs folder with the frame log, neverlocal-only/or aprofile-*folder.common.organized_gameandcommon.game_diagnosticsfollow the game's own rule.HOS_CONTROL, dyst's fix from #2186. The control bridge's socket has a new name every run, andabcompared it as a setting. dyst's commit leftHOS_CONTROLout of the comparison (RUN_ONLY); after futondestroyer's review it is compared as on or off (ON_OR_OFF), so a run with the bridge and one without still differ, and its name doesn't count.HOS_CONTROL_MEMandHOS_CONTROL_PEER_SIDare compared as they are.at_nsishos_now_ns(QueryPerformanceCounteron Windows,CLOCK_MONOTONICelsewhere), whichtime.perf_counter_nsreads too. It waits for a frame from after the read, takes none from before it however late it was written, and refuses a trace on another clock.The help of
perf.py abandprofiling/ab.pynames both trace locations.Fixes #2349.
To see it on
main:mise run dev -- ab --scene kokiri-forestwith any switch. Every run fails "no frame trace"; with the trace there, the write-up is refused forHOS_CONTROLand, in some runs, for the turf rows.Read first:
game_diagnosticsinscripts/devtools/common.py, thenrun_one,what_ran,differences,RUN_ONLYandON_OR_OFFinscripts/devtools/ab.py, andgather_logsinscripts/devtools/update.py.Testing
Tested: Windows 11 (build 26300), RTX 5080 (NVIDIA 621.40). A switch A/B (
mise run dev -- ab --env RX_VK_EARLY_FRAGMENT_TESTS=0) for #2796 in four scenes, 6 timing runs each.main'sab: all 6 Kokiri Forest runs failed "no frame trace".A1: 9521 frames in 60 s, 158.7 fps, median 6.20 ms, p99 7.95 ms, 1% low 125.8 fps, 0 cold frames). The write-up was then refused forHOS_CONTROLand the turf rows, which the commits from #2186 and #2443 here fix.Checks (
mise run test -- --exact tests/test_dev_ab.py tests/test_dev_update.py):test_run_reads_the_trace_where_the_game_writes_it,test_logs_organized,test_logs_both_layouts,test_run_measures_from_after_the_menu_read(now with a late batch of frames from before the read) andtest_run_refuses_a_trace_on_another_clockeach fail without their fix and pass here, as do #2186'stest_run_only_switches_not_compared(now also: a run without the bridge differs) and #2443'stest_unready_area_rows_not_comparedwith theirs.time.perf_counter_ns()reads the game's clock on this PC: aQueryPerformanceCounterread between two of its calls fell between them (10 MHz, Python 3.12.15).tests/test_dev_ab.pypasses;tests/test_dev_update.pyfails onlytest_build_command, as onmain.mainas here, and pass in CI:test_in_run_report_keeps_hitch_rates(the Windows console's cp1252 can't print "Δ") andtest_build_command(this PC's own dev settings).mise run test-changedon this branch onmain@f14a5664d(it is now on01539efd2, one commit, #2790, the profiler's stack walk, later): 12 passed, 5 failed, the same 5 failing the same way onmain(test_dev_ab.pyandtest_dev_update.pyfor the two above,test_dev_migrate.py,test_job_queue.pyandtest_hos_ab.py, all Windows-only here); none is new.mise run lintpasses.mise run test(llvm-mingw on PATH,CC=clang,CXX=clang++): 625 passed, 224 failed, 46 skipped, the same 224 as onmain@01d6878b3(tools this PC lacks: gcc, glslang, spirv-val and others); none new. (Run on the first version of this branch; the commits since change onlyscripts/devtools/ab.py,update.pyand their two checks, all run above.)Still to test:
mise run dev -- ab --env RX_VK_X=0 --scene market --dry-run, then a short real run (--runs 2 --seconds 20), expecting every run to measure (its frames, fps, median, p99 and 1% low line); and a write-up with Measurements at the end (by hand).Measurements
Nothing to measure: a development tool. It is what makes the measurements of the fence pull request possible.
Risks
data/image.bin) is read as before.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11 (build 26300), RTX 5080, NVIDIA 621.40: mise run dev -- ab --env RX_VK_EARLY_FRAGMENT_TESTS=0 for #2796 in Kokiri Forest, Hyrule Field, Inside the Deku Tree and the Market, 6 timing runs each through the job queue. On main's ab all 6 Kokiri Forest runs failed 'no frame trace'; with the trace fix all 24 runs measured, each with its frames, fps, median, p99 and 1% low line. The write-up was then refused for HOS_CONTROL and the turf rows read before the area loaded, which the other two fixes address (checked by the game-free checks).
WIP: fix(dev): dev.py ab measures again on main: the frame trace in diagnostics/logs, HOS_CONTROL not compared, the menu read after the warm-upto fix(dev): dev.py ab measures again on main: the frame trace in diagnostics/logs, HOS_CONTROL not compared, the menu read after the warm-upPossibly related, for context:
@review
Recommendation: Request changes. The later menu query can fall inside the frame window reported as the measurement, and log collection can omit records left in the old layout after an upgrade.
The change finds traces and diagnostics in organized game folders, excludes the bridge’s per-session channel from comparisons, and reads menu values later. Those fixes make the A/B tool more useful, but the measurement boundary and mixed-layout log collection need correction.
Blocking (2): must change before merging.
scripts/devtools/ab.py:706: The menu query now occurs immediately before selecting the last visible trace row as the measurement start, but the trace is buffered. (more on the line) Do: After reading the menu, wait for a trace boundary known to be later than the query before selecting the measurement start; cover the buffered-trace case in the test.CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 15s.Should fix (1): not blocking, but worth doing before merging.
scripts/devtools/update.py:391: An organized folder is searched only under diagnostics, so records remaining in the old top-level folders are omitted. (more on the line) Do: Collect eligible files from both locations when they exist, retaining the exclusions and limits, and test a folder containing both layouts.@fixcan do L1, L2 and L3.Checks: Still running: 4 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes, partially: the author reports that all 6 Kokiri Forest runs failed to find a trace on main, while 24 runs across four scenes measured with the trace fix. The complete write-up has not yet been demonstrated in a real run after the other two fixes.
Other systems: The changes affect developer A/B runs and diagnostic archives on Windows and Linux, not game runtime code. Windows supplied the reported game runs; the described Linux run and a complete A/B write-up remain outstanding.
Switches: No switches added, changed, or removed. HOS_CONTROL is excluded from A/B setting comparisons because its endpoint changes each session.
Reviewed:
9132d5b2f7against01d6878b3f: Read the repository rules, PR template, diff, commit messages, changed helper and relevant A/B and log-collection paths, renderer trace writer, game layout, bridge and menu callers. Skimmed the remaining portions of the larger changed files and tests; the sibling Tooling AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run, as requested. The author reports game-free checks for the fixes and Windows trace runs; Linux and a complete real A/B write-up remain to be tested.
Overlaps and merge order: Not checked; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -703,1 +703,4 @@break# (what ran, as the menu has it now, the area loaded: right after the teleport the simulated-turf rows still said# "Load an area" in some runs and not in others)status = g.must("status")L1 (blocking): The menu query now occurs immediately before selecting the last visible trace row as the measurement start, but the trace is buffered. The selected row can predate the query.
When: When option_get runs after the latest flushed trace row, frames produced during the query are subsequently included in the measured window. The query enumerates menu settings under the menu lock, so its work or contention can appear as a frame-time outlier in the reported A/B results.
Do: After reading the menu, wait for a trace boundary known to be later than the query before selecting the measurement start; cover the buffered-trace case in the test.
@ -388,2 +389,3 @@for rel, newest, max_mb in LOG_PARTS:p = os.path.join(game, *rel.split("/"))# (the logs and crash records: in diagnostics/ in a folder longshot-builder organized)p = common.game_diagnostics(game, rel) if rel in DIAGNOSTICS else os.path.join(game, *rel.split("/"))L2 (should fix): An organized folder is searched only under diagnostics, so records remaining in the old top-level folders are omitted.
When: After a flat game folder with logs or crash records is rebuilt into the organized layout, data/image.bin selects diagnostics even if older records remain in logs/ or bug-reports/. The archive no longer includes those records, although the previous collector did.
Do: Collect eligible files from both locations when they exist, retaining the exclusions and limits, and test a folder containing both layouts.
9132d5b2f7072be5e230fix(dev): dev.py ab measures again on main: the frame trace in diagnostics/logs, HOS_CONTROL not compared, the menu read after the warm-upto fix(dev): dev.py ab and update --logs find the game's logs in diagnostics/, as an organized game folder writes themThanks, and for the overlaps: #2186 already fixes
HOS_CONTROLand #2443 the menu read, so this pull request no longer does either. The branch is cut back to the trace path andupdate --logs(force-pushed), and the description points to both.--logstakeslogs/andbug-reports/at the top level and indiagnostics/, each with its own limits, the minidumps and profiles still left out.test_logs_both_layoutsfails without it and passes with it.main's, since #2785; #2793 fixes it.check_guide_screenshots.py --review-sourcesfails onmain@01d6878b3exactly as here.fix(dev): dev.py ab and update --logs find the game's logs in diagnostics/, as an organized game folder writes themto fix(dev): dev.py ab measures again on main: the trace in diagnostics/logs, HOS_CONTROL not compared, the menu after the warm-up (supersedes #2186, #2443)Updated: this pull request now supersedes #2186 and #2443, at the request of the person I work for. Their commits are here as their authors wrote them, under their names: dyst's
HOS_CONTROLfix (#2186) and Cal's test and fix for the menu read and the unready turf rows (#2443, #2349). Only the conflicts with currentmainwere resolved: an adjacent line inRUN_ONLY, and a mock ofpacks.runtime_romfsthatmainno longer has.test_run_measures_from_after_the_menu_readfails without it.--logstakeslogs/andbug-reports/at the top level and indiagnostics/.main's, since #2785; #2793 fixes it.f67aa2604c179b7570da@review
Recommendation: Request changes. The two ledger fixes are present, but the reported checks include three failures on this head and two game-free checks still running. The complete A/B write-up also still needs the stated Linux run. (It stands on L3: The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 15s.)The change restores frame-trace discovery in organized game folders, includes older logs in update archives, and avoids comparing per-run control sockets and unready menu rows. It also moves the measurement window past the menu read, at the cost of waiting for another trace flush.
Blocking (3): must change before merging.
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 15s.CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on this head and passes on the base branch: Failing after 3m52s.CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 1m22s.@fixcan do L3, L4 and L5.Since the last review (on
9132d5b2f7)Resolved: L1 (The menu query now occurs immediately before selecting the last visible trace row as the m…); L2 (An organized folder is searched only under diagnostics, so records remaining in the old to…)
Still open: L3 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…)New: L4 (The check
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on th…); L5 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…)Checks: Still running:
CI / Game-free checks (run_all.py, part 1/2) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request).More: does it help, other systems, switches, what was read
Does it help: Yes for trace discovery: the author reports that all 6 Kokiri Forest runs failed on main and all 24 runs across four scenes measured with the trace fix on Windows. A complete write-up with all fixes and a Linux run remain unverified.
Other systems: The changed tools run on Windows and Linux and handle both flat and organized game folders. The reported in-game evidence is Windows-only; Linux behavior remains to be checked.
Switches: No switches added, changed, or removed. HOS_CONTROL is excluded from run comparisons; HOS_CONTROL_MEM and HOS_CONTROL_PEER_SID remain compared.
Reviewed:
179b7570daagainst01d6878b3f: Read AGENTS.md and CONTRIBUTING.md, the changed implementation and test diffs, and the relevant measurement and log collection paths. The combined full-file output was truncated, so not every changed file was read in full; the pull request template and referenced developer standards were not read. The adjacent Tooling rules and docs/review-checklist.md were unavailable.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The supplied CI reports three failures on this head and two checks still running; the author reports Windows game-free checks and timing runs.
Overlaps and merge order: Supersedes #2186 and #2443, whose fixes are included; those pull requests should not also be merged independently.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
The three failing jobs are
main's, from the jobs' logs on this head (the same on #2796, #2797 and #2799):REVIEW REQUIRED: settings-graphics.png: game/oot_cheat_items.h changed since reviewed revision 3c74597e, since #2785; #2793 fixes it.rustfmt:Diff in …/builder/crates/build-compile/src/host_sources_tests.rs:110.the game folder has no image.bin(end_to_end.rs:396), a test that predates the organized game folder.cargo testalready pass./settings/: game branding remains in published text, from #2779's Debug-tab paragraph indocs/user/graphics-and-controls.md; #2799 rewords it, andscripts/website_check.shpasses with it locally.This pull request changes none of those files. Once #2793 and #2799 merge, I'll rebase it so its checks run on the fixed
main.Recommendation: Request changes. The arranged trace path restores frame analysis on the tested Windows setup. The measurement boundary and the support archive still need fixes.
scripts/devtools/ab.py:732, a newly visible CSV row can still have been sampled beforeoption_getfinished. For example, a pre-query frame batch delayed before its flush appears only on the second read and satisfies the loop. The renderer timestamps each frame before writing it, andwindow()excludes only the selected row itself. Use the host monotonic clock after the option reply and wait for a trace endpoint at or after it. Extend the fixture to publish a new batch of pre-boundary timestamps before a post-boundary frame.scripts/devtools/update.py:404, the added organized logs source now takes the rawdiagnostics/logs/longshot_frames.csvin the support ZIP. The regression test requires that trace to be included, and--logsdescribes the archive as something a user may share after checking paths. Keep the raw CSV local, either by excluding it from the support archive or by clearly separating a local-only artifact. Apply the same rule to flat and organized traces.The prior #2186 point also carries forward.
what_ran()strips the entireHOS_CONTROLfact, so the comparison helper cannot distinguish an absent switch from a socket value. Every successful liveabrun currently connects to the bridge, so I found no reachable connected-vs-disabled pair through this path. Normalize the endpoint if preserving the logged on/off distinction is intended.HOS_CONTROL_MEMandHOS_CONTROL_PEER_SIDremain compared.Author evidence shows all six Kokiri runs on main could not find a trace, while all 24 Windows runs across four scenes measured with the path fix. The exact head passes
test_dev_ab.pyin CI. Thetest_dev_update.pyfailure is the oldertest_build_commandcase, also present on the same-base #2802 run without these scripts changed. The Guide, Rust and Website failures have prior base attribution. A successful complete write-up after all fixes and the Linux short real run remain open. Windows evidence · CIReviewed the full change at
179b7570daa1a5d0a2143b7c0a98d4188f1d40e7against01d6878b3f148e68d7a9080133d193e1fb7c2973. No tests run in this review. The fixes from #2186 and #2443 are incorporated. Keep the existing handoff that the originals may be retired after the replacement merges.@ -708,1 +729,4 @@raise drive.Failed("no frame trace at %s (RX_VK_FRAME_TRACE)" % trace)# (the trace is written every 60 frames: its last row may be older than the menu's read just made. The window# starts at the first row written after it, so the read's own frames are not measured)before, end = num(rows[-1], "at_ns"), time.monotonic() + TRACE_AFTER_S[P2] Anchor the measured window to a frame sampled after the option reply. A pre-reply batch may become visible only on the next read because the renderer timestamps before writing and flushing. A growing file shows publication progress, not the sample time relative to the reply. Use a monotonic boundary and cover late publication of pre-boundary frames.
@ -398,0 +401,4 @@for d, subs, names in os.walk(p):subs[:] = [s for s in subs if s not in NEVER_SHARED and not s.startswith("profile-")]found += [os.path.join(d, n) for n in names]files += sorted(found, key=os.path.getmtime, reverse=True)[:newest][P2] Keep raw frame traces out of shareable support bundles. Adding organized logs now takes diagnostics/logs/longshot_frames.csv and the fixture requires it, although raw traces are local-only. Exclude the CSV in both layouts or separate a clearly local-only archive.
179b7570daa963e7dbf9Thanks @futondestroyer, this was a careful read. The branch is rebased onto
main@f14a5664d, with two new commits (test, then fix).1. The measured window (
ab.py): fixed as you suggested. You're right that the file growing says nothing about when its frames were sampled.time.perf_counter_ns(), taken right after theoption_getreply. That is the trace's own clock:at_nsishos_now_ns, which isQueryPerformanceCounteron Windows (host/hos_thread.c) andCLOCK_MONOTONICelsewhere (host/posix/windows.h). On this PC, aQueryPerformanceCounterread between twoperf_counter_ns()calls fell between them.abwaits for a frame at or after the boundary, and the window starts at the boundary, so a late batch from before the read is left out.2. The raw CSV in
update --logs: I've kept it, because it'smain's documented rule and not something this pull request adds.main,update.py's own help says--logs zips logs/ (the log, its older copies, the frame log), andLOG_PARTSwalkslogs/, so a flat folder'slogs/longshot_frames.csvalready goes into the zip. This branch applies the same rule todiagnostics/logs/.docs/dev/reference/profiling.md, "The frame trace"), with no guest addresses or game data. The local-only things are already left out in both layouts:bug-reports/local-only/(minidumps) and everyprofile-*folder (the profiles that page says never leave the PC).3.
HOS_CONTROL: now normalized, as you suggested. dyst's commit stays as it is. On top of it,HOS_CONTROLis compared ason(any socket name) or absent, throughON_OR_OFF, instead of being dropped. A run with the bridge and one without now differ, while the socket's name each run still doesn't count.HOS_CONTROL_MEMandHOS_CONTROL_PEER_SIDare compared as before.test_run_only_switches_not_comparedchecks both.Checks:
mise run test -- --exact tests/test_dev_ab.py ...here: the only error istest_in_run_report_keeps_hitch_rates(the console's cp1252 and "Δ"), as onmain.test_dev_ab.pypasses.test_dev_update.pyfails onlytest_build_command, as onmain, which you'd already traced to the older case.mise run test-changed: 12 pass. The 5 failures fail the same way onmainhere.The Linux short real run is still open, and the description says so. I've updated the description for all of the above.
a963e7dbf98d18560f858d18560f85a99395efc1a99395efc19e4eb50ebc@review
Recommendation: Request changes. The trace-path fix restored measurements in the reported Windows runs, and the changed boundary excludes late-published pre-menu frames. A complete write-up and the short real Linux run are still outstanding. (It stands on L3: The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 15s.)Restores A/B trace discovery for organized game folders, includes old and new diagnostic locations in support archives, and fixes run comparisons and the measurement boundary. The changes make the development tool more reliable at the cost of a short wait for a post-menu trace frame.
Blocking (1): must change before merging.
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 15s.@fixcan do L3.Since the last review (on
179b7570da)Still open: L3 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…); L4 (The checkCI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on th…); L5 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…)Checks: Still running: 5 checks.
Also noticed (3; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven end to end: all 6 Kokiri Forest runs on main failed to find a trace, while 24 Windows runs across four scenes measured with the trace fix, according to the author. Those runs did not produce a complete write-up after all fixes.
Other systems: The Python tool affects Windows and Linux development runs and support archives, not player runtime code. Linux game-free checks were reported passing for ab.py, but a real Linux A/B and complete write-up remain to be checked.
Switches: No switches added, changed or removed. HOS_CONTROL is now compared as on or absent; HOS_CONTROL_MEM and HOS_CONTROL_PEER_SID retain their values for comparison.
Reviewed:
9e4eb50ebcagainste4801d6a55: Read AGENTS.md and CONTRIBUTING.md, the diff, the changed measurement and comparison code and its surrounding callers. Skimmed the other changed files and tests; did not read every changed file in full. The review checklist was absent; the pull request template and referenced standards were not read.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports game-free checks and Windows game runs; CI still has jobs running and reports a failing guide-screenshot check.
Overlaps and merge order: Supersedes #2186 and #2443; retire those after this replacement merges. The author identifies #2793 and #2799 as fixes for base CI failures.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.