test(menu): cover missing NFC callbacks and live scan status #1838

Merged
HumanBean merged 4 commits from posihdun/Longshot:fix/startup-nfc-hint into main 2026-11-20 05:02:34 +00:00
Contributor

Summary

I added missing-callback and live-status coverage to the NFC scan hint test.

A host can exist without an NFC scan callback. The test now checks that hint enumeration still ends in that case. It also checks that the live status remains available in scan states 1 through 6 and absent in states 0 and 7.

The existing bounded enumeration test is kept. No game or renderer code changes remain in this PR. I kept the runtime fix merged in #1815 after comparing both builds on my Arc B580.

Testing

Tested: Ubuntu 24.04.5, Linux kernel 7.3.1-070301-generic, Intel Arc B580 12 GB, Mesa 26.2.6, Ryzen 7 5800XT, 32 GB RAM.

  • The final NFC test passes with GCC and Clang.
  • The affected-check runner passes: 2 passed, 0 failed, 0 skipped, including byte-compilation of tracked Python files.
  • The existing menu paragraph test and Ruff pass.
  • I deliberately broke the live-status behavior while keeping enumeration finite. The new assertion fails in state 1, which the old enumeration-only check would miss. The actual source was not changed by this test.
  • The combined regression test fails on the original 068fb8eb startup-loop implementation and passes on current main and this head.
  • I built main's renderer and alternated two startup runs each of main and the earlier runtime fix. Both reached at least 120 rendered frames in every run and closed cleanly. Main took 7.230 and 6.778 seconds; the earlier PR renderer took 7.231 and 6.778 seconds. There was no demonstrated startup benefit from changing the runtime cutoff further, so I kept main's behavior. The development game now uses that main renderer.

The earlier full-suite run finished with 790 passes, 64 failures and 17 skips. I reran the 63 failed checks on main 08994a9e and the PR branch: the same 63 fail on both, each selected rerun taking 74 seconds. The remaining failure, tests/test_vbytes.py, also times out on main after 600.1 seconds when run alone with the same limit. All 64 failures from the earlier suite run are therefore accounted for on main; no full-suite pass is claimed.

The 63 failed checks reproduced on main
  • tests/test_appimage_player_build.py
  • tests/test_bug_report_defaults.py
  • tests/test_capture_read_once.py
  • tests/test_capture_readback_visibility.py
  • tests/test_control.py
  • tests/test_crash_dialog.py
  • tests/test_crash_record.py
  • tests/test_crt_options.py
  • tests/test_damage_debug_menu.py
  • tests/test_dev_ab.py
  • tests/test_dev_packs.py
  • tests/test_display_startup_failure.py
  • tests/test_dlss_feature_size.py
  • tests/test_draw_stream_visibility.py
  • tests/test_failed_compile_keeps_objects.py
  • tests/test_frame_overlap.py
  • tests/test_fsr3fi_hud_layer.py
  • tests/test_fsr_image_retirement.py
  • tests/test_fsr_uniform_ownership.py
  • tests/test_guest_imported.py
  • tests/test_heart_containers.py
  • tests/test_high_fps_fixes.py
  • tests/test_host_guest_writes.py
  • tests/test_hud_layout_row.py
  • tests/test_libc_hooks.py
  • tests/test_lift_cache.py
  • tests/test_linux_preflight.py
  • tests/test_linux_pressure.py
  • tests/test_linux_tools.py
  • tests/test_linux_update.py
  • tests/test_log_open_failure.py
  • tests/test_longshot_ctl.py
  • tests/test_make_game_ngx.py
  • tests/test_mise_build.py
  • tests/test_missing_nup.py
  • tests/test_mods_list.py
  • tests/test_mods_size_table.py
  • tests/test_ngx_sdk.py
  • tests/test_nonuniform_image_arrays.py
  • tests/test_oot_state_tap.py
  • tests/test_parallel_init_order.py
  • tests/test_pending_guest_import.py
  • tests/test_perf_report.py
  • tests/test_pipeline_play_cache.py
  • tests/test_pipeline_tour.py
  • tests/test_prepare_cache_save.py
  • tests/test_present_queue_default.py
  • tests/test_present_source_crop.py
  • tests/test_present_thread.py
  • tests/test_profiling_mode.py
  • tests/test_program_cache_reader.py
  • tests/test_psychov35_fsr3_fg.py
  • tests/test_readback_timeout_source.py
  • tests/test_replay_write_order.py
  • tests/test_seed_reader.py
  • tests/test_slow_frames.py
  • tests/test_song_note_cue.py
  • tests/test_staging_burst.py
  • tests/test_texel_buffer_ownership.py
  • tests/test_upscaler_rows.py
  • tests/test_vcore_escape.py
  • tests/test_vk_occlusion_queries.py
  • tests/test_walk_key.py

