fix(vk): reap_cap's lambda returns uint64_t, so vk_vma.cpp compiles on Linux again #1941

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/reap-cap-linux into main 2026-11-21 00:00:14 +00:00
Owner

Summary

Main doesn't build on Linux, so no nightly has come out since nightly-632. #1914 added reap_cap() in gpu/vk/vk_vma.cpp. Its lambda returns 256ull << 20 (unsigned long long) on one path and std::clamp<uint64_t>(...) on the other. On Linux uint64_t is unsigned long, and clang rejects a deduced lambda return type that differs between returns:

gpu/vk/vk_vma.cpp:421:9: error: return type 'unsigned long' must match previous return type 'unsigned long long' when lambda expression has unspecified explicit return type

(release run 43651, job appimage). Windows passed because there uint64_t is unsigned long long.

The lambda now names its return type ([]() -> uint64_t). Every value stays the same.

Testing

Tested: not run in the game. It is a compile fix with no change to any value, and it was opened with --force at the maintainer's request so the nightly can resume. The PR's Linux CI build is the check that matters.

Still to test: None. The Linux build is checked by CI on this PR.

Measurements

Nothing to measure: a compile fix, and the generated code is the same.

Risks

None. Every value is the same and nothing changes for players. A revert brings the build failure back.

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. (Not run in the game: compile-only fix, opened with --force at the maintainer's request.)
  • mise run test passes (any failure that also fails on main is named). (Not run on this PC; CI runs it.)
  • 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

  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (The fix is the Linux build; Windows built already.)
  • 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; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary Main doesn't build on Linux, so no nightly has come out since nightly-632. [#1914](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1914) added `reap_cap()` in `gpu/vk/vk_vma.cpp`. Its lambda returns `256ull << 20` (`unsigned long long`) on one path and `std::clamp<uint64_t>(...)` on the other. On Linux `uint64_t` is `unsigned long`, and clang rejects a deduced lambda return type that differs between returns: ``` gpu/vk/vk_vma.cpp:421:9: error: return type 'unsigned long' must match previous return type 'unsigned long long' when lambda expression has unspecified explicit return type ``` (release run [43651](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/43651), job `appimage`). Windows passed because there `uint64_t` is `unsigned long long`. The lambda now names its return type (`[]() -> uint64_t`). Every value stays the same. ## Testing **Tested:** not run in the game. It is a compile fix with no change to any value, and it was opened with `--force` at the maintainer's request so the nightly can resume. The PR's Linux CI build is the check that matters. **Still to test:** None. The Linux build is checked by CI on this PR. ## Measurements Nothing to measure: a compile fix, and the generated code is the same. ## Risks None. Every value is the same and nothing changes for players. A revert brings the build failure back. ## Checklist ### Ready for review - [x] 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. (Not run in the game: compile-only fix, opened with --force at the maintainer's request.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run on this PC; CI runs it.) - [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] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (The fix is the Linux build; Windows built already.) - [x] 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; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(vk): reap_cap's lambda returns uint64_t, so vk_vma.cpp compiles on Linux again
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
CI / Conventional Commit title (pull_request) Successful in 9s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 18s
PR description / Description follows the template (pull_request_target) Failing after 11s
CI / Website build and checks (pull_request) Failing after 30s
95c41fbb23
#1914's lambda returned 256ull << 20 (unsigned long long) on one path and
std::clamp<uint64_t>(...) (unsigned long on Linux) on the other; clang
refuses a deduced lambda return type that differs between returns, so the
Linux builder and the nightly failed. The lambda now names its return type.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP: fix(vk): reap_cap's lambda returns uint64_t, so vk_vma.cpp compiles on Linux again to fix(vk): reap_cap's lambda returns uint64_t, so vk_vma.cpp compiles on Linux again 2026-11-21 00:00:03 +00:00
HumanBean deleted branch fix/reap-cap-linux 2026-11-21 00:00:15 +00:00
BeanBot left a comment

Recommendation: Wait. The explicit return type fixes the reported Linux compiler error while preserving the reaper’s queue limits. Merge after the Linux builder and game-free checks pass on this head and the author records the required smoke-test result.

This restores the ability to build Longshot’s Vulkan renderer on Linux, which unblocks Linux installs and nightly packaging. The one-line change makes the lambda’s intended type explicit without adding code paths.

Does it help: Unproven on the PR head. Release run 43651’s appimage job reported the mismatched return types. The source change directly addresses that diagnostic, but a successful build of 95c41fbb23 is still missing. No performance measurements are needed for this compile fix.
Other systems: The Linux renderer build is affected regardless of GPU vendor, including on Steam Deck. Windows already used the same type for both returns. Static inspection shows the same budget query, 256 MiB fallback, and one-eighth allowance clamped to 128 MiB–1 GiB, with the same queue accounting, locks, compaction and resource lifetimes. Launcher UI, saves, audio and input are outside the changed path.
Switches: None added, changed or removed.

