fix(debug): Inventory edits made while the game's menu is open arrive as asked and in order, and a long pause no longer drops them (#2980) #3030
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3030
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/debug-inventory-modapi"
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
Reworked onto #3069. HumanBean's #3069 (
73944b9c) rebuilt the Inventory page and gave the Cheats mod its own queue of the edits the game hasn't taken yet: it fixes the edits lost one into another that this PR first fixed. This PR is now only what that queue still gets wrong, on top of it. The earlier version of this branch (7a59ceaa) is replaced.#2980 on
mainnow: with the game's pause menu open, the Inventory page's edits still go wrong in three ways.How to see it on
main:Why it happens:
game-core's state says "title" once Link hasn't updated for 90 s (IN_MAP_NS). The Cheats mod then locks the rows ("Load a save first.") and drops its edits. The same reading empties the mods' save data inapi's storage (playthrough_gone, every store emptied): any mod with save data loses it after a long pause.What this changes:
Changesingame/mods/cheats/src/system_mod.rs). The changes waiting go to the game one row at a time, oldest first: each is worked out from counts that show the one before it. A row changed again moves last. A row the counts show as asked already sends nothing. With the game running and one row changed, nothing is slower; with several rows waiting, each takes about a second more (two reads of the counts, 500 ms apart).OutandEXPIRYinsystem_mod.rs; BeanBot's L1). The game makes a pouch's change, a song's flag and the rupees some updates after it takes the edit, so "none queued and two reads" was a guess. A change sent is now done only when the counts show its row as asked; or changed and the same at two reads in a row (the game made less or more: a bag's most); or after 6 reads (about 3 s of Link's updates, the counts' reads stop while he doesn't update) with neither, when the game turned it down, and a line in the log says so. A row keeps the player's value while its change is out (Changes::stands).INVENTORY_UNLOCK201,INVENTORY_RELOCK202 ingame/crates/game-core/src/debug.rs). Each does nothing when Link already holds the item, or holds none of it, so an edit worked out from counts that don't show an earlier change yet (the game makes a pouch's change after it takes the event) can't undo it. A song's edit too (the game's own setter, as #3089). The menu sends them (inventory_actionsindebug_tab.rs);INVENTORY_TOGGLE(200) stays for the input recordings and the tours that send it (scripts/tours/route.py).state.rs). The title now also needs nothing holding the game still in its own pause manager: its pause menu's and game over screen's pauses (pause::MENU_TYPES, which the API'sgame.pausedalready reads) or a mod's (DebugPause,game.pause()). The manager is read every time, with no timing. Where this build can't read it, the pause menu's screen having updated in the last 200 ms counts (menus::up_now).Read first:
Changes::edits,OutandChanges::holdinsystem_mod.rs;inventory_editindebug.rs;mode_ofandheld_stillinstate.rs.Fixes #2980
See #3069
See #2990
Testing
Tested: Windows 10 (build 19045), RTX 4090, driver 617.42, headless, through the PC's job queue.
The acknowledgement (head
a2f85e801, testaa5e66e6c, onmain2d87a5c9a; the runtime was built from64ff5f0f7onmain4d3b41c56, the same two commits before a clean rebase (git range-diffshows both unchanged, andmainsince doesn't touch these files' code: onlyCargo.locklines of another crate)):main-20261205-143559: Lens, Magic Beans, Mask of Truth, Fairy Bow, then Quiver with the pause menu open for 132 s. Every edit arrived in order; the Bow gave its Quiver and the Quiver row then sent nothing; at the end Lens 1, Beans 4, Mask of Truth 1, Bow 1, Quiver 1. Gold Skulltula Tokens by 100 Right presses: exactly 100.l1-main-20261205-143929(quick reversals): paused Magic Beans 0, 1, 0:+1then-1, ends 0. Paused Epona's Song unlocked then relocked: ends locked (the relock replaced the unlock while it still waited). With the game running, Lens checked then cleared:+1then-1, ends 0.main-20261205-144202: four edits under a 133 s pause; the rows stayed choosable past 90 s, and all arrived after it.not in the game's counts after 6 reads), and nothing was dropped.Before the acknowledgement: after is this PR's fix at
9e68a372, which has the same code as the pushed heada9b8bdd0(only tests were added after it); before ismainatca830e89. Neithermaincommit since changes these files. Each side is a runtime built from its commit alone.Each run used the repository save
kokiri-start(Kokiri Forest, child) with Enable cheats on. It opened the game's pause menu and checked that the game's frame count stopped. Then, under the Insert menu (Debug > Cheats > Inventory), it made its edits, closed both menus, read every row it touched, then with the game running pressed Right 100 times on Gold Skulltula Tokens, from 0.9e68a372; runmain-20261204-085746): Lens of Truth, Magic Beans, Mask of Truth, Fairy Bow, then Quiver, with the pause menu open for 126 s. The log once it closed:+1, then about+13each).ca830e89; runmain-20261203-215758): Lens, Bow, then Quiver, with the pause menu open for 78 s. The Bow gave its Quiver, thencheats: inventory Item_Quiver_Small -1 (had 1, now 1, event status 2): Bow 1, Quiver 0 at the end. Gold reached 100.ca830e89; runmain-20261203-220020): the Lens unlocked 11 s into the pause, which then stayed open. Past 90 s no Inventory row could be chosen (the menu's focus fell to the Debug tab). After the pause menu closed, the Lens never arrived. Five earlier runs with more edits stopped the same way at about 90 s.9e68a372, windowed, Pause in background on; runhand-20261204-093607): the game's pause menu open past 90 s, with Alt+Tab away and back while it was open (the game held 13 s, 22 s, 172 s, 307 s, 1028 s, 18 s and 99.5 s), Inventory edits made under it before and after. The rows stayed choosable throughout. Every edit arrived once the pause menu closed, none dropped: then the same rows unchecked (Weapon_Range_Bow -1,Item_GlassTruth -1,Item_Arrow_Normal -30), and after the long holds the Bow, its Quiver and the Lens again. An edit shows in the game (its pause menu's item tabs included) only once the game runs: the game makes it in its own event, as onmain.64ff5f0f7, windowed, Skip title screen off; runhand-l3b-20261205-153245): an Inventory edit made under the game's pause menu, then to the title through the pause menu's System page and a save loaded, once within 90 s and once after more than 90 s at the title. Both times the edit was not made while the pause menu was up, the Inventory rows were locked ("Load a save first.") as soon as no save was loaded, and Link did not have the item once the save had loaded: the edit was dropped. The log has nocheats: inventoryline for it (the rows' changes and the queue are emptied at the title without one).The checks:
The tests. The test commit (
aa5e66e6c) adds eight that fail onmain, each for the bug's reason:a_bow_and_then_its_quiver_asked_while_the_game_takes_nothing_both_arrive: Quiver 0 at the end.changes_waiting_reach_the_game_in_the_order_made: the first mask asked is the one held.an_amount_asked_after_the_bag_it_needs_is_the_amount_asked: 30 bombs, not 10.a_pause_is_no_title_however_long_it_lasts: Title.a_thing_given_and_taken_back_before_the_game_shows_it_ends_taken_back: the Kokiri Sword checked then cleared before the game made the first change: sword 1.an_amount_changed_again_before_the_game_shows_the_first_is_the_amount_asked_last: Bombs 30 then 10: the 10 sent before the 30 showed.an_edit_the_game_turns_down_holds_the_next_change_a_while_not_for_ever: the next change went before the turned-down one could show.an_amount_the_game_caps_lets_the_next_change_go_once_the_counts_hold_still: the next change sent before the capped 20 showed.The four new ones use a pouch whose changes wait for the game's next update (
Pouch::later), with a cap and a refusal.The Cheats tests run the mod's own queue (
Changes) and the game side's own edit (game_core::debug::inventory_edit) over a pouch on the stand-in host (items.pouchCountanditems.addOrRemovefaked). They include counts read before an earlier edit showed, as the game makes a pouch's change late. The fix commit addsa_songs_unlock_or_relock_asks_for_that_whatever_it_finds. The test commit's two seams do nothing yet:Changes::hold, andmode_of'sheld.Here they pass. game-core 446 (on
2d87a5c9a), sysmod-cheats 67. Mutants caught: each of the acknowledgement's three rules, the cap rule without its two reads or without "changed", the expiry at 3 and at 20, the old two-read rule, all rows at once, a row's place kept, a toggle sent, an unlock or relock as a toggle. Not caught: the Follow usingholdsinstead ofstands(the mod's frame has no game-free harness; the runs above show the rows keep the value), the two-read minimum removed (the three rules already need later reads),asked()'s clamp (the menu can't ask past it).What the tests don't model: the other bags' fill, a change the game makes more than 6 reads later (the expiry then lets the next go: the case BeanBot found comes back for that row), the steps of a split amount made at different updates, songs, bottles and rupees through the Cheats path (the game-core song test covers the ops), and the pause manager itself (
held_stillis reached only in the game).Linux, WSL (
64ff5f0f7, the head's tree, againstmain4d3b41c56): nothing fails here that doesn't fail onmain.run_all --strict879 passed / 58 failed / 13 skipped on both, the same 58 checks (main's Linux failures: gpu/vk fixtures without<format>,test_cheat_items' pouch-name order,test_i18n_complete's missing Fill title screen and aspect-ratio translations,test_dev_update). The host compile check: Linux 83 units and Windows (llvm-mingw) 81 units, 0 failed on both.cargo test: game-core 443, sysmod-cheats 67, none failing (main441 and 60).test_menu_i18npasses.A cold review of the acknowledgement (
64ff5f0f7) found nothing blocking. Not changed, named here: a count already at its cap asked higher (Bombs 20 in a 20 bag set to 30, a full wallet) changes nothing, so the next change waits the 3 s expiry and the log line shows; the two-read minimum also costs about 500 ms a row that the rules no longer need.A cold review of the first version (
ec95ea73) found that the pause menu's 200 ms signal goes stale when frames stop (pause in background, a long stall), and that a batch of edits could still undo one another. Both are fixed: the title rule now reads the pause manager, and the changes go one row at a time. Two more cases became tests.Still to test: None. (Not run: the title reached from the game over screen.)
Measurements
Nothing to measure: a change to the Debug tools' Inventory page and to how the host tells the title from a pause. The title rule reads the pause manager's 20 entries once per call to the state (bounded reads, as the API's
game.pauseddoes). Rendering and presenting are untouched.Risks
storage), the API'sgame.mode, the cinematic skip and the save watch. Each of those then sees what it sees in a short pause.main: the Cheats mod empties its changes and the queue as soon as the counts show no save loaded (the rows lock then, not after 90 s), so the next save loaded doesn't get them (seen by hand, within and after 90 s).Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (Linux run in Testing: nothing fails here that doesn't fail onmain;main's clippy, schema-gen and four cargo tests named there.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (On the test commitaa5e66e6c, the eight new tests fail, each for the bug's reason.)tests/that reads changed source is updated, not weakened. (None needed a change: the ones readingCargo.lockand the Cheats mod's files pass unchanged,test_cargo_lock_sources,test_cheat_items,test_pipeline_tour,test_menu_ini_keys,test_option_idsamong them;test_lifterfails the same onmain.)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
https://claude.ai/code/session_01VxeaZj1iUjCGWg1VCi3CZq
Tested in game: Windows 10, RTX 4090, driver 617.42, headless through the job queue, repository save kokiri-start, Debug tools on. On
7268665b(runtime from the commit alone): six Inventory edits made under the game's pause screen (Lens, Beans 3 then 5, Mask of Truth, Keaton Mask, Fairy Bow) all reached the game in the order made once it closed, the Bow with a Quiver first; the Amount read while paused was each count set; 100 Right presses on Gold Skulltula Tokens gave 100 steps of +1. Before, on mod-api582b6a1ab: only the Bow arrived (no Quiver), the Amount went back to 0 each time, and the Gold presses overshot. Log lines in Testing.Screenshots of the same spot, Debug > Cheats with Magic Beans chosen, taken right after setting its Amount to 5 with the game's pause screen open underneath (headless, kokiri-start).
Before (
mod-api582b6a1ab): the help says nothing about the pause screen, and the run read the Amount as 0, the count the game last had.After (
7268665b): the help says changes wait while the game's menu is open and apply in the order made, and the run read the Amount as 5, the count waiting.The slider runs to 999, so 5 and 0 look the same in it; the counts come from the run's reads of the setting (Testing).
@review
Recommendation: Request changes. A second edit can be discarded while an earlier pouch event is still in flight, leaving the inventory at the wrong count. The Bow and Slingshot bag fix also addresses a separate bug and should be reviewed separately under the repository’s one-topic rule.
The change queues Inventory edits, displays their requested counts, and gives a Bow or Slingshot its smallest bag when needed. The reported game run shows the main paused-menu and large-amount cases improving, but the queue can still lose a rapid reversal.
Blocking (2): must change before merging.
game/crates/game-core/src/debug.rs:320: A new edit is calculated from the pouch count even when a previous edit’s event has been sent but has not yet been applied. (more on the line) Do: Track outstanding pouch changes until they are reflected in the game, or defer calculating the replacement until the prior event has applied. Add a test whose fake pouch applies events later and exercises a rapid reversal.game/crates/game-core/src/travel.rs:1407: The weapon bag fix is a separate bug fix bundled with the Inventory edit queue, contrary to the repository’s one-topic rule. (more on the line) Do: Move the weapon-to-ammunition mapping and its tests into a separate pull request.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
game/crates/game-core/src/debug.rs:282: The save-boundary behavior still needs the in-game run identified in the PR. (more on the line) Do: Run the described pause-menu-to-title and load-save scenario once in game, confirming that the edit is dropped.@fixcan do L1 and L2.Checks: Still running:
PR description / Title and description (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Yes for the cases tested: on Windows, the reported head run delivered all paused edits and 100 token presses as 100 +1 steps; the base delivered only the last paused edit and overshot the token count. The return-to-title case remains untested in game.
Other systems: The queue runs in Link’s update and interacts with delayed pouch events, input recording, map loading and other Debug actions. The reported run covers normal play and paused edits; the game-free tests model immediate pouch application and do not cover an event still in flight. Rendering, saves’ format, audio and input bindings are unchanged.
Switches: None.
Reviewed:
7268665bd4against582b6a1abf: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff and commit messages; inspected the changed code and its inventory, loading, playback and menu callers. The available output for the complete changed files was truncated, so not all unchanged portions of debug.rs and travel.rs were read. docs/review-checklist.md and the adjacent Tooling checkout were absent. Screenshots were described in comments but their attachments were not available for inspection.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code, tests or scripts were run. The PR reports a Windows in-game comparison and game-free tests on Linux.
Overlaps and merge order: The description identifies #2990 as the main-branch version to close in favor of this port; no other overlap was established from the supplied evidence.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -171,0 +279,4 @@/// Each frame the game presents, while the Debug tools are on (the Cheats mod's frame, the main thread): `loading`,/// whether the game is loading a map ([`crate::session::loading`]). A map loading drops the edits waiting, before/// Link's first update in it: after a return to the title they were the last save's.pub fn inventory_frame(loading: bool) {L3 (should fix): The save-boundary behavior still needs the in-game run identified in the PR.
When: An edit left waiting while returning to the title must be dropped before the next save’s Link update; the unit test supplies the loading signal directly and cannot verify when the game presents it.
Do: Run the described pause-menu-to-title and load-save scenario once in game, confirming that the edit is dropped.
@ -171,0 +317,4 @@}return 0;};e.left = Some(inventory_actions(e.item, e.amount, have, e.want));L1 (blocking): A new edit is calculated from the pouch count even when a previous edit’s event has been sent but has not yet been applied.
When: Starting at zero, set an item to 1, then set it back to 0 before the first pouch event applies. The second edit reads 0, produces no actions and is removed; the first event can then apply, leaving 1 instead of the requested 0.
Do: Track outstanding pouch changes until they are reflected in the game, or defer calculating the replacement until the prior event has applied. Add a test whose fake pouch applies events later and exercises a rapid reversal.
@ -1397,0 +1404,4 @@/// The weapons that shoot ammunition, and it: the Fairy Bow and the Fairy Slingshot. Unlocked with none of its bags/// held, every arrow or seed picked up after stayed 0 (#2416), so a weapon added gives its smallest bag first, as the/// game's chest does.pub const WEAPON_AMMO: &[(&str, &str)] =L2 (blocking): The weapon bag fix is a separate bug fix bundled with the Inventory edit queue, contrary to the repository’s one-topic rule.
When: The Bow and Slingshot can lack ammunition bags even when no Inventory edit is queued; correcting that behavior is independent of preserving queued edits.
Do: Move the weapon-to-ammunition mapping and its tests into a separate pull request.
7268665bd4a9e8fcd14ba9e8fcd14bb75e4f0823WIP: fix(debug): the Inventory rows keep every edit made while the game's menu is open, in order, and an unlocked Fairy Bow or Slingshot comes with its bag (#2980, #2416)to WIP: fix(debug): the Inventory rows keep every edit made while the game's menu is open, in the order made, and an Amount of more than one step arrives whole (#2980)Answers to BeanBot's review of
7268665b(review 3105). The head is nowb75e4f08.L1 (a replacement begun before an earlier change shows in the pouch count): the game shows each change in the item's count by Link's next update. Each edit is begun in a later update than the step before it (one action per update), so it starts from the count after that step.
7268665bthe Bow's unlock gave a Quiver, and a Quiver set to 1 was taken in the very next update. If the count were still 0 there, its edit would have been an unlock toggle, taking the Quiver back off. The log has no Quiver action: the edit found the Quiver held and had nothing to do.had 0,had 1, ...had 99: each step read the count the one before had just made.L2 (one topic): split out. The Fairy Bow and Slingshot bag is now #3033, with its own test and in-game run. This PR no longer touches it, and the two merge cleanly in either order.
L3 (the return to the title): still in Still to test, for a run by hand. The headless driver can't go through the game's own System menu to the title and a save list. In the tests,
inventory_frame(true)stands for that load.Since the review, a second cold review found three changes to the fix that no test caught. Each now has a test: an edit replaced while its count is read, an edit whose item never gets a count, and an Amount set back to the count the page read. In-game results for the head are in Testing.
WIP: fix(debug): the Inventory rows keep every edit made while the game's menu is open, in the order made, and an Amount of more than one step arrives whole (#2980)to fix(debug): the Inventory rows keep every edit made while the game's menu is open, in the order made, and an Amount of more than one step arrives whole (#2980)b75e4f08237a59ceaa0fL1 is fixed, the reviewer's defer option. An item's next edit is not begun until the game's count shows the last change handed over; it then begins from that count. The other items' edits go on meanwhile. A change the game never shows (refused) holds its item's next edit for 120 of Link's updates (about 2 s at 60) with a log line, then it goes on from the game's count. A map loading or the Debug tools off drop these changes with the edits waiting.
The earlier answer no longer held because
1a86a938(#3089) made a song's edit go through the game's own setter, applied at the game's next update. A change can outlive the update that handed it over, so a replacement has to wait for the count rather than assume the next update shows it.The test commit (
4f3476b6) adds the tests, with a game fake that applies a change later and refuses some. On it alone, 24 game-core tests fail, each new one for the bug's reason (only the slot's last edit taken; setting 1 and back to 0 leaves 1; a song unlocked then relocked ends(true, true)). At the head7a59ceaa: game-core 419 pass, sysmod-cheats 54 pass, 25 of 25 mutants caught, the two i18n checks pass, rustfmt has nothing to say about this diff's files. Linux (on60b0d627againstmain1780f597): the strict suite 824 passed / 52 failed / 12 skipped againstmain's 826/50/12; the two head-only fails were the i18n checks, fixed by the strings and passing now; every other failure and skip is the same on both.A cold review of
60b0d627found that the tools' own Teleport or Switch age dropped the edits it should keep. That load now keeps them: the action is noted when Link's update takes it, and a frame that finds a map loading within 5 s of it keeps the edits waiting and the changes not shown yet and logs why; any other load still drops. Three tests cover it, and four more cover the review's surviving mutants. The head is7a59ceaa. In game, with the pause screen open, the Bow and Magic Beans 3 entered before a Switch age or a Teleport arrived after it (runsage-after-20261203-123839,teleport-after-20261203-124110); onmainboth were lost. The two edits were taken during the fade, before the load began, so the keep itself was not reached in game; the tests cover it.In game (Windows 10 build 19045, RTX 4090, driver 617.42), after
7f70253d(the same code as7a59ceaa) againstmain1780f597(runl1-after-20261203-123522): with the pause screen open, Magic Beans set to 0, then 1, then 0 ended 0, and Epona's Song unlocked then relocked ended locked, with no cheats lines (once the game made the earlier change there was nothing to change); with the game running, the Lens unlocked then locked logged+1 (had 0 ...)then-1 (had 1 ...)and ended locked; no expiry or drop lines. Before, onmain: Magic Beans 1, Epona's Song unlocked, the Lens unlocked.L2 is #3033, merged (
e229c0c2). L3 is still to test by hand: through the game's System menu to the title and load a save.7a59ceaa0fa9b8bdd0e3fix(debug): the Inventory rows keep every edit made while the game's menu is open, in the order made, and an Amount of more than one step arrives whole (#2980)to fix(debug): Inventory edits made while the game's menu is open arrive as asked and in order, and a long pause no longer drops them (#2980)Reworked onto #3069; the head is now
a9b8bdd0(test5429d9b3, fixa9b8bdd0, onmaind6e819e0).#3069 gave the Cheats mod its own queue of the Inventory page's edits, which conflicted with this whole branch. That queue fixes the edits lost one into another, so the earlier version here (
7a59ceaa, its own queue ingame-core) is dropped. This PR is now only whatmainstill gets wrong. I ranmain(ca830e89) in the game with the pause menu open:main-20261203-215758).main-20261203-220020). The same reading empties the mods' save data inapi's storage.The fix:
The description has the details. A cold review of the first version found the pause menu's 200 ms signal too weak (pause in background) and a batch that could still undo itself; both are fixed and tested.
BeanBot's review 3105 was of
7268665b, the old design; nothing it names is in the code now. Its L1 (an edit from stale counts) is whatmain's queue and the explicit unlock/relock cover here. L2 (#2416) merged as #3033. Its L3 (a title load with edits waiting) is unchanged frommain, and is now under Risks.In the game, after (
9e68a372, the same code as the head), runmain-20261204-085746: Lens, Magic Beans, Mask of Truth, Bow, then Quiver, with the pause menu open for 126 s. Every edit arrived in order, the Quiver was kept, and Gold reached exactly 100. Linux: nothing fails here that doesn't fail onmain.The hand test from Still to test has run; its result is in Tested. Windows 10, RTX 4090, the fix at
9e68a372(the head's code), windowed with Pause in background on. The game's pause menu stayed open past 90 s, with Alt+Tab away and back while it was open (holds of 13 s to 1028 s), and Inventory edits were made under it before and after. The rows stayed choosable throughout, and every edit arrived once the pause menu closed: the Bow with its Quiver, the Lens, then the same rows unchecked, then all three again after the long holds. An edit shows in the game only once it runs again (the game makes it in its own event), as onmain. Still to test is now None; nothing in the code changed.@review
Recommendation: Request changes. A later inventory edit can still be calculated before an earlier event has changed the count. The save-boundary behavior also lacks the identified in-game run.
The change orders pending inventory edits, uses explicit unlock and relock operations, and keeps long pauses from being mistaken for the title screen. It adds up to roughly one second per queued row, but its fixed read delay does not guarantee that an earlier edit has taken effect.
Blocking (1): must change before merging.
game/crates/game-core/src/debug.rs:320: A new edit is calculated from the pouch count even when a previous edit’s event has been sent but has not yet been applied. When: Starting at zero, set an item to 1, then set it back to 0 before the first pouch event applies. The second edit reads 0, produces no actions and is removed; the first event can then apply, leaving 1 instead of the requested 0. Do: Track outstanding pouch changes until they are reflected in the game, or defer calculating the replacement until the prior event has applied. Add a test whose fake pouch applies events later and exercises a rapid reversal.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
game/crates/game-core/src/debug.rs:282: The save-boundary behavior still needs the in-game run identified in the PR. When: An edit left waiting while returning to the title must be dropped before the next save’s Link update; the unit test supplies the loading signal directly and cannot verify when the game presents it. Do: Run the described pause-menu-to-title and load-save scenario once in game, confirming that the edit is dropped.@fixcan do L1.Since the last review (on
7268665bd4)Resolved: L2 (The weapon bag fix is a separate bug fix bundled with the Inventory edit queue, contrary t…)
Still open: L1 (A new edit is calculated from the pouch count even when a previous edit’s event has been s…); L3 (The save-boundary behavior still needs the in-game run identified in the PR.)
Checks: Still running: 10 checks.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported Bow and long-pause cases: the described Windows runs kept the Quiver and delivered edits after a 126-second pause; the base lost the Quiver and dropped an edit after 90 seconds. The stale-event case remains unresolved.
Other systems: The mode change also affects mod storage, game.mode, cinematic skipping and save watching. The reported long-pause run covers Windows; the description reports Linux game-free checks but no Linux game run.
Switches: None.
Reviewed:
a9b8bdd0e3againstd6e819e084: Read the repository rules and pull request template, the diff, state.rs, debug_tab.rs and the relevant queue and inventory-edit code and tests. The larger changed files and generated Cargo.lock were skimmed; docs/review-checklist.md and the adjacent Tooling rules were unavailable.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run code were executed. The author reports in-game Windows runs and game-free checks; CI is still running.
Overlaps and merge order: #3069 is incorporated in the base; #3033 is reported merged.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@fix
a9b8bdd0e334d4fa4056Recommendation: Request changes. A later inventory edit can still be calculated before an earlier event’s effect appears in the counts, leaving the requested amount wrong. The reported runs do not cover the outstanding save-boundary case.
What
@fixchangedI changed this pull request: the new head is
34d4fa4056. I rebased it ontomain(4d3b41c56f).Not done
Nothing was built or run: the checks run again on the new head.
The change orders queued inventory edits, uses explicit unlock and relock operations, and prevents long pauses from being mistaken for the title screen. It improves the reported Bow and long-pause cases, but its two-read delay does not guarantee that earlier changes have reached the inventory.
Blocking (1): must change before merging.
game/crates/game-core/src/debug.rs:320: A new edit is calculated from the pouch count even when a previous edit’s event has been sent but has not yet been applied. When: Starting at zero, set an item to 1, then set it back to 0 before the first pouch event applies. The second edit reads 0, produces no actions and is removed; the first event can then apply, leaving 1 instead of the requested 0. Do: Track outstanding pouch changes until they are reflected in the game, or defer calculating the replacement until the prior event has applied. Add a test whose fake pouch applies events later and exercises a rapid reversal.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
game/crates/game-core/src/debug.rs:282: The save-boundary behavior still needs the in-game run identified in the PR. When: An edit left waiting while returning to the title must be dropped before the next save’s Link update; the unit test supplies the loading signal directly and cannot verify when the game presents it. Do: Run the described pause-menu-to-title and load-save scenario once in game, confirming that the edit is dropped.@fixcan do L1.Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported cases: the Windows run kept all edits through a 126-second pause and retained the Bow’s Quiver; the before run lost the Quiver. A separate before run dropped an edit after 90 seconds. The delayed-event case remains unfixed.
Other systems: The mode change also affects mod storage, the game API, cinematic skip and save watching. Windows long-pause behavior was exercised; the title-to-save boundary remains untested. Linux checks were reported against main, but no Linux game run was reported.
Switches: None.
Reviewed:
34d4fa4056against4d3b41c56f: Read AGENTS.md, CONTRIBUTING.md, state.rs and the Cheats manifest; inspected the full diff for the changed Rust files and the relevant inventory queue and game-side edit paths. Other changed files and surrounding code were skimmed; not every changed code file was read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The author reports Windows game runs and game-free tests; CI has not yet run on this head.
Overlaps and merge order: The PR is reworked on the merged inventory queue from #3069; #3033 is reported merged.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
34d4fa4056a2f85e801aBeanBot's L1 is fixed; the head is now
a2f85e801(testaa5e66e6c, onmain2d87a5c9a). It builds on BeanBot's rebase (34d4fa405), which is kept.L1, a change worked out before the last one showed: the next change now waits for the game to have the last one, instead of two reads after nothing is queued. A change sent is done when the counts show its row as asked. If the game made less or more (a bag's most), it is done once the row has changed and reads the same twice in a row. If neither happens within 6 reads (about 3 s of Link's updates; the reads stop while he doesn't update), the game turned it down: the next change goes and the log says so. While its change is out, the row keeps the player's value. This is
OutandEXPIRYinsystem_mod.rs.The four new tests use a pouch whose changes wait for the game's next update, as asked. Each fails on the test commit:
In the game (Windows 10, RTX 4090, 617.42, a runtime of the same two commits):
The Linux suite is the same as on
main. A cold review found nothing blocking; the two costs it named are in the description's Testing.L3, the title and a save loaded with an edit waiting: that one can't be driven headless here; a hand run is next. It is in Still to test, and the "Everything in Still to test" box is unticked until it has run.
BeanBot's L3 has run by hand; its result is in Tested. Windows 10, RTX 4090, 617.42, a windowed runtime of
64ff5f0f7(the head's code), Skip title screen off; runhand-l3b-20261205-153245.An Inventory edit was made under the game's pause menu. Then the run went to the title through the pause menu's System page and loaded a save, once within 90 s and once after more than 90 s at the title. Both times:
The earlier Risks line ("a save loaded within 90 s gets them") was wrong, and so was BeanBot's "Also noticed" note taken from it. The Cheats mod empties its changes and the queue as soon as the counts show no save loaded, not after 90 s. Risks now says so. Not run: the title reached from the game over screen.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.