I ran the checks on Linux. No Windows build or physical NFC scan is claimed. The final change only extends the game-free test and does not change the reader or platform code.

Still to test: None for the final test-only change.

Measurements

Nothing to measure: the final diff only adds test coverage. It does not change game performance, startup, memory use or cache behavior.

Risks

A test failure could block checks if the expected scan-state contract changes. The source is compiled with stub host callbacks, without a game, GPU, controller or physical tag. The existing bounded enumeration check is preserved. No game files, options, saves or cache formats change.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Approved in review, every comment answered.
  • CI passes on the head.

Platform: Linux. Please add platform/linux; my account receives HTTP 403 when setting repository labels.

## Summary I added missing-callback and live-status coverage to the NFC scan hint test. A host can exist without an NFC scan callback. The test now checks that hint enumeration still ends in that case. It also checks that the live status remains available in scan states 1 through 6 and absent in states 0 and 7. The existing bounded enumeration test is kept. No game or renderer code changes remain in this PR. I kept the runtime fix merged in #1815 after comparing both builds on my Arc B580. ## Testing **Tested:** Ubuntu 24.04.5, Linux kernel 7.3.1-070301-generic, Intel Arc B580 12 GB, Mesa 26.2.6, Ryzen 7 5800XT, 32 GB RAM. - The final NFC test passes with GCC and Clang. - The affected-check runner passes: 2 passed, 0 failed, 0 skipped, including byte-compilation of tracked Python files. - The existing menu paragraph test and Ruff pass. - I deliberately broke the live-status behavior while keeping enumeration finite. The new assertion fails in state 1, which the old enumeration-only check would miss. The actual source was not changed by this test. - The combined regression test fails on the original `068fb8eb` startup-loop implementation and passes on current main and this head. - I built main's renderer and alternated two startup runs each of main and the earlier runtime fix. Both reached at least 120 rendered frames in every run and closed cleanly. Main took 7.230 and 6.778 seconds; the earlier PR renderer took 7.231 and 6.778 seconds. There was no demonstrated startup benefit from changing the runtime cutoff further, so I kept main's behavior. The development game now uses that main renderer. The earlier full-suite run finished with 790 passes, 64 failures and 17 skips. I reran the 63 failed checks on main `08994a9e` and the PR branch: the same 63 fail on both, each selected rerun taking 74 seconds. The remaining failure, `tests/test_vbytes.py`, also times out on main after 600.1 seconds when run alone with the same limit. All 64 failures from the earlier suite run are therefore accounted for on main; no full-suite pass is claimed. <details> <summary>The 63 failed checks reproduced on main</summary> - `tests/test_appimage_player_build.py` - `tests/test_bug_report_defaults.py` - `tests/test_capture_read_once.py` - `tests/test_capture_readback_visibility.py` - `tests/test_control.py` - `tests/test_crash_dialog.py` - `tests/test_crash_record.py` - `tests/test_crt_options.py` - `tests/test_damage_debug_menu.py` - `tests/test_dev_ab.py` - `tests/test_dev_packs.py` - `tests/test_display_startup_failure.py` - `tests/test_dlss_feature_size.py` - `tests/test_draw_stream_visibility.py` - `tests/test_failed_compile_keeps_objects.py` - `tests/test_frame_overlap.py` - `tests/test_fsr3fi_hud_layer.py` - `tests/test_fsr_image_retirement.py` - `tests/test_fsr_uniform_ownership.py` - `tests/test_guest_imported.py` - `tests/test_heart_containers.py` - `tests/test_high_fps_fixes.py` - `tests/test_host_guest_writes.py` - `tests/test_hud_layout_row.py` - `tests/test_libc_hooks.py` - `tests/test_lift_cache.py` - `tests/test_linux_preflight.py` - `tests/test_linux_pressure.py` - `tests/test_linux_tools.py` - `tests/test_linux_update.py` - `tests/test_log_open_failure.py` - `tests/test_longshot_ctl.py` - `tests/test_make_game_ngx.py` - `tests/test_mise_build.py` - `tests/test_missing_nup.py` - `tests/test_mods_list.py` - `tests/test_mods_size_table.py` - `tests/test_ngx_sdk.py` - `tests/test_nonuniform_image_arrays.py` - `tests/test_oot_state_tap.py` - `tests/test_parallel_init_order.py` - `tests/test_pending_guest_import.py` - `tests/test_perf_report.py` - `tests/test_pipeline_play_cache.py` - `tests/test_pipeline_tour.py` - `tests/test_prepare_cache_save.py` - `tests/test_present_queue_default.py` - `tests/test_present_source_crop.py` - `tests/test_present_thread.py` - `tests/test_profiling_mode.py` - `tests/test_program_cache_reader.py` - `tests/test_psychov35_fsr3_fg.py` - `tests/test_readback_timeout_source.py` - `tests/test_replay_write_order.py` - `tests/test_seed_reader.py` - `tests/test_slow_frames.py` - `tests/test_song_note_cue.py` - `tests/test_staging_burst.py` - `tests/test_texel_buffer_ownership.py` - `tests/test_upscaler_rows.py` - `tests/test_vcore_escape.py` - `tests/test_vk_occlusion_queries.py` - `tests/test_walk_key.py` </details> I ran the checks on Linux. No Windows build or physical NFC scan is claimed. The final change only extends the game-free test and does not change the reader or platform code. **Still to test:** None for the final test-only change. ## Measurements Nothing to measure: the final diff only adds test coverage. It does not change game performance, startup, memory use or cache behavior. ## Risks A test failure could block checks if the expected scan-state contract changes. The source is compiled with stub host callbacks, without a game, GPU, controller or physical tag. The existing bounded enumeration check is preserved. No game files, options, saves or cache formats change. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [x] Everything in Still to test has run, its results in Tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head. Platform: Linux. Please add `platform/linux`; my account receives HTTP 403 when setting repository labels.
Assisted-by: OpenAI Codex
fix(menu): terminate NFC scan hint enumeration during startup
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
159a1c9ded
Assisted-by: OpenAI Codex
Author
Contributor

