feat(perf): the game sends its own v2 summaries with replay phases #1530

Open
gab9281 wants to merge 14 commits from gab9281/Longshot:fix/perf-send-from-game into main
Member

Type: feat · Risk: medium · Tested on: Linux, CachyOS, RTX 3060 Laptop, NVIDIA 620.70 · Needs: Windows, any GPU (the send path uses the system's curl, as the crash helper does)

Why

With Send performance statistics ticked, the game writes summaries of how its frames went but the launcher was the only thing that sent them — at its start or at game exit. A long session showed nothing at the relay while it was playing, and a game folder played once and never opened again sent nothing at all. The field dashboard also could not say where the render thread spent its time, or whether frame generation, V-Sync and present mode were in play. See #1265 for the sender's related data-loss bugs.

The rule here is the one crash reports already follow: whoever does the work reports it. The game measures the frames and now sends them; the launcher only configures the tick and the address. Build reports stay with the launcher, which does the build.

What changed

The game now posts each summary itself with the system's curl, on the summary's own thread, and v2 summaries carry the missing replay phases and presentation labels; the launcher only writes the tick and stamps the relay address.

  • gpu/vk/perf_report.cpp: after each summary is written (every 5 minutes, at exit, on device loss), send_summary() POSTs it to perf_reports= with curl — find_curl/CreateProcessW on Windows, posix_spawn on Linux, UTF-8 paths. Curl is spawned and waited for off the render thread, with an 8 s / 10 s cap; one sender at a time (send_mu). What the relay took is kept in perf_sent/; only a definite refusal (400/413/415/422) deletes a file, while a 404, a redirect, a busy or unreachable answer leaves it for the next send. At start it retries leftovers then clears .tmp/curl files; at exit it sends the last summary then cleans. release is computed in the game with the crash helper's version/source rule.
  • gpu/vk/perf_report.h: v2 summaries add phases_ms (the 13 PROF_* replay phases), fine_ms (18 frame-time bucket edges with extra resolution around 60 Hz, so a 1% low no longer reads 49-50 fps on perfectly paced 60 fps play) and present_mode, vsync, framegen. parts_ms stays strict; the new fields are separate. The relay (MagicBean-Mirror/Longshot-api@f30cd7e, already deployed) requires all v2 fields and still accepts v1 from older builds.
  • nx2/make_game.py: stamps perf_reports= from addresses.ini, as crash_reports= already is.
  • gpu/vk/perf_report_schema.h: generated by Longshot-api's cmd/gen-game-schema from telemetry/perf/schema.go, so bucket edges and field names are no longer copied by hand between the game and the relay.
  • v2 also carries waits_ms: the five waits already computed each frame for hitch classification (shader translation, pipeline, upload, memsync, readback), summed per map. A causes object adds the detail behind them: main thread CPU/blocked/vcore, late page waits, texture frame time, upload MB/count, pipe waits and textures destroyed. All of it is read and summed inside perf_frame, which never runs with the tick off. The relay exposes longshot_frame_wait_seconds_total and the dashboard has a per-cause bar gauge. Present-to-shown bookkeeping is gated on the tick or the frame trace, so with both off it is strictly zero.
  • gpu/vk/vk_replay.cpp: the present-wait confirmation is now recorded per frame as shown_ms in RX_VK_FRAME_TRACE's CSV, a single clock at the moment the frame reaches the screen (-1 when the driver gives none), plus shown_at_ns, the absolute host-clock timestamp of that confirmation, so frame records can be aligned on the presentation moment. Previously only a 600-frame average was logged. The confirmations are also accumulated into the perf summary as shown_ms {sum, count} per map, so the relay exposes longshot_present_shown_seconds_total / _count_total and the dashboard shows present-to-shown latency in the field.
  • gpu/vk/perf_os.h + perf_os_win.cpp / perf_os_posix.cpp are a generic interface for running an external tool on either OS; perf_curl.cpp/h owns curl discovery, arguments and the answer's status. perf_report.cpp keeps only the keep/drop/retry policy, with the duplicated per-frame gate merged into one block. A source test keeps the split.
  • gpu/vk/switches.def, docs/performance-statistics.md and the game-free checks updated. The dashboard change is MagicBean-Mirror/Bean-Ops@fa50471.
  • gpu/vk/perf_report.cpp: a busy or unreachable relay ends the startup retry pass, as the launcher's sender did, so one busy answer cannot post a whole backlog at once. At exit or device loss the last summary is left in perf_pending/ when another curl still holds the sender lock, so closing never queues a second wait behind it.

Measurements

Verdict: the send path works in the game: six summaries were posted one per minute while the game was still running, accepted by a v2 relay, with real phase values and the new labels.

Hardware: CachyOS (Linux 7.3), RTX 3060 Laptop GPU 6 GB, NVIDIA 620.70, Ryzen 7 6800H, 15 GB.
Scene: a short unscripted session from a fresh runtime, starting at the title and moving into Kokiri Forest / Forest Temple; 1280x720, preset Auto, frame cap 60 via the menu, RX_VK_PERF_INTERVAL=60.
Method: built rt-perf-v2b as a pack over the shared base, ran the game against a local v2 relay over HTTPS (the deployed relay image is still pre-v2), and read perf_sent/*.json and the relay's /metrics. Not an fps measurement: this changes no per-frame work except one thread creation every 5 minutes; the existing summary cost is unchanged.
How to reproduce: RX_VK_PERF_INTERVAL=60 CURL_CA_BUNDLE=<local cert> ./rt-perf-v2b/longshot with send=1 and perf_reports=https://127.0.0.1:8443/telemetry/perf in the folder, play a few minutes, quit; inspect perf_sent/ and the relay's /metrics.

Before: main @ 257c5491 After: this PR @ 6c653d2f (pre-rebase head)
summaries sent during a 6-minute run 0 (launcher only, at start/exit) 6, one per minute, perf_pending/ empty
relay's longshot_perf_reports_total{result="accepted"} 0 for this local relay 12
phase data in a v2 summary none submit 18.4 s, draw 10.1 s, descriptors 4.2 s over 60 s in Forest Temple
1794968423-5.json v=2, ForestTemple (adult): phases_ms={submit:18370.5, present:1132.7, draw:10065.1, descriptors:4245.3, texture_lookups:580.4, uploads:57.1, pipelines:459.7, programs:1827.8, commands:2773.5, dispatch:2179.9, memsync:998.4, queue_submit:488.0, slot_wait:60.8}
longshot_perf_reports_total{result="accepted"} 12
longshot_frame_phase_seconds_total{...,present_mode="mailbox",vsync="auto",framegen="off",phase="submit"} ...

These numbers were measured at the pre-rebase head. The branch has since been rebased onto main @ c507b98c and the sender policy fixes added; the game-side send has not been re-measured on that base (see Must be tested). The 11 original commits are unchanged in content: the rebased tree matched the clean three-way merge exactly.

Flags and settings

No new shipping switch: the setting is the launcher's existing Send performance statistics tick and send=1 in longshot_perf.ini. One test-only switch is added.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_PERF_TEST_CURL test build's stand-in for the system's curl absent a path, unset by default sends summaries to a fake curl in game-free tests helps testing; no effect on players off: only for testing
RX_VK_FRAME_TRACE per-frame CSV, logs/longshot_frames.csv one line a present, no presentation clock adds the shown_ms column from present-wait a stutter can be read against the moment the frame was shown helps local diagnosis; no effect unless set off: only for diagnosis

Testing

Tested: built rt-perf-final from this branch and ran it on Linux/CachyOS with the RTX 3060 for several minutes at RX_VK_PERF_INTERVAL=60, pointed at the real deployed relay (data-services.magicbean.dev). Five v2 summaries went out one a minute into perf_sent/; the live relay's /metrics showed this build's longshot_frame_phase_seconds_total, longshot_frame_wait_seconds_total, longshot_frame_cause_*_total, longshot_frame_time_fine_seconds and longshot_present_shown_* series, with the new labels and 13/13 non-zero phases. The exit summary stayed in perf_pending/ for the next-start retry, as designed. shown_ms was zero because V-Sync was off (immediate), so present-wait had nothing to confirm — the farm matrix covers FIFO. Game-free at the current head 3884d62: the new test_perf_send (a busy relay gets one POST, not one per queued summary; the exit send does not queue behind an in-flight curl), test_perf_report, test_perf_schema, test_frame_trace_waits and test_doc_anchors pass. python -I -B tests/run_all.py: 661 passed, 32 failed, 97 skipped — exactly the 32 failures of main @ c507b98c on this PC (Vulkan/SPIR-V headers and other local prerequisites are missing), so no new failure. test_switch_table fails on main too (missing rows for switches added there). The new test passes with both g++ and clang++. The renderer standalone build could not run here: no Vulkan, SPIR-V or VMA headers are installed; it is not counted as a pass.

Pre-existing CI failure (not introduced here): Guide screenshots / Guide images and local UI source review fails on main with 7 flagged source files; this branch adds one (gpu/vk/vk_fps.h, an implementation-only signature change). I captured the Graphics view with the repo's own UI-only helper on this branch and compared it with docs/images/guide/settings-graphics.png: same 1280x720, but 60,048 pixels differ across the whole frame, so the guide image is genuinely stale against current main — this needs a proper recapture and human review, not a hash refresh. Per docs/images/guide/README.md I did not touch the provenance or hashes. The other CI checks pass or are skipped on this forge.

Not tested: Windows (no mingw toolchain on this PC); the Windows branch mirrors the crash helper's proven CreateProcessW/quoting code.

Must be tested:

  • Windows, any GPU, by hand (I'm on Linux): with Send performance statistics ticked, play a few minutes and quit, expecting summaries in perf_sent/ and no stuck files in perf_pending/. The Test Farm cannot do this one: its sandbox has no network and its security check holds commits that reach it, so a relay POST would never leave the agent.
  • windows+amd, windows+nvidia: a V-Sync On/Off × frame generation On/Off matrix in windowed runs, expecting frame p99 and VRAM against main on the same PC with the new labels naming each cell (Test Farm: @Beanstalk windowed V-Sync and frame generation matrix on AMD and NVIDIA). Display latency needs PresentMon on a person's PC — the farm's windowless lane can't measure the swapchain.
  • Deployment order, by hand: probe POST /telemetry/perf with "v":2 before this ships, expecting 200 {"ok":true} (the old relay answers 400 not a version 1 summary and the game drops those summaries). Already verified here against the deployed relay.
  • Linux, RTX 3060 Laptop, NVIDIA 620.70: by hand, play the same six minutes and route as the Measurements table on head 3884d62 against main, expecting six v2 summaries in perf_sent/ and the relay accepting them, so the numbers describe the branch that would merge.
  • Windows, any GPU: by hand, play a few minutes with a slow or busy relay and quit while a send is in flight, expecting close not to wait for a second curl and the last summary to remain in perf_pending/ for the next start. The game-free test covers the policy, not real close timing.

Risks

What could break: a v2 summary posted before the new relay is deployed is refused and deleted — deployment order matters. An unreachable relay leaves files in perf_pending/ up to the 48-summary cap, and a busy or unreachable answer stops the startup retry pass, so the rest wait for a later start. At exit or device loss, when another curl is still in flight, the final send is skipped and its summary stays in perf_pending/ for the next start rather than adding a second wait to close; the in-flight child is ended with the process. Windows close timing with a send in flight is still to be checked by hand.

Turning it off: untick Send performance statistics (the game deletes what is waiting, as before), or revert the commit.

Compatibility: v1 is still accepted by the relay and read as zeros/not known; no save, options, cache or ABI change. Summaries carry no ID, paths or user name.

Issues

See #1265

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** feat · **Risk:** medium · **Tested on:** Linux, CachyOS, RTX 3060 Laptop, NVIDIA 620.70 · **Needs:** Windows, any GPU (the send path uses the system's curl, as the crash helper does) ## Why With Send performance statistics ticked, the game writes summaries of how its frames went but the **launcher** was the only thing that sent them — at its start or at game exit. A long session showed nothing at the relay while it was playing, and a game folder played once and never opened again sent nothing at all. The field dashboard also could not say where the render thread spent its time, or whether frame generation, V-Sync and present mode were in play. See https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1265 for the sender's related data-loss bugs. The rule here is the one crash reports already follow: whoever does the work reports it. The game measures the frames and now sends them; the launcher only configures the tick and the address. Build reports stay with the launcher, which does the build. ## What changed The game now posts each summary itself with the system's curl, on the summary's own thread, and v2 summaries carry the missing replay phases and presentation labels; the launcher only writes the tick and stamps the relay address. - `gpu/vk/perf_report.cpp`: after each summary is written (every 5 minutes, at exit, on device loss), `send_summary()` POSTs it to `perf_reports=` with curl — `find_curl`/`CreateProcessW` on Windows, `posix_spawn` on Linux, UTF-8 paths. Curl is spawned and waited for off the render thread, with an 8 s / 10 s cap; one sender at a time (`send_mu`). What the relay took is kept in `perf_sent/`; only a definite refusal (400/413/415/422) deletes a file, while a 404, a redirect, a busy or unreachable answer leaves it for the next send. At start it retries leftovers then clears `.tmp`/curl files; at exit it sends the last summary then cleans. `release` is computed in the game with the crash helper's version/source rule. - `gpu/vk/perf_report.h`: v2 summaries add `phases_ms` (the 13 `PROF_*` replay phases), `fine_ms` (18 frame-time bucket edges with extra resolution around 60 Hz, so a 1% low no longer reads 49-50 fps on perfectly paced 60 fps play) and `present_mode`, `vsync`, `framegen`. `parts_ms` stays strict; the new fields are separate. The relay (https://git.magicbean.dev/MagicBean-Mirror/Longshot-api/commit/f30cd7e, already deployed) requires all v2 fields and still accepts v1 from older builds. - `nx2/make_game.py`: stamps `perf_reports=` from `addresses.ini`, as `crash_reports=` already is. - `gpu/vk/perf_report_schema.h`: generated by Longshot-api's `cmd/gen-game-schema` from `telemetry/perf/schema.go`, so bucket edges and field names are no longer copied by hand between the game and the relay. - v2 also carries `waits_ms`: the five waits already computed each frame for hitch classification (shader translation, pipeline, upload, memsync, readback), summed per map. A `causes` object adds the detail behind them: main thread CPU/blocked/vcore, late page waits, texture frame time, upload MB/count, pipe waits and textures destroyed. All of it is read and summed inside `perf_frame`, which never runs with the tick off. The relay exposes `longshot_frame_wait_seconds_total` and the dashboard has a per-cause bar gauge. Present-to-shown bookkeeping is gated on the tick or the frame trace, so with both off it is strictly zero. - `gpu/vk/vk_replay.cpp`: the present-wait confirmation is now recorded per frame as `shown_ms` in `RX_VK_FRAME_TRACE`'s CSV, a single clock at the moment the frame reaches the screen (`-1` when the driver gives none), plus `shown_at_ns`, the absolute host-clock timestamp of that confirmation, so frame records can be aligned on the presentation moment. Previously only a 600-frame average was logged. The confirmations are also accumulated into the perf summary as `shown_ms {sum, count}` per map, so the relay exposes `longshot_present_shown_seconds_total` / `_count_total` and the dashboard shows present-to-shown latency in the field. - `gpu/vk/perf_os.h` + `perf_os_win.cpp` / `perf_os_posix.cpp` are a generic interface for running an external tool on either OS; `perf_curl.cpp/h` owns curl discovery, arguments and the answer's status. `perf_report.cpp` keeps only the keep/drop/retry policy, with the duplicated per-frame gate merged into one block. A source test keeps the split. - `gpu/vk/switches.def`, `docs/performance-statistics.md` and the game-free checks updated. The dashboard change is https://git.magicbean.dev/MagicBean-Mirror/Bean-Ops/commit/fa50471. - `gpu/vk/perf_report.cpp`: a busy or unreachable relay ends the startup retry pass, as the launcher's sender did, so one busy answer cannot post a whole backlog at once. At exit or device loss the last summary is left in `perf_pending/` when another curl still holds the sender lock, so closing never queues a second wait behind it. ## Measurements **Verdict:** the send path works in the game: six summaries were posted one per minute while the game was still running, accepted by a v2 relay, with real phase values and the new labels. Hardware: CachyOS (Linux 7.3), RTX 3060 Laptop GPU 6 GB, NVIDIA 620.70, Ryzen 7 6800H, 15 GB. Scene: a short unscripted session from a fresh runtime, starting at the title and moving into Kokiri Forest / Forest Temple; 1280x720, preset Auto, frame cap 60 via the menu, `RX_VK_PERF_INTERVAL=60`. Method: built `rt-perf-v2b` as a pack over the shared base, ran the game against a local v2 relay over HTTPS (the deployed relay image is still pre-v2), and read `perf_sent/*.json` and the relay's `/metrics`. Not an fps measurement: this changes no per-frame work except one thread creation every 5 minutes; the existing summary cost is unchanged. How to reproduce: `RX_VK_PERF_INTERVAL=60 CURL_CA_BUNDLE=<local cert> ./rt-perf-v2b/longshot` with `send=1` and `perf_reports=https://127.0.0.1:8443/telemetry/perf` in the folder, play a few minutes, quit; inspect `perf_sent/` and the relay's `/metrics`. | | Before: main @ 257c5491 | After: this PR @ 6c653d2f (pre-rebase head) | |---|---|---| | summaries sent during a 6-minute run | 0 (launcher only, at start/exit) | 6, one per minute, `perf_pending/` empty | | relay's `longshot_perf_reports_total{result="accepted"}` | 0 for this local relay | 12 | | phase data in a v2 summary | none | `submit` 18.4 s, `draw` 10.1 s, `descriptors` 4.2 s over 60 s in Forest Temple | ``` 1794968423-5.json v=2, ForestTemple (adult): phases_ms={submit:18370.5, present:1132.7, draw:10065.1, descriptors:4245.3, texture_lookups:580.4, uploads:57.1, pipelines:459.7, programs:1827.8, commands:2773.5, dispatch:2179.9, memsync:998.4, queue_submit:488.0, slot_wait:60.8} longshot_perf_reports_total{result="accepted"} 12 longshot_frame_phase_seconds_total{...,present_mode="mailbox",vsync="auto",framegen="off",phase="submit"} ... ``` These numbers were measured at the pre-rebase head. The branch has since been rebased onto `main @ c507b98c` and the sender policy fixes added; the game-side send has **not** been re-measured on that base (see *Must be tested*). The 11 original commits are unchanged in content: the rebased tree matched the clean three-way merge exactly. ### Flags and settings No new shipping switch: the setting is the launcher's existing Send performance statistics tick and `send=1` in `longshot_perf.ini`. One test-only switch is added. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_PERF_TEST_CURL` | test build's stand-in for the system's curl | absent | a path, unset by default | sends summaries to a fake curl in game-free tests | helps testing; no effect on players | off: only for testing | | `RX_VK_FRAME_TRACE` | per-frame CSV, `logs/longshot_frames.csv` | one line a present, no presentation clock | adds the `shown_ms` column from present-wait | a stutter can be read against the moment the frame was shown | helps local diagnosis; no effect unless set | off: only for diagnosis | ## Testing **Tested:** built `rt-perf-final` from this branch and ran it on Linux/CachyOS with the RTX 3060 for several minutes at `RX_VK_PERF_INTERVAL=60`, pointed at the **real deployed relay** (`data-services.magicbean.dev`). Five v2 summaries went out one a minute into `perf_sent/`; the live relay's `/metrics` showed this build's `longshot_frame_phase_seconds_total`, `longshot_frame_wait_seconds_total`, `longshot_frame_cause_*_total`, `longshot_frame_time_fine_seconds` and `longshot_present_shown_*` series, with the new labels and 13/13 non-zero phases. The exit summary stayed in `perf_pending/` for the next-start retry, as designed. `shown_ms` was zero because V-Sync was off (immediate), so present-wait had nothing to confirm — the farm matrix covers FIFO. Game-free at the current head `3884d62`: the new `test_perf_send` (a busy relay gets one POST, not one per queued summary; the exit send does not queue behind an in-flight curl), `test_perf_report`, `test_perf_schema`, `test_frame_trace_waits` and `test_doc_anchors` pass. `python -I -B tests/run_all.py`: 661 passed, 32 failed, 97 skipped — exactly the 32 failures of `main @ c507b98c` on this PC (Vulkan/SPIR-V headers and other local prerequisites are missing), so no new failure. `test_switch_table` fails on `main` too (missing rows for switches added there). The new test passes with both `g++` and `clang++`. The renderer standalone build could **not** run here: no Vulkan, SPIR-V or VMA headers are installed; it is not counted as a pass. **Pre-existing CI failure (not introduced here):** `Guide screenshots / Guide images and local UI source review` fails on `main` with 7 flagged source files; this branch adds one (`gpu/vk/vk_fps.h`, an implementation-only signature change). I captured the Graphics view with the repo's own UI-only helper on this branch and compared it with `docs/images/guide/settings-graphics.png`: same 1280x720, but **60,048 pixels differ across the whole frame**, so the guide image is genuinely stale against current `main` — this needs a proper recapture and human review, not a hash refresh. Per `docs/images/guide/README.md` I did not touch the provenance or hashes. The other CI checks pass or are skipped on this forge. **Not tested:** Windows (no mingw toolchain on this PC); the Windows branch mirrors the crash helper's proven `CreateProcessW`/quoting code. **Must be tested:** - Windows, any GPU, by hand (I'm on Linux): with Send performance statistics ticked, play a few minutes and quit, expecting summaries in `perf_sent/` and no stuck files in `perf_pending/`. The Test Farm cannot do this one: its sandbox has no network and its security check holds commits that reach it, so a relay POST would never leave the agent. - windows+amd, windows+nvidia: a V-Sync On/Off × frame generation On/Off matrix in windowed runs, expecting frame p99 and VRAM against main on the same PC with the new labels naming each cell (Test Farm: @Beanstalk windowed V-Sync and frame generation matrix on AMD and NVIDIA). Display latency needs PresentMon on a person's PC — the farm's windowless lane can't measure the swapchain. - Deployment order, by hand: probe `POST /telemetry/perf` with `"v":2` before this ships, expecting `200 {"ok":true}` (the old relay answers 400 `not a version 1 summary` and the game drops those summaries). Already verified here against the deployed relay. - Linux, RTX 3060 Laptop, NVIDIA 620.70: by hand, play the same six minutes and route as the Measurements table on head `3884d62` against `main`, expecting six v2 summaries in `perf_sent/` and the relay accepting them, so the numbers describe the branch that would merge. - Windows, any GPU: by hand, play a few minutes with a slow or busy relay and quit while a send is in flight, expecting close not to wait for a second curl and the last summary to remain in `perf_pending/` for the next start. The game-free test covers the policy, not real close timing. ## Risks **What could break:** a v2 summary posted before the new relay is deployed is refused and deleted — deployment order matters. An unreachable relay leaves files in `perf_pending/` up to the 48-summary cap, and a busy or unreachable answer stops the startup retry pass, so the rest wait for a later start. At exit or device loss, when another curl is still in flight, the final send is skipped and its summary stays in `perf_pending/` for the next start rather than adding a second wait to close; the in-flight child is ended with the process. Windows close timing with a send in flight is still to be checked by hand. **Turning it off:** untick Send performance statistics (the game deletes what is waiting, as before), or revert the commit. **Compatibility:** v1 is still accepted by the relay and read as zeros/`not known`; no save, options, cache or ABI change. Summaries carry no ID, paths or user name. ## Issues See https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1265 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
The launcher used to send the performance summaries the game wrote, at its
start or at the game's exit. That meant nothing reached the relay during a
long session, and a folder played once and never again sent nothing at all.
Now the game sends each summary as it writes it, as it already does for crash
reports; the launcher only writes the tick and stamps the relay's address.

- gpu/vk/perf_report.h: pure helpers for the stamp address, the release flag
  (the crash helper's rule), curl's HTTP status and what to keep or drop.
  Only a definite refusal (400/413/415/422) deletes a summary; a 404 during a
  deploy, a redirect or a busy answer keeps it (issue 1265).
- gpu/vk/perf_report.cpp: post each summary with the system's curl on the
  summary's own thread (never a frame's), keep what was sent in perf_sent/,
  retry leftovers at start, and clean .tmp/curl files at start and exit.
  Release is computed in the game now, not rewritten by the launcher's Python.
- nx2/make_game.py: stamp perf_reports= from addresses.ini, as crash_reports=.
- switches.def, docs and game-free checks updated.

Cross-platform: CreateProcessW on Windows, posix_spawn on Linux; UTF-8 paths.

Assisted-by: OpenCode
Adds the data the pacing-metrics report found missing: the render thread's
13 PROF_* phases (where frame time went), and labels for present mode, V-Sync
and frame generation. Version 2 makes phases_ms mandatory; version 1 is still
accepted and read as zeros, so older builds keep sending.

Compatibility: the relay's parts_ms stays strict, so phases go in their own
object. Game-free checks cover the schema and the JSON.

Assisted-by: OpenCode
fix(perf): capture phase deltas before the profiler baseline moves
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 16s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 6s
fbe35f1e19
The render-thread phase accumulation read dp() after l_prof had been set to
prof_ns, so every phase was zero in v2 summaries. Take this frame's deltas
before the baseline update, then add them to the map's totals.

Assisted-by: OpenCode
Author
Member

Tested in game: RTX 3060 Laptop, NVIDIA 620.70, CachyOS: ran rt-perf-v2b for several minutes with a local v2 relay; 6 summaries posted one per minute into perf_sent/, perf_pending/ empty, 12 accepted at the relay, non-zero phase metrics and present-mode/vsync/framegen labels in the summary JSON.

Tested in game: RTX 3060 Laptop, NVIDIA 620.70, CachyOS: ran rt-perf-v2b for several minutes with a local v2 relay; 6 summaries posted one per minute into perf_sent/, perf_pending/ empty, 12 accepted at the relay, non-zero phase metrics and present-mode/vsync/framegen labels in the summary JSON.
Collaborator

Possibly related, for context:

  • PR #1372 WIP: feat(perf): sample performance every second and name the client — Prior work on perf summaries and renderer sampling; overlaps perf_report implementation/context.
  • issue #1265 Game: the performance statistics sender deletes summaries on a 404 or a redirect, can send twice, and sends more than the service takes at once — This PR explicitly fixes the sender's 404/redirect data-loss issue.
  • PR #983 feat(telemetry): crash reports from the game's own window, and performance statistics — Merged PR established the existing opt-in performance summaries this changes.
Possibly related, for context: - PR #1372 WIP: feat(perf): sample performance every second and name the client — Prior work on perf summaries and renderer sampling; overlaps perf_report implementation/context. - issue #1265 Game: the performance statistics sender deletes summaries on a 404 or a redirect, can send twice, and sends more than the service takes at once — This PR explicitly fixes the sender's 404/redirect data-loss issue. - PR #983 feat(telemetry): crash reports from the game's own window, and performance statistics — Merged PR established the existing opt-in performance summaries this changes.
gab9281 changed title from WIP: feat(perf): the game sends its own v2 summaries with replay phases to feat(perf): the game sends its own v2 summaries with replay phases 2026-11-18 02:22:58 +00:00
feat(perf): v2 summaries carry a fine frame-time histogram
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 4s
96aa2b4bfd
Adds fine_ms alongside frame_ms: 18 boundaries with extra edges around a 60 Hz
cap, so a 1% low no longer reads 49-50 fps on perfectly paced 60 fps play.
The coarse histogram stays byte-for-byte; the new field is mandatory in v2.

Assisted-by: OpenCode
feat(vk): add the presentation clock to the per-frame trace
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 21s
3603b35532
VK_KHR_present_wait already waits for a frame to be shown under FIFO and
measured only a 600-frame average. Store each confirmation's present-to-shown
time and add it as the shown_ms column of longshot_frames.csv (-1 when the
driver gave no confirmation), so a stutter can be matched to the moment the
frame actually reached the screen rather than the present call.

Assisted-by: OpenCode
refactor(perf): read the bucket lists from the generated schema header
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 22s
PR description / Description follows the template (pull_request_target) Successful in 7s
11398ac23c
perf_report.h includes gpu/vk/perf_report_schema.h, generated by Longshot-api's
cmd/gen-game-schema from telemetry/perf/schema.go, instead of declaring the
frame/fine/GPU bucket arrays itself. A game-free test checks it keeps doing so.

Assisted-by: OpenCode
feat(perf): the v2 summary carries the present-to-shown clock
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 4s
1387433ebc
The presenter's VK_KHR_present_wait confirmations are accumulated and drained
into the next summary as shown_ms {sum, count} per map, so the relay and Grafana
can show how long presents waited to reach the screen. v1 has no such field.

Assisted-by: OpenCode
feat(perf): v2 summaries carry the renderer wait totals
Some checks failed
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 13s
Third-party parts / As their notes say (pull_request) Successful in 28s
PR description / Description follows the template (pull_request_target) Successful in 4s
d2ba681bf4
The five waits already computed each frame for hitch classification (shader
translation, pipeline, upload, memsync, readback) are now summed into the map's
waits_ms, so the relay can show what a phase spike waited on. Present-to-shown
bookkeeping is gated on the tick or the frame trace, so with both off it is
strictly zero.

Assisted-by: OpenCode
feat(perf): v2 summaries carry per-cause detail
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/approval needs a second approval (sensitive paths)
Website / Website on Cloudflare (pull_request_target) Has been skipped
265285f552
The game already reads these counters for the frame trace; they are now summed
into the summary as causes: main thread CPU/blocked/vcore, late page waits,
texture frame time, upload MB/count, pipe waits and textures destroyed. All of
it is computed inside perf_frame, which never runs when the tick is off.

Assisted-by: OpenCode
Author
Member

@Beanstalk windowed V-Sync and frame generation matrix on AMD and NVIDIA

This PR changes how performance data is collected and sent; the local run was Linux + RTX 3060 in a windowless lane, so the swapchain cases need real hardware. Please run a matrix on windowed Windows targets (windows+amd and windows+nvidia) varying V-Sync On/Off and frame generation On/Off, against main on the same PC, and report frame p99 and VRAM per cell. The v2 summary now labels each report with present_mode, vsync and framegen, so the report should name the settings each cell actually used.

Note: perf summaries and automatic crash reports cannot be enabled on farm agents — the sandbox has no network by design (bubblewrap / AppContainer / firewall) and the security check holds commits that reach it. That path is tested by hand on a normal Windows PC; the farm's job here is only the performance comparison under the different presentation settings.

@Beanstalk windowed V-Sync and frame generation matrix on AMD and NVIDIA This PR changes how performance data is collected and sent; the local run was Linux + RTX 3060 in a windowless lane, so the swapchain cases need real hardware. Please run a matrix on windowed Windows targets (windows+amd and windows+nvidia) varying V-Sync On/Off and frame generation On/Off, against main on the same PC, and report frame p99 and VRAM per cell. The v2 summary now labels each report with present_mode, vsync and framegen, so the report should name the settings each cell actually used. Note: perf summaries and automatic crash reports cannot be enabled on farm agents — the sandbox has no network by design (bubblewrap / AppContainer / firewall) and the security check holds commits that reach it. That path is tested by hand on a normal Windows PC; the farm's job here is only the performance comparison under the different presentation settings.
Member

@gab9281 approval of 265285f recorded. This diff touches sensitive paths, so a second member of BigBeans must approve it too.

@gab9281 approval of `265285f` recorded. This diff touches sensitive paths, so a second member of `BigBeans` must approve it too.
Member

Beanstalk test farm

Commit 3884d62 · tier untrusted · approved by nobody yet · dashboard

This diff touches sensitive paths, so it needs two members of BigBeans: nx2/make_game.py

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `3884d62` · tier **untrusted** · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/1530) This diff touches sensitive paths, so it needs two members of `BigBeans`: `nx2/make_game.py` A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
feat(vk): give the frame trace an absolute presentation clock
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
beanstalk/approval not approved yet
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
PR description / Description follows the template (pull_request_target) Successful in 7s
Third-party parts / As their notes say (pull_request) Successful in 17s
0d2b935d9d
Adds shown_at_ns: the host clock at which VK_KHR_present_wait confirmed the
frame was actually shown. Together with shown_ms it lets a frame record be
aligned on the presentation moment rather than the present call, and keeps
that clock gated so it is zero when neither telemetry nor the trace is on.

Assisted-by: OpenCode
refactor(perf): split curl and OS spawning out of perf_report.cpp
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 27s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 6s
6c653d2f5f
perf_os is a generic interface for running an external tool, with one file per
platform (CreateProcessW / posix_spawn). perf_curl owns curl discovery, its
arguments and the answer's status, using perf_os to spawn. perf_report.cpp
keeps only the policy: what to keep, drop or retry. The duplicated primed gate
is merged into one block. No behaviour change; a source test keeps the split.

Assisted-by: OpenCode
Member

Independent Windows sender check at 6c653d2f5f603c75189934abd02124ae0fec608d (llvm-mingw, native Windows, synthetic summaries).

  • The Windows process launcher passed a synthetic v2 body to the test child from a path with spaces and a non-ASCII character. 200/201 archived the summary, 400/413/415/422 dropped it, and redirects, 404/408/425/429/503 retained it. Successful replay drained the backlog oldest first.
  • System32 curl 8.22.0 sent a TLS ClientHello to a silent loopback listener, returned in 3.22 s, retained the summary, and cleaned the scratch files. Successful HTTP responses above came from a test child. Full in-game Windows HTTPS acceptance and shutdown remain unverified.

Startup retry on 429: three queued files produced three more-or-less immediate attempts in the same startup pass even though each returned 429. The files were retained. Please consider stopping the startup pass on transient failure and carrying forward any applicable retry delay, so a busy relay does not receive the rest of the backlog in that pass.

Shutdown bound: the 10-second Win32 wait is per child. The final synchronous send takes send_mu, so it can wait for an earlier sender before starting its own wait. Please verify close with a send in flight and either document the observed behavior or enforce the intended total deadline while preserving the pending summary.

All test inputs and logs stayed local.

Follow-up synthetic check at the same head: with one 5.5 s test child already active and another 5.5 s response on the final-send path, that final synchronous call took 11.125 s. Both 503 summaries were retained. This confirms that the shutdown send path can exceed 10 s under contention. Full game-close timing remains to be checked.

Independent Windows sender check at `6c653d2f5f603c75189934abd02124ae0fec608d` (llvm-mingw, native Windows, synthetic summaries). - The Windows process launcher passed a synthetic v2 body to the test child from a path with spaces and a non-ASCII character. 200/201 archived the summary, 400/413/415/422 dropped it, and redirects, 404/408/425/429/503 retained it. Successful replay drained the backlog oldest first. - System32 curl 8.22.0 sent a TLS ClientHello to a silent loopback listener, returned in 3.22 s, retained the summary, and cleaned the scratch files. Successful HTTP responses above came from a test child. Full in-game Windows HTTPS acceptance and shutdown remain unverified. **Startup retry on 429:** three queued files produced three more-or-less immediate attempts in the same startup pass even though each returned 429. The files were retained. Please consider stopping the startup pass on transient failure and carrying forward any applicable retry delay, so a busy relay does not receive the rest of the backlog in that pass. **Shutdown bound:** the 10-second Win32 wait is per child. The final synchronous send takes `send_mu`, so it can wait for an earlier sender before starting its own wait. Please verify close with a send in flight and either document the observed behavior or enforce the intended total deadline while preserving the pending summary. All test inputs and logs stayed local. Follow-up synthetic check at the same head: with one 5.5 s test child already active and another 5.5 s response on the final-send path, that final synchronous call took **11.125 s**. Both 503 summaries were retained. This confirms that the shutdown send path can exceed 10 s under contention. Full game-close timing remains to be checked.
Member

WIP #1625 exercises state tagging in a local sidecar with the existing field producer. The Windows run found same-map menus and a map load with only unknown evidence in the middle. For a separate telemetry follow-up, propose optional bounded per-map state histograms using the v2 bucket edges. Keep the combined histogram available for queries and track the classified duration so unknown or transition-heavy samples have visible coverage. This would need relay acceptance and shared producer/relay fixtures before enabling emission.

[WIP #1625](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1625) exercises state tagging in a local sidecar with the existing field producer. The Windows run found same-map menus and a map load with only `unknown` evidence in the middle. For a separate telemetry follow-up, propose optional bounded per-map state histograms using the v2 bucket edges. Keep the combined histogram available for queries and track the classified duration so unknown or transition-heavy samples have visible coverage. This would need relay acceptance and shared producer/relay fixtures before enabling emission.
gab9281 force-pushed fix/perf-send-from-game from 6c653d2f5f
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 27s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 6s
to 3884d62ed2
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
Third-party parts / As their notes say (pull_request) Successful in 12s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-18 17:51:43 +00:00
Compare
Author
Member

Rebased onto main @ c507b98c and addressed the sender findings; branch head is now 3884d62 (force-pushed to fix/perf-send-from-game). All 11 original commits are preserved in order — the rebased tree matched the clean three-way merge exactly.

busy relay (429): send_pending() used to call send_summary() for every queued file even after a busy answer, so 48 pending summaries meant 48 immediate POSTs. It now stops at the first Busy/None, as the launcher's nx2/perf_report.py sender always did; the rest stay in perf_pending/.

close timing: the exit/device-loss path used to block on send_mu and then wait up to another 10 s for its own curl, which is how futondestroyer measured 11.125 s. It now uses try_lock: if a curl is in flight, the last summary stays in perf_pending/ for the next start, and clean_pending() leaves that curl's scratch files alone.

test: new game-free tests/test_perf_send.py cuts the real send_summary/send_pending out of perf_report.cpp, compiles them with a stand-in curl, and checks the one-POST-on-429 rule and the non-blocking exit send. It fails on the pre-fix head (3 POSTs) and passes now, with both g++ and clang++. The PR description records the full check results and what could not be run here (standalone renderer build: no Vulkan headers; in-game close timing and a re-measure on the new base are still listed under Must be tested).

The description's measurement table still shows the pre-rebase numbers, labelled as such — the game has not been run on the new base here.

Rebased onto `main @ c507b98c` and addressed the sender findings; branch head is now `3884d62` (force-pushed to `fix/perf-send-from-game`). All 11 original commits are preserved in order — the rebased tree matched the clean three-way merge exactly. **busy relay (429):** `send_pending()` used to call `send_summary()` for every queued file even after a busy answer, so 48 pending summaries meant 48 immediate POSTs. It now stops at the first `Busy`/`None`, as the launcher's `nx2/perf_report.py` sender always did; the rest stay in `perf_pending/`. **close timing:** the exit/device-loss path used to block on `send_mu` and then wait up to another 10 s for its own curl, which is how futondestroyer measured 11.125 s. It now uses `try_lock`: if a curl is in flight, the last summary stays in `perf_pending/` for the next start, and `clean_pending()` leaves that curl's scratch files alone. **test:** new game-free `tests/test_perf_send.py` cuts the real `send_summary`/`send_pending` out of `perf_report.cpp`, compiles them with a stand-in curl, and checks the one-POST-on-429 rule and the non-blocking exit send. It fails on the pre-fix head (3 POSTs) and passes now, with both g++ and clang++. The PR description records the full check results and what could not be run here (standalone renderer build: no Vulkan headers; in-game close timing and a re-measure on the new base are still listed under *Must be tested*). The description's measurement table still shows the pre-rebase numbers, labelled as such — the game has not been run on the new base here.
Author
Member

Format the new Must-be-tested items so the PR description check passes; no code change.

Format the new Must-be-tested items so the PR description check passes; no code change.
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
Third-party parts / As their notes say (pull_request) Successful in 12s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/perf-send-from-game:gab9281-fix/perf-send-from-game'
git switch 'gab9281-fix/perf-send-from-game'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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
MagicBeanDev/Longshot!1530
No description provided.