feat(host): nvnBufferMap's 0 answers are logged as a warning, which one and who asked #2942
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!2942
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:feat/nvn-buffer-map-null-log"
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
A player on nightly-971 (RX 9070 XT, AMD 26.11.2, Windows 11) crashed in Kakariko after the Sheik scene:
[hos PlacementMgr] CRASH: exception 0xc0000005 (write 0x1000000000a0, guest 0xa0), guest backtrace fromlr 0x800aa2e8.The same crash, with the same caller and a write at a small guest address, is on #81 many times since v3.0.0-rc.6, on
NVIDIA and AMD cards alike, almost all in Castle Town Market or Kakariko. It is the game writing at what
nvnBufferMapanswered (the crash's
x0is 0 and the write lands at that 0 plus an offset), andnvnBufferMapanswers 0 in two cases:no buffer at all, or a buffer whose memory pool has no storage (a virtual pool, or a pool finalized or reused). Nothing
in the log says which, so the crash cannot be taken further from players' reports.
This logs those 0 answers as a warning, the first 4 times in a run:
nvn: nvnBufferMap of no buffer | a pool with no storage (lr …, buffer … magic …, pool … magic … flags … size …): 0.The next report then says which object was gone and who asked. The no-buffer case is now tested on
x0beforeP(0), asno_pooldoes (the comment there says why). A map that answers memory is unchanged, and nothing else changes: no switch,since it changes no behaviour and only shows in a run that is about to crash.
Read first:
host/nvn_native.c(map_null,NV(nvnBufferMap)),tests/test_nvn_buffer_map.py.See #81.
Testing
Tested: Windows 11, RTX 5080, this branch's
longshot.exeandlongshot_vk.dllover the shared base (dev.py pack,dev.py rt), built with llvm-mingw and the gnullvm Rust. One headless run through the job queue (the test profile,market-entrancesave): Castle Town Market as a child (60 fps) and as an adult, then adult Kakariko (60 fps), about2 minutes in all. No
[warn],[error], CRASH or device-lost line, and nonvnBufferMap ofline: the 0 case did nothappen, as expected; a clean quit (exit 0).
Checks:
tests/test_nvn_buffer_map.pycompiles the realnvnBufferMapon its own; it now takesmap_nullwith it and checksthat a pool with no storage and a null buffer each log one warning naming which, with the whole line as written (the
caller's lr, the buffer's address and magic, the pool's address, magic, flags and size; zeros for no buffer), a mapped
buffer none, and no more than 4 lines. It passes with gcc and clang; the cap at 6, info level, either log removed, and
each field swapped or dropped (lr and buffer, the pool's address, flags, size, the buffer's magic) each fail it, and a
checkout whose
nvn_native.chas nomap_nullfails it.test_nvn_null_pool.pypasses.nvn_native.ccompiled (syntax only,-Wall -Wextra) with the build plan's own llvm-mingw command: 0 errors, nowarning from the new lines.
tests/run_all.py --strict(whatmise run testruns): 815 passed, 59 failed, 48 skipped. 56 of the failures failthe same on
main@4908cc6daon this PC (listed below);test_longshot_ctl.pyandtest_recorder_parts.pyfailedunder load (12 at once) and pass alone, on this branch;
test_nvn_buffer_map.pyis the check updated here.The 56 checks that fail on main too (this PC)
test_auto_handheld.py test_blocks_at_start.py test_bug_report.py test_builder_channel.py test_control_picture.py
test_coverage_run.py test_crash_record.py test_crt_options.py test_dev_build.py test_dev_migrate.py test_dev_update.py
test_draw_stream_visibility.py test_framegen_hdr.py test_framegen_resources.py test_fs_path_utf8.py
test_fsr_uniform_ownership.py test_game_boundary.py test_image_reaper_threads.py test_image_view_retry.py
test_input_background.py test_keyboard_menu_option.py test_keyboard_option.py test_lifter.py test_linux_pressure.py
test_loaded_modules_drop.py test_log_batch.py test_log_levels.py test_menu_keys.py test_mise_build.py
test_native_zstd.py test_oot_menu_mouse.py test_oot_state_tap.py test_option_ids.py test_parity_gates.py
test_perf_send.py test_present_source_crop.py test_profile_symbols.py test_program_cache_cleanup.py
test_program_cache_one_variant.py test_readback_timeout_reuse.py test_recording_admission.py test_run_all_mingw.py
test_screensaver.py test_switch_table.py test_target_retention.py test_temporal_present_bandwidth.py
test_tex_desc_memo.py test_text_keyboard_policy.py test_upscaler_round_trip.py test_vcore_video_acquire.py
test_video_catchup.py test_video_hold_early.py test_video_input_limit.py test_vram_compact.py
test_windows_display_startup.py test_windows_on_linux.py
Still to test:
Linux build and a start into play).
Measurements
Nothing to measure: the new code runs only where
nvnBufferMapalready answers 0, at most 4 log lines a run; the paththat answers memory is unchanged.
Risks
A log line, 4 at most, in a run that is about to crash anyway. The no-buffer test moved before
P(0): same answer (0) asbefore for a 0 argument. A revert is enough. Players notice nothing; their crash logs gain the line.
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
tests/that reads changed source is updated, not weakened.nvn_native.calready uses on Linux:LONG,InterlockedIncrement,hos_log_at.)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, RTX 5080, this branch's longshot.exe and longshot_vk.dll over the shared base, one headless run through the job queue (test profile, market-entrance save): Castle Town Market child (60 fps) and adult, then adult Kakariko (60 fps), about 2 minutes. No [warn], [error], CRASH or device-lost line; no 'nvnBufferMap of' line (the 0 case did not happen, as expected); clean quit, exit 0.
Possibly related, for context:
@Beanstalk please build this on Linux (any GPU) against the latest nightly and start it into play for a minute or two: a save in Castle Town Market or Kakariko if you have one, else any save. Expecting the host to build and the run to look like the Windows one: no new [warn] or [error] line, and no 'nvnBufferMap of' line (it only appears when nvnBufferMap answers 0, just before a crash). Please post the build result and the log.
@review
Recommendation: Approve. The code is ready: only testing is left. The warning can distinguish the two mapped-zero cases without changing successful mappings. The Linux build and in-game run requested by the author are still outstanding. Recommend approval; not approved on the forge.
Adds up to four warnings identifying null-buffer and storage-less-pool mappings, including the caller and object details. The successful mapping path is unchanged; the added test covers warning counts and reasons but does not check the formatted diagnostic.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
Questions (1) (not confirmed from the code; they don't hold the recommendation)
tests/test_nvn_buffer_map.py:77: Is there a case at HEAD where the warning is missing or misreports one of those fields?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven in a player crash: the Windows run did not encounter either zero-return case. The author reports that the game-free fixture exercises both cases; this is not a performance change.
Other systems: The host path is shared by Windows and Linux and is independent of GPU vendor. A Windows RTX 5080 run was clean; Linux build and play evidence is pending. The counter uses the platform's interlocked increment, and the existing crash logging path flushes queued messages.
Switches: None.
Reviewed:
f139ff4721against4908cc6dad: Read the changed test in full, the diff twice, repository rules, the PR template, commit messages, the null-pool fixture, and the mapping, pool lifetime and logging code around the change. The rest of the large host/nvn_native.c file was skimmed; no recorded runs or generated files were changed. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code or tests were run. The author reports a clean Windows game run and passing focused checks; CI is still running.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
On BeanBot's question (tests/test_nvn_buffer_map.py:77): the check now reads the whole logged line, not only its level, reason and count (
62d2563a9). For a pool with no storage it compares the caller's lr, the buffer's address and magic and the pool's address, magic, flags and size against the line as written; for no buffer, lr and zeros. Swapping lr and the buffer, the buffer's address for the pool's, magic for flags, the buffer's size for the pool's, or dropping the buffer's magic each fail it; it passes with gcc and clang. No change to host/nvn_native.c, so the Windows game run still holds. The Linux build and run are with Beanstalk (requested above).@review
Recommendation: Request changes. The warning adds diagnostic context without changing successful mappings. The Linux host build and in-game check remain outstanding. (It stands on L2: The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 10s.)Null buffer-map results now produce up to four warnings with the caller and object state, which may help diagnose the reported crash; the test checks the full warning text. The normal mapped path remains unchanged.
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 10s.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L2.Since the last review (on
f139ff4721)Still open: L1 (The Linux host build and in-game check are still outstanding.)
New: L2 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…)Checks: Still running: 8 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven: the fixture reportedly passes with gcc and clang, but the Windows game run did not encounter a zero result, so it did not demonstrate the warning in a real crash report. This is not a performance change.
Other systems: The host path is shared across Windows and Linux and GPU vendors. A Windows NVIDIA game run was clean; the Linux build and run are outstanding.
Switches: None.
Reviewed:
62d2563a95against4908cc6dad: Read the full changed test and the diffs, repository contribution rules, AGENTS.md and pull request template. Read the changed host functions and surrounding definitions; the rest of host/nvn_native.c was skimmed. docs/review-checklist.md was absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run for this review. The author reports gcc and clang fixture passes and a clean Windows game run; Linux validation remains requested. CI has one head-only failure and several checks still running.
Overlaps and merge order: Not checked.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@Beanstalk
Beanstalk test farm · ⛔ held by the security check
Commit
62d2563· approved by llun (untrusted) · dashboardHeld by the security check (
gpt-6-luna), so nothing is built or run:The check looks at the diff for code that is plainly unsafe or broken before any tester builds it. A new push is checked again. A member of
BigBeanswho has looked at the code can comment@Beanstalk plan <why it is fine>: the check reads those words.WIP: feat(host): nvnBufferMap's 0 answers are logged as a warning, which one and who askedto feat(host): nvnBufferMap's 0 answers are logged as a warning, which one and who askedRecommendation: Request changes. The warning can distinguish the two reported null-map cases, but the Linux host build and in-game check remain outstanding. Two CI checks also fail on this head, and three are still running. (It stands on L2: The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 10s.)Adds up to four warnings per run with the caller and buffer or pool details when nvnBufferMap returns zero, helping diagnose subsequent crashes. Successful pooled mappings retain their existing path; the change adds a small amount of diagnostic code and test coverage.
Blocking (2): 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 10s.CI / Website build and checks (pull_request)fails on this head and passes on the base branch: Failing after 34s.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L2 and L3.Since the last review (on
62d2563a95)Still open: L1 (The Linux host build and in-game check are still outstanding.); L2 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…)New: L3 (The check
CI / 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),PR description / Title and description (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Unproven in a player crash report: the Windows game run did not encounter a zero result. The author reports that the game-free test checks both warning cases and their fields; this is not a performance change.
Other systems: The host path is shared across Windows and Linux and does not depend on GPU vendor. The reported Windows RTX 5080 run was clean; the Linux build and short run are still pending.
Switches: None.
Reviewed:
62d2563a95against4908cc6dad: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the full test file, the diff and commits, and the changed host code with its pointer conversion and buffer initialization context. Skimmed the standards and surrounding host code; did not read host/nvn_native.c in full. The referenced sibling Tooling AGENTS.md and docs/review-checklist.md are absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports a clean Windows game run and passing focused checks; CI has two head-only failures and three checks still running.
Overlaps and merge order: Not established from the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as llun took it out of WIP. Nothing was run; a maintainer decides.