Tested in game: Ubuntu 24.04.5, Intel Arc B580, Mesa 26.2.6: rebuilt and installed the renderer, verified startup progressed into rendered game frames with the existing caches; player confirmed working now. Closed cleanly through the control bridge.

Tested in game: Ubuntu 24.04.5, Intel Arc B580, Mesa 26.2.6: rebuilt and installed the renderer, verified startup progressed into rendered game frames with the existing caches; player confirmed working now. Closed cleanly through the control bridge.
Member

Possibly related, for context:

  • PR #1815 fix(menu): the Scan row's help lines end, so a Linux window starts and the menu opens again — Merged fix for NFC hint enumeration; this PR revisits same function with a tighter stop condition.
Possibly related, for context: - PR #1815 fix(menu): the Scan row's help lines end, so a Linux window starts and the menu opens again — Merged fix for NFC hint enumeration; this PR revisits same function with a tighter stop condition.
Author
Contributor

Checked current main: merged PR #1815 (08994a9e) already fixes this same startup loop and preserves the live-status measurement variant. This PR is superseded; it should not replace that implementation. The Arc B580 run here confirmed the diagnosed loop was removed. Also reviewed the suite log: 790 passes and 63 failures recorded, 17 declared skips, no final summary; no full-suite pass or Windows/NFC hardware validation is claimed.

Checked current main: merged PR #1815 (08994a9e) already fixes this same startup loop and preserves the live-status measurement variant. This PR is superseded; it should not replace that implementation. The Arc B580 run here confirmed the diagnosed loop was removed. Also reviewed the suite log: 790 passes and 63 failures recorded, 17 declared skips, no final summary; no full-suite pass or Windows/NFC hardware validation is claimed.
Author
Contributor

