fix(vk): the renderer links on Linux again: radv_import_headroom is defined in the anonymous namespace it is declared in #1961
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1961
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/radv-headroom-link"
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
On Linux,
maindoes not build since #1933: the renderer,longshot_vk.so, links with an unresolved symbol and the build refuses it (longshot_vk.so has 1 unresolved symbol(s); it would not load: mkwvk::(anonymous namespace)::radv_import_headroom(unsigned long)).gpu/vk/vk_memory.cppdeclaresradv_import_headroominmkwvk's anonymous namespace, aboveimport_dma_buf, its one caller, but #1933 defined it atmkwvkscope, further down. That is a different function, so the call is left unresolved. Windows never compiles the function (#ifdef __linux__), so only Linux builds break.This puts the definition in an anonymous namespace too, so it is the function that was declared. Nothing else changes. Read
gpu/vk/vk_memory.cppatradv_import_headroom.To see it on
main:python -I scripts/dev.py pack(or any Linux build of the renderer) on Linux stops with the error above.Testing
Tested: CachyOS (Linux 7.3.3), NVIDIA GeForce RTX 3090, driver 620.70. Built as a pack over a shared base with
dev.py pack: onmain@00e0dc93the renderer build stops with the unresolved symbol, and here it links in 27 s (nmon the object: the call and the definition are now the samemkwvk::(anonymous namespace)::radv_import_headroom). Ran the game: the renderer loads, DLSS starts (NVIDIA DLSS: NGX started, Auto: DLSS Quality) and start-up's pipeline preparation runs.No game-free test is added: the renderer build's own check (every symbol of
longshot_vk.soresolves, or it refuses to finish) is the test. It fails onmainand passes here.Still to test:
vk: RADV system heap ... released ... MB of capture sparesline when it releases spares, as #1933 meant (@Beanstalk on the Steam Deck)Measurements
Nothing to measure: this fixes the link. The function's behaviour is #1933's, unchanged.
Risks
None beyond #1933's own: the same function now links. A revert brings back the broken Linux build. Players notice nothing after updating except that Linux builds work again.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (not run on this PC; for CI)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (the renderer build's symbol check is the test, see Testing; no new test file)Assisted-by:/Co-Authored-By:trailers.🤖 Generated with Claude Code
Tested in game: CachyOS (Linux 7.3.3), RTX 3090, NVIDIA 620.70: latest main + this fix built as a pack; the renderer loads, DLSS starts (NGX started, Auto picked DLSS Quality), start-up pipeline preparation runs. On main the renderer build stops with the unresolved radv_import_headroom.
WIP: fix(vk): the renderer links on Linux again: radv_import_headroom is defined in the anonymous namespace it is declared into fix(vk): the renderer links on Linux again: radv_import_headroom is defined in the anonymous namespace it is declared inRecommendation: Request changes. The namespace fix restores Linux builds. Add game-free coverage that catches this link failure before merge, and shorten the capture-spare lock hold before validating the newly reachable path on RADV.
Linux players can build and load the renderer again. The two-line namespace change correctly matches the existing declaration to its definition. On RADV, that also makes #1933's synchronous spare reclaim reachable when a large DMA-BUF import approaches the system-heap budget.
Does it help: Yes for the link fix. On the author's CachyOS RTX 3090 setup with driver 620.70, the shared-base pack at
00e0dc93stopped on one unresolved renderer symbol. The pack at368930361blinked in 27 seconds and loaded in game. That is a build result, with no performance comparison. RADV memory-pressure behavior and transition timing remain unproven.Other systems: Windows preprocesses out the declaration, caller and definition. Linux source, Launcher and AppImage builds share the renderer build path. NVIDIA skips DMA-BUF imports, and other non-RADV drivers return before taking the spare lock. The NVIDIA run reached DLSS and startup pipeline preparation. RADV on desktop AMD and Steam Deck still needs coverage. The diff leaves renderer ABI, save and cache formats, replay ordering, audio and input untouched.
Switches: None.
Reviewed:
368930361bagainst00e0dc93a9: Read AGENTS.md, CONTRIBUTING.md, the Forgejo PR template, docs/dev/standards.md, the fix-with-test guidance, the complete diff and commit, the PR description and the test comment. Read the changed region of gpu/vk/vk_memory.cpp in full and traced the declaration, import callers, spare ownership and allocator calls. Read the relevant game-free fixtures, symbol guard, PR checker and CI routing. Unrelated parts of vk_memory.cpp and its callers, and the rest of the build and CI files, were outside those reads. No docs/review-checklist.md was present and no recorded run files were supplied.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Waiting on the author (a run, a measurement or a decision; no edit does it)
368930361band the test checklist box is open. Report lint and the full game-free suite or equivalent CI results on head, confirm any failures against00e0dc93, and update the checklist. In particular, #1933 already reported the missing pool_pressed marker in test_linux_pressure.py, which is still absent from vk_texture.cpp.Testing: The author's Linux pack comparison and NVIDIA startup smoke demonstrate the link fix. The game-free Linux renderer build can exercise the existing symbol guard without the game. The supplied evidence has no standalone before-and-after check, full-suite or head CI result, or RADV run. This review was read-only.
Overlaps and merge order: #1933 is already in the base and introduced the mismatch. No competing fix was found in the available Git history.
Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.
@ -5394,6 +5394,7 @@ bool system_heap_usage(uint64_t* used, uint64_t* budget); // (vk_vma.cpp; said// Near RADV's system-heap budget, make room before importing. Only completed capture spares// can be destroyed here. The budget and spare sizes are estimates, so leave the ordinary// import and fallback in charge when there is too little reclaimable memory.namespace { // (declared in the anonymous namespace above import_dma_buf, its one caller)Undoing these braces leaves both focused fixtures green. Default GPU-only PR CI skips the Linux renderer link. Gate renderer PRs on the existing game-free Linux link and symbol check, or add a scope-preserving link fixture.
@ -5397,3 +5397,4 @@namespace { // (declared in the anonymous namespace above import_dma_buf, its one caller)void radv_import_headroom(uint64_t bytes) {constexpr uint64_t large_import = 64ull << 20, submit_reserve = 64ull << 20;if (dev.driver_id != VK_DRIVER_ID_MESA_RADV || bytes < large_import) return;A background import can block capture-spare reuse while the driver queries the budget and frees buffers under cap_free_mu. Remove and account for selected spares under the lock, then do the synchronous frees after unlocking and before the import.