d3d12: F4 trainer Get all weapons through the title's inventory functions, 1.0.2.1 (D3D12-F4-GIVE-ITEMS) #3234
Closed
github-bot
wants to merge 13 commits from
github-bot/gh-3234 into main
AGit
pull from: github-bot/gh-3234
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
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
github/ubiquitarianism--leonida!3234
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3234"
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?
@eipastel on GitHub · 2026-12-02 21:42 UTC · original
eipastel:f4-give-weapons→main· +1015 −24 · 6 files · 13 commits · closed without mergingClaimed in the coordination issue as: D3D12-F4-GIVE-ITEMS (#2570, claim of 2026-12-02 20:21)
Depends on: #3114 (this branch is #3114's head
c4ebe52deplus the three commits below; only those are this pull request's)What and why
The F4 trainer's Get all weapons (
weapons.all) now gives the player every weapon the title defines, on 1.0.2.1.The give natives cannot be called from the game-actions update:
VI_GIVE_ITEM_TO_PED_ASYNCwants the task type of a calling script program and ends the title without one, and_GIVE_WEAPON_COLLECTION_TO_PEDreplaces what the player carries with a mission loadout (matthieupl87-spec's finding in #2570). Under those natives the title adds a weapon with four plain functions that need no script context: the player's inventory by entity id, a weapon's info by item hash, whether the inventory can take it, and the add, given a request filled as a pickup fills it.d3d12/apps/leonida/src/game_actions/weapons.rsreads the weapon items from the title's item registry and adds each one that way.game_actions.rs) is compared with this build's before anything is called.modmenu/weapons.rs(GPL-3.0), cited in the module header asgame_actions.rsalready cites that source.LEONIDA_GAME_ACTIONS_RUNgainsaction <menu id>(for exampleaction weapons.all), to run any menu action without the keyboard; documented indocs/mod-menu.md, the module header andd3d12/docs/switches.md(regenerated withtools/d3d12_switches.py).One line outside the topic, so CI can build:
maindoes not buildleonida-lua's tests since #3179 (Runtime::newno longer returns aResult) and #3189 (a test still calls.unwrap()on it). Commit57dfd866ddrops that.unwrap()(d3d12/crates/leonida-lua/src/tests.rs:1089), the same change as #3237; whichever lands first, the other's copy merges cleanly or drops out.Tested
cargo test -p leonida --locked(fromd3d12/): 50 + 2 + 2 passed, 0 failed. New:parse_command("action weapons.all")and its wrong forms;weapons::tests::only_weapons_not_hidden_are_kept_in_order(a hand-built registry buffer: weapon type kept, other types and the hidden list dropped, order kept) andweapon_type_is_the_hash_of_weapon. The registry test covers a function split out of existing code in the review commit, so there is no red run for it.cargo test -p leonida-menu --locked: passed. After mergingmain:cargo build --workspace --all-targets --lockedclean;cargo test -p leonida-lua -p leonida -p leonida-menu --lockedpassed, excepta_scan_without_a_size_reaches_the_end_of_the_imagefailing once and passing on three reruns (the intermittent fake-image alignment case, not touched here).cargo fmt --all --check: clean.cargo clippy -p leonida --all-targets -- -D warningsstops oncrates/leonida-gpu/src/host.rs:7628(unused_mut), which is onmainand not in this diff.python -I tools/d3d12_switches.py --check d3d12/docs/switches.md,python -m unittest discover -s tests -p "test_docs_*.py"(57 tests): OK.python -I scripts/check_no_game_data.py: clean.LEONIDA_GAME_ACTIONS=1): F4, Get all weapons gives the player the weapons, and the title keeps running.GPUs tested: n/a for the tests above (no GPU or game files involved)
AI-assisted: yes. Code: Claude Opus 5.5. Independent read-only reviewer: Claude Opus (no blockers). Addressed: the registry parse split out and tested,
action <menu id>added to the module header andswitches.md. Left as is: the menu offers the item before there is a player (the give answers "no player yet", asplayer.cashandvehicle.partsdo), and the records are read in one read (a registry that is not contiguous would fail with "unreadable", not crash).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)@MoonEyes on GitHub · 2026-12-02 21:59 UTC · original
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@fiestorra on GitHub · 2026-12-02 22:00 UTC · original
VERIFY-3234 — Windows nativo: las suites pasan, el control muerde, y el crate se prueba con otro comando del que parece
(this PR)8422def75(behindmainb41763227)main—merge-treeclean,git merge --no-ffclean (auto-mergeddocs/switches.md)Ran
A note for the next person who runs it:
cargo test -p leonida --libfails withno library targets found in package leonida— the trainer lives in the binary crate, so the unit tests needcargo test -p leonidawithout--lib. That cost me one confusing run.Negative control (synthetic — the tests ship with the change, in the same file): I made
set()clear everyweapons.*toggle when any one of them is turned off, which is exactly what the clip test exists to prevent, rebuilt and ran →The test bites. And the behaviour it pins is the one that would be a bug in the title: two toggles share
SET_PED_INFINITE_AMMO_CLIP, so turning one off must not clear the other's clip — the fixture checks the shared counter goes 1 and then 0, not 2 and then 0.What the other new tests cover, from their names and my read: the item list is enumerated once and counted, the item-name hash matches the one the title computes, the float arguments go in the low half of the register, the parts list is found on a
ganado, andset()marks a change with the right keep-up rule. Eight tests, and none of them needs a GPU or the title.What I could not test
leonida-menu/src/tree.rs, +8/-7): the menu crate's 48 tests pass, but the entry appearing in the real F4 page is a run.Written with an AI assistant.
@eipastel on GitHub · 2026-12-02 23:10 UTC · original
Run report for @MoonEyes's request, in game on 1.0.2.1, through
scripts/game-gate.ps1: PASS, 303 s in the world, no crash, no device loss, clean exit.57dfd866d, which already containsmainatf3865cae8(merged318f70b1).mainhas since moved toef35d683e; this run is not on that.diagnostics,dlss,mimalloc, exe157bde14df53c223, not dirty.-PlayArgs '-SeriesS -PrecompileUsed',LEONIDA_GAME_ACTIONS=1,LEONIDA_GAME_ACTIONS_RUN=240:action weapons.all(this PR's item run during the window),LEONIDA_KEYS=40:Enter,60:Enter.target, exit0x00000000(clean), pipeline cache saved.weapons.all: 61 of 131 weapons given (6 not taken: carried, or that kind full), and the title kept running afterwards.Not done: the same run on
mainalone for comparison. No logs or screenshots attached (they show game content).AI-assisted (Claude Code, Claude Opus 5.5).
@fiestorra on GitHub · 2026-12-03 00:09 UTC · original
#3234 is now redundant —
mainno longer has the.unwrap()I checked the file on
origin/main(81efe4566): there is noRuntime::new(...).unwrap()left inleonida-lua/src/tests.rs, and this pull request's whole diff is the one line that removes it:It landed through #3244 (
a22fa26d6, the fake image starting on a page,LEONIDA-LUA-SCAN-END-3193), and on thatmain:So: close rather than merge — the fix is in, and a second branch changing the same line is a conflict waiting to be resolved for nothing.
Thank you for having it right, though: the dangling-link test is the one that caught
Runtime::newbecoming infallible, and that a test had to be updated for it is the reason the change was noticed at all.Written with an AI assistant.
@eipastel on GitHub · 2026-12-03 01:47 UTC · original
Closing for now; the weapons work depends on #3114, which is still open. Will reopen once it lands.
@matthieupl87-spec on GitHub · 2026-12-03 13:26 UTC · original
Hi @eipastel, thanks for Get all weapons. I tried it in game today on 1.0.2.1 (your 3 commits cherry-picked onto my local build, which has #3114; not your branch head). No crash in any run, but the inventory seems to get stuck after a few adds. What I saw, from the action log:
Get all weapons (one press)
65 of 131 given (2 not taken). The weapons show up in the inventory and in hand.One weapon at a time (same
givepath, one item per call)WEAPONSPEC_*_DEFAULTitem (after checking the registry files it as typeweapon).0(0 of 1 given), thoughcan_addsaid yes. In one session, 58 different weapons in a row (sniper FF-50 included) all came back0. After that, the weapons the player has can no longer be used.My guess, not checked: each add leaves something unfinished, maybe because the 0x70-byte callbacks block is all zeros, so nothing completes the transaction. After a few, the inventory stops taking adds and the weapon in hand stops working. Rounds alone are not it:
GET_PED_AMMO_TYPE_FROM_WEAPONgave0for these items, so I could not top them up by natives.Also from the registry, in case it helps: 27,114 items. Type
weaponx131,ammox28,currencyx4 (currency_cashplus 3 unnamed).WEAPONSPEC_MELEE_GOLFCLUB/HAMMER/PIPEWRENCH/SWITCHBLADE_DEFAULTare not weapon items there.One crash earlier, possibly related: after adding
WEAPONSPEC_PISTOL_CIVILIAN_DEFAULT, switching weapons ended the title with a read of0xa0f6d6a7, which is that item's hash, used as an address. It happened once and I could not reproduce it.Not merged into my daily build. Happy to run a branch of yours in game and post the logs.
AI-assisted (Claude Code).
Pull request closed