@BeanIssues wrote in #1838 (comment):

Possibly related, for context:

* PR #1815 fix(menu): the Scan row's help lines end, so a Linux window starts and the menu opens again — Merged fix for NFC hint enumeration; this PR revisits same function with a tighter stop condition.

resolving merge conflicts,I am keep their and my work robobean!

@BeanIssues wrote in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1838#issuecomment-57027: > Possibly related, for context: > > * PR #1815 fix(menu): the Scan row's help lines end, so a Linux window starts and the menu opens again — Merged fix for NFC hint enumeration; this PR revisits same function with a tighter stop condition. resolving merge conflicts,I am keep their and my work robobean!
Author
Contributor

I merged main and resolved the conflict in tests/test_nfc_scan_hint.py. I kept the bounded enumeration test and added coverage for a missing scan callback and unchanged live scan status. GCC, Clang, the existing paragraph test and Ruff pass. I reran all 63 recorded suite failures on main 08994a9e and my branch: the same 63 checks fail on both. I completed the source and test comparison against #1815; an in-game A/B remains untested. My system is Linux kernel 7.3.1-070301-generic, Ubuntu 24.04.5, Mesa 26.2.6 and Arc B580. Please add platform/linux; my account receives HTTP 403 when setting labels. I am keeping this PR open and WIP. Windows and physical NFC checks are not claimed.

I merged main and resolved the conflict in tests/test_nfc_scan_hint.py. I kept the bounded enumeration test and added coverage for a missing scan callback and unchanged live scan status. GCC, Clang, the existing paragraph test and Ruff pass. I reran all 63 recorded suite failures on main 08994a9e and my branch: the same 63 checks fail on both. I completed the source and test comparison against #1815; an in-game A/B remains untested. My system is Linux kernel 7.3.1-070301-generic, Ubuntu 24.04.5, Mesa 26.2.6 and Arc B580. Please add platform/linux; my account receives HTTP 403 when setting labels. I am keeping this PR open and WIP. Windows and physical NFC checks are not claimed.
chore(menu): resolve NFC hint test conflict with main
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
8e0baf53df
Assisted-by: OpenAI Codex
posihdun changed title from WIP: fix(menu): stop startup hanging on NFC scan hints to WIP: test(menu): cover missing NFC callbacks and live scan status 2026-11-20 04:41:24 +00:00
test(menu): preserve upstream NFC behavior and extend scan coverage
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 11s
f413d038e3
Assisted-by: OpenAI Codex
Author
Contributor

I finished the comparison on my Linux B580 system. Current main and the earlier PR renderer both started successfully in two alternating runs each, with no demonstrated startup benefit from the stricter runtime cutoff. I kept main's runtime behavior and reduced this PR to the additional NFC test coverage. The final diff only changes tests/test_nfc_scan_hint.py. GCC, Clang, Ruff and the affected-check runner pass. A deliberately broken live-status implementation fails the new assertion. The same 63 failed suite checks reproduce on main, and test_vbytes.py also times out on main after 600.1 seconds. I have recorded all 64 baseline failures in the description. The PR is ready for review. Please approve the waiting workflows and add platform/linux; my account cannot set the label.

I finished the comparison on my Linux B580 system. Current main and the earlier PR renderer both started successfully in two alternating runs each, with no demonstrated startup benefit from the stricter runtime cutoff. I kept main's runtime behavior and reduced this PR to the additional NFC test coverage. The final diff only changes tests/test_nfc_scan_hint.py. GCC, Clang, Ruff and the affected-check runner pass. A deliberately broken live-status implementation fails the new assertion. The same 63 failed suite checks reproduce on main, and test_vbytes.py also times out on main after 600.1 seconds. I have recorded all 64 baseline failures in the description. The PR is ready for review. Please approve the waiting workflows and add platform/linux; my account cannot set the label.
posihdun changed title from WIP: test(menu): cover missing NFC callbacks and live scan status to test(menu): cover missing NFC callbacks and live scan status 2026-11-20 04:49:02 +00:00
HumanBean deleted branch fix/startup-nfc-hint 2026-11-20 05:02:34 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 11s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!1838
No description provided.