Reviewed: 95c41fbb23 against 87c0d7b4d6: Read gpu/vk/vk_vma.cpp in full, the full diff and commit, AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the Forgejo PR template and the repository’s fix-with-test guidance. No separate review checklist exists in the checkout. Read the relevant declarations and callers, reaper checks and CI configuration. Skimmed the supplied run 43651 excerpt. The full run log, external Tooling rules and live Forgejo status were unavailable in the offline checkout. No translations or generated files changed.; nothing run (a code review).
Checked and fine:

  • The one-line diff matches the description and follows nearby C++ style. The title after the WIP prefix follows Conventional Commits, and the commit records AI assistance.
  • Both return expressions convert safely to uint64_t. The edit preserves the cached initialization, caller interface and fallback and clamp values.
  • The existing game-free threaded reaper fixture compiles the actual changed source span and checks queue-cap behavior. On Linux with uint64_t defined as unsigned long, the base would fail that compile for the reported reason. No duplicate fixture is needed.
  • The diff contains no game files, build output, generated files, third-party edits, license changes, shader or renderer API changes, path handling changes, or scripts.

Waiting on the author (a run, a measurement or a decision; no edit does it)

  • Record the game-free reaper fixture failing on base 87c0d7b4d6 for the return-type diagnostic and passing on head 95c41fbb23, plus the full check results. The fixture compiles the changed code, but its success alone cannot establish that the whole renderer builds. Run the Linux AppImage workflow’s renderer build check against this head and record the result. That Forgejo workflow requires manual dispatch for a PR branch.
  • Record the project’s required in-game smoke test on the repaired Linux build, covering normal play with the default reaper enabled. The reported force request explains why the PR opened before this run. List the smoke test under Still to test until its result is available.

Suggestions (the author may take or leave)

  • Restore the applicable game-free test checklist item and use the base and head build results as the Measurements verdict. Tick the host-build item once the stated platform evidence is available.

Testing: Static review and git diff --check only. No builds, tests or game runs were executed. The PR includes the base failure excerpt and has no recorded head results.
Overlaps and merge order: #1914 introduced reap_cap() and is already in the base. No competing change or merge-order dependency found in the checkout.


Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Wait.** The explicit return type fixes the reported Linux compiler error while preserving the reaper’s queue limits. Merge after the Linux builder and game-free checks pass on this head and the author records the required smoke-test result. This restores the ability to build Longshot’s Vulkan renderer on Linux, which unblocks Linux installs and nightly packaging. The one-line change makes the lambda’s intended type explicit without adding code paths. **Does it help:** Unproven on the PR head. Release run 43651’s appimage job reported the mismatched return types. The source change directly addresses that diagnostic, but a successful build of 95c41fbb23db is still missing. No performance measurements are needed for this compile fix. **Other systems:** The Linux renderer build is affected regardless of GPU vendor, including on Steam Deck. Windows already used the same type for both returns. Static inspection shows the same budget query, 256 MiB fallback, and one-eighth allowance clamped to 128 MiB–1 GiB, with the same queue accounting, locks, compaction and resource lifetimes. Launcher UI, saves, audio and input are outside the changed path. **Switches:** None added, changed or removed. **Reviewed:** 95c41fbb23db against 87c0d7b4d68d: Read gpu/vk/vk_vma.cpp in full, the full diff and commit, AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the Forgejo PR template and the repository’s fix-with-test guidance. No separate review checklist exists in the checkout. Read the relevant declarations and callers, reaper checks and CI configuration. Skimmed the supplied run 43651 excerpt. The full run log, external Tooling rules and live Forgejo status were unavailable in the offline checkout. No translations or generated files changed.; nothing run (a code review). **Checked and fine:** - The one-line diff matches the description and follows nearby C++ style. The title after the WIP prefix follows Conventional Commits, and the commit records AI assistance. - Both return expressions convert safely to uint64_t. The edit preserves the cached initialization, caller interface and fallback and clamp values. - The existing game-free threaded reaper fixture compiles the actual changed source span and checks queue-cap behavior. On Linux with uint64_t defined as unsigned long, the base would fail that compile for the reported reason. No duplicate fixture is needed. - The diff contains no game files, build output, generated files, third-party edits, license changes, shader or renderer API changes, path handling changes, or scripts. **Waiting on the author** (a run, a measurement or a decision; no edit does it) - Record the game-free reaper fixture failing on base 87c0d7b4d68d for the return-type diagnostic and passing on head 95c41fbb23db, plus the full check results. The fixture compiles the changed code, but its success alone cannot establish that the whole renderer builds. Run the Linux AppImage workflow’s renderer build check against this head and record the result. That Forgejo workflow requires manual dispatch for a PR branch. - Record the project’s required in-game smoke test on the repaired Linux build, covering normal play with the default reaper enabled. The reported force request explains why the PR opened before this run. List the smoke test under Still to test until its result is available. **Suggestions** (the author may take or leave) - Restore the applicable game-free test checklist item and use the base and head build results as the Measurements verdict. Tick the host-build item once the stated platform evidence is available. **Testing:** Static review and git diff --check only. No builds, tests or game runs were executed. The PR includes the base failure excerpt and has no recorded head results. **Overlaps and merge order:** #1914 introduced reap_cap() and is already in the base. No competing change or merge-order dependency found in the checkout. --- <sub>Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
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!1941
No description provided.