WIP: fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretched #2817
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2817
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/widescreen-system-overlay"
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 a picture wider than 16:9 with Ultrawide menus at Centred (blurred sides or black bars), the system screens' header and button prompts are stretched sideways: the file select's Back, the save list's, Options'. To see it on
mod-api: 21:9, Ultrawide menus Centred, title screen > Continue, the prompt at the bottom right.The Centred modes keep the system overlay (
SystemOverlay_00) over the whole picture because it also draws the item wheel's background, so everything in it is drawn ratio / (16/9) as wide as it should be (1.34 at 21:9). This keeps the overlay whole and draws two of its panes,N_Header_00andN_Footer_00, at their own shape in the middle 16:9, with the rest of the menu. "Full width" still stretches, as it asks to. "Extended" already plans the overlay and is unchanged.Read first:
Rule::Squeezeingame/mods/widescreen/src/names.rs,whole_squeezeinui.rs,placedandnote_squeezedinpanes.rs.Testing
Tested: Windows 11, RTX 3080, a build of
mod-api4c498c8aawith this branch, #2642's clickable prompts and the save slots branch merged (c9c84b690), headless through the control bridge with the sandbox off (HOS_SANDBOX=0), against plain4c498c8aawhere it says so. Not run with this branch alone.HOS_ASPECT=2.3889), Ultrawide menus Centred, title screen > Continue: onmod-apithe "Load" header and Back run over the whole width; here both are in the middle 16:9 at their own shape.mod-apibeside it).cargo test -p sysmod-widescreen: 59 pass (58 on plainmod-api; the new one is this fix's).cargo testfails on the same four tests here and on plainmod-apion this PC, and on no other:apia_content_mods_changed_module_runs_again_and_its_outputs_are_served,longshot-gamea_folder_of_mods_tests_each_of_its_folders,a_mods_profile_sits_inside_the_launchers_save_folder,a_separate_mod_moves_the_saves_into_its_profile_and_records_it.cargo fmt --checknames the same four files as plainmod-apidoes. The checks undertests/: 19 fail here and the same 19 on plainmod-apion this PC.mod-apiwas squashed to9e6b9c578as this opened, so until the branch is moved onto it the diff here shows the old history as well: only the top commit is this change. The commit applies to9e6b9c578unchanged; it has not been built there.Still to test:
Measurements
Not measured. A layout being built costs one more name check; the two panes' matrices are set where the mod already sets the layout's.
Risks
The Widescreen mod only: a pane of
SystemOverlay_00that is not under its header or footer keeps its place. A layout being built costs one more name check (its root's). No setting, save or cache changes; a revert is enough. #2767 (onmain, in C) changes the same area's live switch of Ultrawide menus and is not in here.Checklist
Ready for review
mod-api; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmod-apiis named). Not run whole yet: the crates' tests above.mod-api, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mod-apiand passes here (a_system_overlay_kept_whole_has_its_header_and_prompts_at_their_own_shape_in_the_middle).mod-apiand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
mod-api, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
The mod API's game services of host/game/{camera,pad,player,rays,state, texts,watch}.c, typed: the camera's last view and override under sequence counts, the pad over the host's publish, Link and the game's state read bounded, the rays' lock-free slots, the texts' pool and the watches of maps, saves and flags. Fixed on the way: a build naming no actors.vtable took any actor whose first word is 0 for Link; a NaN replacement stick was undefined behaviour; the texts' reads of the screen and names are bounded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEthost/game/{items,rewards,rules,skips,songs}.c, typed: the items' watch on its own sites, give, take and the pouch's counts; the placement drops, event gifts, shop prices and bottle fills; the damage, actor-life and scale rules with their tables laid out as the C's; the mods' skipped events and the song names. Caller gains stack_pointer, for the bindings that build a frame below the caller's stack; travel takes the pouch's counts as the service now gives them. Fixed on the way: a build naming no life vtable took a component reading 0 named Player for Link; the song list read before the RomFS index was ready stayed empty for the run; the items' sinks are told after the poll lets go of its state, so a sink that gives an item no longer deadlocks; the damage and actor-life tables are published both or neither. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEthost/game/{actors,spawn,queries}.c, typed: the actors.update site's lock-free record, the list and its generations, the mods' writes with their tickets and lit bombs, spawning and despawning with #68's gate and the respawn flags, and the answers to the behaviour-tree queries. Their tables keep the C's layout; longshot-game exports the hos_* functions the lifted rule C calls around the safe Rust. Fixed on the way: a build naming no controller method or no actors.vtable matched a slot or first word of 0; a write its site marked dropped was counted as made; a list slot's generation could wrap to 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEthos_rules_*, hos_rewards_*, hos_actor_{writes,binds,lights} and hos_query_answer: each casts the table the site loaded back to oot's and calls its safe function; a null table leaves the game's value. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEthost-sys fpe::{fma32, div32} over builder/rt's recomp_fpe_fma32/div32 (the stand-in host: the host's own float ops); GuestCtx::fpe_fma32/fpe_div32 take and give a float's bits as u32. oot's steer rate passed them as u64: now u32. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueGuestPtr<u8|u16|u32|u64>::{load_atomic, store_atomic, compare_exchange, fetch_or}: checked as read and write are, sequentially consistent, a write's pages marked. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puefeatures::{mouse_camera, prompts_text_draw, prompts_text_layout, prompts_glyph, jitter_clip} over mouse_native.c, prompts.c and rx_backend.c; sites::{zstd_stream, zstd_frames, scene_format, dynres_*, fixed_scale_*} as function pointers for Handler::C (hos_zstd.c's decodes, oot_sites.c's renderer callbacks); no-op callbacks under fake. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puemem::sys_alloc (hos_sys_alloc), romfs::{head, read_zs} (hos_romfs_head, zs.c's hos_zs_read_romfs), files::{romfs_rel, resolve_read} (nn_fs.c), info::main_image (the generated image.c's hos_main_*), each with the stand-in host's. On the way: romfs::stat answered a folder as a file of size 0, and romfs::list took an empty folder for none and a missing one for an empty one (hos_romfs_stat gives 2 for a folder, hos_romfs_list -1 for none). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueinput::{flight_axes, free_camera_axes, move_stick_held, stick, drag, clear_toggles} over nn_hid.c; movie::{active, playing, action, action_taken, link, clock, menu, menu_take, menu_done, MenuChoice} over input_movie.c; mouse::{game_menu, game_menu_gone, game_pointer, wheel_take, left_held} over display.c. Two small C stand-ins declared in hos.h where the host had no function: hos_input_movie_clock (input_movie.c's static movie_clock, -1 with no recording) and hos_mouse_left_held (oot_menu.c's own GetAsyncKeyState test). The stand-in host keeps each as a test sets it and records what the code gave. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puesync::{available, wait_on, wake_all} and sched::{vcore_away, vcore_back, chain, note_slept, Chain}; paths::ab_value (hos_ab_side_now, hos_ab_value_at) and control::on (hos_control_on), the host's flags read as atomics. C stand-ins in hos_thread.c, declared in hos.h, where the host had none: hos_wait_bound, hos_wait_on, hos_wake_all (oot_barrier.c's WaitOnAddress binding, for any caller) and hos_note_slept (the thread-local Breakdown counter, which Rust cannot reach). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe Debug tools asked for "Page Up" and "Page Down", which are no keybind's names ("PageUp", "PageDown"): the host's key table knows neither, so the keys read up and the free camera and the flight could not climb or sink by the keyboard, as game/oot_tools.c's VK_PRIOR and VK_NEXT did. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueDeleted, each replaced by the Rust game/DESIGN.md's map names: - oot_tools.c (hos_main.c's game half: the Debug tab's tools, the bridge's game commands, the opening's skip, the save trace, Link's pose, game_init), oot_teleport_check.h: oot::{travel, session, debug, player} and longshot-game's control, input, cheats and perf (game_current_map, game_state, game_destination, game_teleport_*, game_age_ask, game_flight_shortcut_ready, game_live_action, hos_perf_info, hos_perf_tracking, game_init) - game_layout.c/h: longshot-game::layout (hos_game_layout, hos_game_layout_log) - flags.c/h: oot::flags Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puelongshot-game's host.rs declared hos_zs_read, hos_fs_save_root/_end, hos_mem_region, hos_game_language, hos_movie_stats and hos_wide_keep_mask itself; host-sys binds them now (files::zs_read, files::save_root, mem::region, info::{game_language, movie_stats, wide_keep_mask}), each with its fake branch, and game_host.h declares the save root's and the language's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puegame_host.h's hos_zs_content_size, hos_zs_romfs_content_size, hos_zs_write, hos_romfs_case and hos_prompts_font_entry, which the size table's fit needs: host_sys::files::{zs_content_size, zs_write}, host_sys::romfs::{zs_content_size, case} and host_sys::prompts::font_entry, each with its stand-in host's answer. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueGameMemory::copy_out read the guest window directly: on Windows a read of a heap page the game had not touched, or had given back, faulted and committed it. It is refused, as the C's memory.read refused it ("unmapped"). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puehost_sys::net binds game_host.h's hos_net_* (available, grant, open, send, close, poll -> Poll::{Event, None, Gone}), its fake an in-memory engine a test scripts (fake::net); the stand-in that answered every open "no engine" goes. host_sys::run binds hos_switch_set, hos_quit and hos_thread_background. has("net") and has("ipc") ask the engine for their own kind. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueaudio_mix as audio_mix.c: a sound loaded { stream: true } keeps its Ogg file's bytes, each voice of it gets a decoder of its own (the new AudioStreams and StreamDecoder traits) and a ring of 1.5 s, which the decoding thread opens and tops up 4096 frames at a time with no lock held, rewinding a looping one; the mixer reads the ring by the frame's number, silent and counted on an underrun. Limits: a streamed file 32 MB, 8 streamed voices a mod, 64 in all. The mixer's stand-ins go: each voice is resampled once from its sound's rate by its pitch, its gains ramped across the audio frame (a change, a placed voice's gain, a stop's fade), through its biquad low pass and into its mod's audio_dsp.h reverb, which rings out its tail with the mixer's gate open. Nothing is allocated or freed on the mixer thread. The game's groups move as audio_groups.c's. On the way: a file that cannot be read makes a failed sound, as the guide says, instead of an ArgumentError; voice.moveTo places a voice of play() from then on; setEffects past the mods' 8 reverbs is a LimitError; a call of more than 1024 frames is mixed whole (the C cut it short). longshot-game gives no decoder yet (the next commit). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue{"cmd":"mod_reload","mod":id} answers {} once Watch::request queued the reload (made at the next frame's end), or refused: no such mod, no folder script mod (a package, a system mod), or 32 waiting. The watch is taken from the loader at the bridge's first frame. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueSettlements queue Settled::{Whole, Part}: Settlements::part (and Promise::part) take an answer in parts from any thread, pending_bytes counts the parts not yet handed to the mods, and set_hooks tells a reader of a promise let go (its mod stopped) and of a settle that took answers. The engine parses each part in the mod's runtime and defines its members on the promise's array (one settlement of the frame's 64 each); the last resolves it, a rejection drops the parts, and a part that does not fit in the mod's heap rejects it with LimitError. content.read's reader thread sends what ContentReader::read_parts makes through a PartSink that waits while more than 8 MiB wait to be handed and stops a read whose promise was let go. longshot-game's reader sends a map's placements in parts of about 64 KiB (the C did; the whole answer was past what a value holds for a large map). Unit tests: the queue's bytes and hooks, the parts in order, a rejection after parts, and dev.keep's held object read back. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueQuickJS-ng 0.18 loads and resolves a module's imports while it compiles it, so realmModule's compile asked for every import before link() had given a linker, and any module with an import failed ("this context links only in link()"). realmModule now checks the syntax with oxc (Node's constructor throws a SyntaxError at once) and keeps the source; link() compiles it with the linker set, and a module it imports is compiled as it is loaded. The unused Context::resolve_module goes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe sandbox lets the game write only its own folders and the control socket's (host/sandbox_plan.h control_dir, which says shots go there), but the client asked for shots in the run's shots/ folder or wherever the caller named: with the sandbox on, as by default, every shot failed ("the PNG could not be written"). The client library asks the game to write a shot into the socket's folder under a name of its own, then moves it to the asked path itself, reading it through no link (the game can write that folder) and at most 256 MB. Game-free tests: the fake game refuses a path outside its socket's folder, as the sandbox does, and a session's shot still lands; a link left in the stage is not followed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueA player's fallback build of the game's Rust reads the tree the builder copies (build-driver's TREE), which has no assets/modding/docs; api's build.rs loads the schema, and the load refuses a module whose guide page is missing, so the fallback build stops ("guide assets/modding/docs/ui.md is missing"). This loads a small schema with a shipped JavaScript module and no docs folder; it fails now. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe old recorder wrote the renderer's answers for HOS_OPT_* 32, 33, 35, 36 and 55: 36 Link's speed in percent (100 to 300), 32 and 33 -1 while untouched or the tools off. The port hands them to menu::set as row values, so every recording's first line ({"cmd":"option","id":36,"v":100}) becomes choice 100, clamped to 3x, and -1 turns heart protection and flight on; a replay also wrote the player's settings and needed the replaying run's Debug tools. This checks the five at the first frame and changes after, with the tools off, and that a recording takes the same values back; it fails now. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puecurl_common pinned the checked address with CURLOPT_RESOLVE only when its list entry could be made: out of memory, the pin was skipped and libcurl looked the host up itself, past the private-address rule. curl_common now says when it could not pin the address, and the fetch or WebSocket fails ("out of memory") instead of connecting. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueTexture packs (gfx.textures) were gone from the Rust tree: no game side read a pack, the renderer had no override, and has("gfx.textures") was false. api::textures::start runs in game_init after the layers are published: each mod that loads and lists gfx.textures (Loader::texture_packs, a minimal hook beside romfs_root) has its recipe.json read and its textures/ named from the texture index (made once from the RomFS's .bntx.zs headers through the host's new zs stream binding), a later pack winning; each replaced texture's numbers come from the file the game is served, kept in modcache/texture_hashes.txt. An upscale recipe's job is written on an lsmod-upscale thread (the pictures decoded by the renderer's mkwvk_texture_decode, given the game as hos_texture_decode), and a done job's images serve the mod under its own. longshot-game exports game_texture_replacement*, which MkwVkHost version 54 hands the renderer. The renderer's half is the C era's: gpu/vk/texture_pack.h's two-stage lookup at a first whole upload, the override image used by sampled views of the whole texture, dropped when the GPU writes the texture or its storage changes, the resolved views and reused descriptor sets stale by texture_pack_generation; texture_decode.cpp decodes block-linear plain, BC1-BC5, BC7 and ASTC level 0. has("gfx.textures") is true. Game-free tests: api::textures's (ported from tests/test_texture_packs_host.py), tests/test_texture_pack.py and tests/test_texture_decode.py. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe stage's writer refused bwav: outputs ("the BWAV writer is not ported") and made bntx: from a PNG alone. It now makes each recipe with the content crate's makers: bntx: with recipe::make_bntx (PNG or KTX2), bwav: by decoding the mod's WAV or Ogg Vorbis (the audio service's decode, given the stage's Ogg decoder), reading the game's stream it replaces for its channels and loop, and writing the BWAV with bwav::from_sound. A game-free test makes a mod's mono WAV a stereo, looping stream served in the game's place. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueAfter a kept callback returned, its result was converted (its toJSON run, its getters read) with the deadline the call put back, none: the mod's code in toJSON ran with nothing to stop it but the stray-poll guard, and nothing said why. A callback returning `{ toJSON() { for (;;) {} } }` was cut only by that guard, silently. Both conversions (bind's callback_call and the engine's Runtime::call) now run under DESCRIBE_NS, as a filter's draft is read back and an export's answer is; a conversion the interrupt cut is the mod's OverBudget fault. The test needs the stand-in host's clock to move while the script runs (it stands still between a test's moves, so no deadline could pass): host_sys::fake::set_tick makes each read of it move it on. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueA text a mod sets (content.texts, its patches) was refused only for a NUL. U+000E and U+000F went into the message file as they were, and the game's MSBT reader takes them as a tag's header: it reads a group, a type and a size from the text after, and reads past the text's end. The C0 controls but tab, line feed and carriage return are now refused (text.control), naming the character; a tag is written {...}, which the game's files decode to. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puecamera.override(rig) took only { fov }; the spec's rig (an eye attached to Link, a look by input, pitch limits, a blend) was never built, and first person (10.5) needs it. A rig is now data oot::camera's view hook works out each time the game builds its view, so a view on Link has no frame of delay: attach "player" puts the eye at Link's feet plus an offset turned by his facing (his actor's position and rotation, bounded reads), look "input" or "fixed" looks along a yaw and pitch (the right stick turns an input rig at the acquire phase, 120 and 90 degrees a second, held to pitchMin and pitchMax), look "target" at setTarget's point, and blendSeconds eases in from the game's view. The handle gets setOffset, setAngles and angles(); a setter that does not fit the rig is a ContextError. bone, near, collide and drivePlayerFacing need what the game side cannot reach without new sites or layouts (game/README.md's Stand-ins says which). Tests: the rig on Link (his feet, facing, absent), its look by angles or point, the blend; the API's defaults, refusals and the stick's turn within the limits. The fake game draws a rig on game.player. Docs: camera.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puelongshotCheckout and trustedCheckout told a checkout by its scripts/dev.py and host/modapi/. The mod API moved to game/modapi/ with the game side's port to Rust, and host/modapi/ is gone, so no folder was a checkout any more: `longshot-mod test --game` on a mod inside the checkout (or with LONGSHOT_CHECKOUT set) no longer went through the checkout's dev.py, and longshotCheckout(HERE) returned null. The mod tools' tests 67 ("the game in its test mode, or dev.py game-tests inside a checkout") failed on its assert that the checkout is found, and 68 (audit N12) on path.join(null) when it set LONGSHOT_CHECKOUT to that checkout. The marker is now game/modapi/. Test 68's stranger repository makes an empty game/modapi/ in place of host/modapi/, so it still looks like a checkout and the audit N12 case (a dev.py found by walking up is never run) is still the one tested. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe game's test runner (game/modapi/testing/runner.js, copied for the fake game into lib/testing-runtime.js) lists in FAKE_ONLY the FakeGame members a test may use only in the fake game, so that the real game refuses them with FakeOnlyError. It still listed "native", the fake game's stand-in for native C mods, which was removed with them (feat(mods)!: native C mods removed): FakeGame has no native member. The mod tools' test 63 ("the fake game's helpers the real game refuses are the fake game's own") failed on it: "native is in the runner's FAKE_ONLY but not a FakeGame member". The list was wrong, not the test. "native" is out of FAKE_ONLY in runner.js, and lib/testing-runtime.js is written again from it by cargo run -p schema-gen. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueNothing ran assets/modding/packages/mod-tools/test/*.test.mjs: not tests/run_all.py, not a mise task, not the Forgejo or CircleCI workflows. The C era's tests/test_mod_tools.py did, and the test files still say it runs them, but it did not come over to this tree. So they broke unseen when the system mods moved to game/mods/, the mod API to game/modapi/ and the native C mods went (four of 92 failing). tests/test_mod_tools.py runs them with node --experimental-vm-modules --test and fails when node fails, any test fails or is cancelled, none passed, or the Node is older than 22 (the package's engines). Node is PATH's (or --node); with none it prints "SKIP: node not installed" and exits 0, the tests/ convention for a skip found at run time. It declares no {tool} placeholder on purpose: run_all.py's --strict fails any check whose declared tool is missing, and no CI image has Node yet. Its docstring says CI should install the Node release pinned in the file (NODE_VERSION v24.22.3 and its NODE_SHA256, release.yml's) once CI's migration is done. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe built-in registries (keybinds, hud, markers, commands) were lists mods shared with nothing in the game reading them: no keybind conflicts, no command palette, no marker layer, no way to move or hide a mod's HUD. services/shared.rs is the engine's side of them: - keybinds: every running mod's keybind settings (and its debug page's key), with the "keybinds" entries for keys bound another way, as one list; two that share a key (any case) or a chord (its buttons as a set, a setting's Switch labels read as PadButton's names) clash. - commands: { id, label, help?, args? } entries, each argument a toggle, a choice, a number or text with a default. Services::command_run checks the player's arguments against the entry as the mod gave it now and delivers "command" to its mod at the next together step; longshot/mods' command(entry, run) adds the entry and hears it. - hud: each mod's HUD roots by key (a <Hud id>, which Hud now takes with a title, else "#n" by mount order), labelled by the mod's "hud" entries; the player's place (another region, or hidden) is kept in the mod's store ($hudLayout, a host setting never on its page) and applied as the UI's snapshot is built. - markers: { x, y?, z, map?, label?, color? } entries of running mods on this map, as world-layer shapes (a ring, a line up, the label), published with the mods' own shapes by gfx.rs; made again only when the entries or the map change. The Mods tab's snapshot carries the view (TabSnapshot::shared), and its edits run a command (Edit::Command) and move a HUD root (Edit::Hud). A malformed entry stays in the registry and is left out of what the game resolves, counted. Tests: chords, clashes, the strict reading of commands and markers, the HUD layout's text; a command run reaches its mod once with its arguments; the keybinds list and its clashes across two mods; the marker layer by map; a HUD root moved and hidden in the snapshot and kept in the store. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueIcon was the built-in vector set alone, so a tracker could not show the game's item pictures (the Ship of Harkinian item tracker's case). Icon takes `item`, an item's name ("Item_Bomb", a mod's new item's too). The mod's image set reads it as a source of its own beside the mod's PNGs: on the images' thread, the host's ItemIcons (longshot-game's textures.rs) reads the file the game is served for UI/Tex/Icon/<item>.bntx.zs, takes its first plain 2D texture and has the renderer's decoder make level 0 RGBA8. The pixels go to the UI snapshot alone (the renderer draws them in the Icon's square, tinted only when the Icon gives a colour); no script sees them and nothing is kept or written. An item with no icon, or one the decoder does not take, is drawn as an empty place, said once in the log. The image set's sources are now a file, an item's icon, or a thumbnail's src (`capture:<n>`, for longshot/capture next, which fails until then), all under its caps (64 images, 16 MiB). The types and the fake game take `item`, and the Hud's `id` and `title` that the HUD layout page goes by. Tests: an item's icon through a reader of made-up icons, one it has not, the name's check, and an Icon's image in the snapshot. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe enemy editor's thumbnails (spec 18) had no way in: longshot/capture was named in spec 9's table and not built. capture.toml: thumbnail({ rect?, size? }) gives a Thumbnail handle (src(), state(), failure(), save(name), release()); load(name), saved() and remove(name) give back the ones a mod kept. Permission ui.window. A handle has no read: its src (capture:<n>) is what an <Image> (or a Canvas's image command) shows, and only the mod's own src resolves. The game side (services/capture.rs) lists each ask in the mods' UI snapshot, version 11 (MkwVkUiSnapshot.captures: an id, the part of the picture as fractions, the size 16 to 256 a side) until the renderer answers. The renderer (vk_modui.cpp thumbs_tick, vk_replay.cpp thumb_ask) copies the part at the present's point the control bridge's shots are taken from (the scene, no overlay, no menu, no mod UI), blitted into a 256 x 256 image of its own, reads it back once the GPU is past it and posts MKWVK_UI_EVENT_CAPTURED with the RGBA8 rows (MKWVK_UI_VALUE_PIXELS), or none when it could not. longshot-game's game_ui_post keeps such an answer apart from the mods' events (8 at most) and the next frame's start takes it (capture_frame); an ask unanswered for 4 s fails. The pixels stay with the service and the mod's image set (counted in its caps). save() writes a PNG under <user>/modstore/captures/<mod>/, which no mod's file API reads. MkwVkHost is unchanged; rx_backend.c's and ui.rs's layout checks hold the snapshot's new size. Caps: 16 thumbnails a mod, 4 pending; 64 saved. has("capture") is the host's. The fake game takes a thumbnail at the frame after it was asked (or fails it, game.captureFails) and keeps saved ones in game.thumbnailsSaved. Tests: the ask's checks; a thumbnail asked in the snapshot, answered through the sink, shown, released; one unanswered failing and the pending cap; one saved to the game's folder and loaded again; the C block's captures and the answer's checks; the image set's thumbnail source. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue`camera.override({ near })` sets the gameplay projection's near plane, 0.01 to 10 metres, so a view inside Link's head does not draw the inside of his face. It is written at `camera.lens`, where x20 is the camera's sead::PerspectiveProjection (the site's next instruction stores the angle at its +0xa0): the near plane at +0x98 and the dirty byte at +0x8, which agree with the ratio at +0xb0 and the dirty store `wide.cameraRatio` already read. The game's own near plane is kept and put back at the first update with none; a projection other than the one written is never written back (its camera may be gone). `has("camera.override.near")` follows `camera.lens` being placed; a rig giving `near` on a build without it is a NotAvailableError, in the game and in the fake game. Read from the code, not yet seen in a run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue`camera.override({ drivePlayerFacing: true })` turns the game's own player camera with the mod's view, so the left stick walks Link where the view looks and the game's camera is behind him when the override ends. At `camera.update`, the player camera's update's entry, the core's callback now sets the camera's yaw (+0x1a4, the field host/mouse_native.c turns, in oot::layout::camera) in place of the mouse look for that update: one of the two turns it, never both. The mouse look starts again from the camera's own angles after an update it missed, instead of putting back where the mouse had left them. The view's yaw less the player camera's is not assumed: the view site compares the game's own view with the yaw the camera had at its update and takes the nearest multiple of 90 degrees (within 20), so the rig drives the yaw once the game has built one view of its own. Only while the camera is the view (its state 3 or 4, its angles a camera's). `has("camera.override.drivePlayerFacing")` follows `camera.update` and `camera.view` being placed; a NotAvailableError otherwise, in the game and in the fake game. Read from the code, not yet seen in a run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue`camera.override({ collide: true })` keeps the eye out of the walls between it and its pivot (Link at the offset's height on a rig on Link, the target on a "target" rig in the world; another rig is an ArgumentError), 0.2 m in front of what a ray from the pivot hits and at least 0.1 m from it. The ray cannot be cast at the view site: the game's query takes the physics world's lock, which the step holds while it waits on job batches (oot::rays). So the camera service asks one ray a frame through oot::rays, from the pivot to the eye as the rig puts it and a clearance beyond, takes its answer the next frame as the rig's reach, and the view site pulls the eye in along the line to the pivot within it. A wall is felt a frame or two after the eye reaches it. A ray not cast in 4 frames is asked again; releasing the override cancels it. `has("camera.override.collide")` is false while `world.ray` is (Preview: no run has shown the game's rays), like it through the same casts; the fake game has it once a test gives a world to cast against (allowRay), and casts at once. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4puegfx.model(path) reads a mod's .glb/.gltf on a reader thread of its own (api::services::models, over content::assets::gltf; files beside it in the mod's folder only, never through a link) and settles with a Model handle once it is held; a mod's models hold at most 64 MB once read (charged while a handle, a shape or a published list holds them) and 4 read at once. gfx.world.model(model, at, options?) draws it as a WorldShape: yaw, pitch, roll, scale, a tint, occlusion and distances; setRotation and setScale; follow(actor) moves and turns it with the actor. A mod's model shapes draw at most 200,000 triangles. has("gfx.model") and has("gfx.world.model") follow Drawn.models. The game side publishes the models as their own list with the shapes (game_world_models, GameWorldModel and GameModelMesh in game.h; MkwVkHost version 56). The renderer copies and checks each mesh once by its id (gpu/vk/world_models.h: every index, part and texture in range, a bad mesh never drawn), uploads it once into a buffer and images, and draws the models before the shapes in a pass of their own (draw_models; shaders/model.vert, model.frag): vertices pulled by the index buffer, a depth image of the picture's size so the parts hide each other, opaque and masked parts then blended ones, both sides lit by one light from above, each fragment tested against the scene's depth as the shapes are. The mod tools' fake game checks a model's path and that it is glTF 2.0. Not done: skinning and animation, the other PBR inputs, JPEG textures, bone attachment, the scene's sun direction (one fixed light), sorting blended parts. Not run in the game yet: the checks a run must make are in assets/modding/docs/world.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue`camera.follow(view, actor)`, also `view.follow(actor)`, puts the override's eye on any actor in Link's place: its feet plus the rig's offset, turned with its facing, worked out where the game builds its view, as `attach: "player"` is on Link. An Actor is a handle, which an options record cannot hold, so it is a method of the override (the camera namespace's, as `actors.attach` is the actors'), with its own feature `camera.follow`. The view site reads the actor at the address the main thread published, checked as a game actor each time; the main thread marks it gone once the actors' list drops it, and the game's view is drawn from then on. It returns false for an actor the list does not have now. A view on a bone goes through it: attach a hidden actor to the bone with `actors.attach` and follow that actor (assets/modding/docs/camera.md has the recipe, for Link's "Head"). A rig's own bone, read at a site after the skeleton's update with no frame of delay, stays a later improvement, and hiding a part of Link's model a leftover; game/README.md records both. `has("camera.follow")` follows the actors' list and the game's state; the fake game follows its listed actors. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe loader reads mods only from LONGSHOT_PROFILE: its profile.json is the one list ("on"), its trust.json the one trust file, its mods/ the manual mods ({id, path: "mods/<name>", on}). A source mod ({id, version, hash, on}) is read through loader::source's ModStore/ModFiles, which the modtool's mod-store implements later; this build has NoStore, so one is logged as not readable yet and its entry kept. LONGSHOT_DEV_MODS (mod run, and now the test mode's tested mods) adds development mods, never written into the list. No profile: the system mods alone. Gone: HOS_MODS, HOS_MODS_LIST, HOS_MOD_TESTS_ONLY, HOS_MOD_TESTS_PLAYER_LIST (GONE rows), mods.json and its "enabled", <stem>-trust.json and the game folder's user/ trust rule, the carry of mods.json into the user folder, modcache/mods_json.txt, longshot-game's profile.rs and profile_mods::expand. The sandboxes (Linux, Windows) and the broker take the list, trust file, mods/ and the development mods from the same variables. Hot reload follows the profile: <profile>/mods/ and profile.json by notices, LONGSHOT_DEV_MODS folders walked (scripts, served files, shape). A profile.json change applies its switches while the game runs (the Mods tab's own write changes nothing, so it logs nothing); a code change re-checks the mods' code against the build (Restart to apply). The builder channel's profile_changed is not read: the game side has no event reader. Also: the Mods tab's Has row lists what a mod has (script, hook sites, ExeFS patches, code modules, RomFS files, patches/, textures, content module), the code warning names what the mod brings and drops Rebuild for mods, and a confined game with no builder channel sends the player to the launcher or Longshot.exe mod to accept code (a trust_request hook is left for the channel's request_trust). mod-tools' mod run plays <game>/dev as a profile. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueSetting a BINDING to an input another control uses no longer takes it silently. renderer_setting_text(key, value | MKWVK_BIND_ASK) is the question ("F7 is used by Jump.", translated; "" when no other control uses it); a set of such an input returns -3 and changes nothing, and value | MKWVK_BIND_SWAP is the player's Swap: each control that used the input gets the slot's old input in its place. The host's rebind_control learns three flags for it: HOS_REBIND_PROBE (report the conflicts only), HOS_REBIND_SWAP and HOS_REBIND_ONE_KEY (a key binds that slot alone, where the Controls grid's one key cell clears the second). The Settings mod asks the question as a dialog, Swap chosen first, Cancel beside it (sysmod-settings' a_binding_asks_before_it_takes_another_controls_input); tests/test_settings_decls.py checks the flags are the same bits on both sides and that binding_take takes an input in use only with Swap. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueprofile.rs: profile.json's "mods" (each {id, on} with a source's version and content hash, or a manual mod's path in the profile's mods/; every other key kept as written, in its place), read strictly and written whole (profile.json.new moved over); add, move and remove a pin, a new order with switches; trust.json beside it in the loader's trust format, written in place through api::loader::trust; a mod's files (a manual one's folder or .lsmod, a source one's from the store: a hook for the store crate), its manifest, content hash and code hash; every known profile's source pins for the store's clean-up. The edit lock is one function, a minimal stand-in of #2286's launcher_profile::edit_lock until that crate is here. Co-Authored-By: Claude Opus 5.5 <[email protected]>mod check [folder] [--types]: the mod as the game would take it, without running it. The manifest by api's reader; lib/lint.js's rules ported (lint.rs): permissions the source uses against those declared, read with the game compiler's parser (scan.rs: oxc's module record and tokens, so a comment or a string is never code), API modules, mod: imports against dependencies, JSON imports and literal longshot/files paths by the files service's own path rule, net origins, the game's own formats outside romfs/, mod data's output anywhere in the folder, budget hints. Every shipped module compiled by script::ts (JavaScript parsed), and linked from the entry and the content module as script::modules resolves imports; PNGs and glTF models by content's readers; sites.toml by the builder's sites::modsites. --types writes the API types and runs TypeScript 7's tsgo when installed (exit 77 when not). Findings are lines, and {file, line?, col?, severity, code, text} in --output json's result, which a failure now keeps too. mod types: types/longshot.d.ts (schema-gen's, built in) and types/longshot-env.d.ts (the mod's required features and settings). mod init: mod.json and src/main.ts from the template, tsconfig.json for tsgo, .gitignore, README, the types; no Node or npm. api::services::files::path_ok and script::modules::content_module are pub for the check; oxc_syntax is a workspace dependency (the module record's import names). Co-Authored-By: Claude Opus 5.5 <[email protected]>saveGame, loadSlot, reload, deleteSlot and copySlot: the world keeps each slot's flags as the game's save does (a load puts them back, the Bool64 container with them); the items' and longshot/game's watches hear the save request and the save.load site, and the mods' stores hear the notes the game's file system sends (held until the mod has started, as the game starts its mods before the player loads). seedStorage writes a store's file on the fake disk; storedData(scope, slot) reads a slot's file. game.fresh({ strict }) starts the game again for the same mod, its disk kept: save-tally and misbehaving use it in place of a second FakeGame. check-gift checks a place again through a load of a save from before its check; its save and load are a frame apart. echo-client's long line comes from the server: the broker stops the socket (1009). Co-Authored-By: Claude Opus 5.5 <[email protected]>A mod's system/ dependencies run beside it, as the game runs the ones its build ships (from system_mods/ beside the game, else this checkout's game/mods): started first with every permission they list, linked while switched off (game.systemMod(name, { off: true })) so an optional import of one still resolves, their settings and logs reached through game.systemMod(name). game.discord() is a fake Discord app at an IPC endpoint, played in Rust over the network engine (the broker's "nothing listens there" when none): it answers the handshake with READY, each command, each ping, and keeps what it was sent. discord-status uses it in place of system/discord's fake-discord.js, its frames a tenth of a second (a whole second each way is longer than system/discord's handshake wait). turnOff() stops the mod as the Mods tab does; longshot/time's gameStarted() is the fake game's fixed 1700000000. copySlot's comment cites the launcher's slot copy. Co-Authored-By: Claude Opus 5.5 <[email protected]>The game's Bool setter (flags.setBool) is a fake function that queues the value, made at the frame's end as the game makes it at its next update; the fake game holds every container (Enum and UInt too), setFlag takes { kind }, and a switch reads 0 or 1 as flags.get gives it. game.writes is the writes service's own trace of the mod's attempts. A test's setters refuse a non-finite number before it becomes JSON. A restart reaps the old session's mod at once, so its stop is not the new one's. misbehaving expects the real wording of the Timeout, has() and flags.has() faults. Co-Authored-By: Claude Opus 5.5 <[email protected]>A profile entry {"id", "version", "hash"} is read from the builder's mod store (HOS_MOD_STORE, set by the builder's play) at a folder in no disk: api::store_disk::StoreDisk lays each pin's record over the files the game reads (Store::check_pin, RecordFiles), and the RomFS layers serve the blobs themselves (Disk::host_path). A pin the store lacks whole is said and left out. The sandbox reads the store's blobs/ and versions/ (Landlock, the AppContainer). The loader takes a list sink, so with a channel the profile is the builder's to write. Co-Authored-By: Claude Opus 5.5 <[email protected]>host/control.c passes mods and mod_* requests to game_control_mods (a new mods hook of HosControlGame) and replies with its answer's fields, or its {code, why} refusal as the bridge's error. The game had the commands (longshot-game::control_mods) but nothing routed them. The protocol's mods section documents them. Co-Authored-By: Claude Opus 5.5 <[email protected]>game/mods/fov/mod.json, in the player's format, declares the mod (its id, version, description, hooks.unsafe, the camera.lens site it handles) and its Field of view setting with its place on the Gameplay tab; the crate reads it at compile time ("rust": "sysmod-fov") in place of the Manifest it built in code, and a test checks that it parses and that its setting's key is the code's. camera.lens stays the core's site: its core callback serves the mods' cameras too (oot::sysmods::fov keeps the shared lens). test_oot_fov.py reads the manifest; test_menu_i18n.py takes a built-in Rust mod's texts from its mod.json. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe Insert menu's settings (the renderer's declarations, rows, texts, set/press/text and bindings) and the Mods tab's data and edits (the list with each mod's page, cheats, keybinds, commands, HUD roots, the permission prompt; setMods, edit, restartToApply) as two schema modules behind the system-only permissions settings.host and mods.host, so the menu can be drawn by TypeScript system mods while Rust keeps the data. state() is { channel, why, ops }; errors SettingsHostError and ModsHostError { code, text }; events only to holders; every API Promise now carries its call number. longshot-game gives the tab's host part (mods_host.rs). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe renderer answers @fx:<mod id> with a mod's screen effects as it runs them (point, the mod's and the player's switches, state, GPU time, why), read-only but for the player's switch; longshot/mods-host gives them as each page's effects and sets the switch with edit("effect"). The TS Mods tab lists them as toggles, and shows a mod's own settings page in place with ModPage. Read-only on gfx: vk_effects' fx_effects_of and fx_player_set only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYlongshot/gfx's gfx.outputEffect (extension 1 of the built-in mods' audit): a mod's effect of 1 to 8 fragment passes at present, after the game's HUD, frame generation's made frames and the window's scaling, before Longshot's overlays. Each pass draws an image of a size and format the mod chooses ({ scale } or { lines, maxScale }, rgba16f or rgba8; the last draws the output) and samples up to four inputs (the pass before's, the picture, an earlier pass's), nearest or linear, clamped or black outside. The renderer fills the params named SourceSize, OutputSize, FinalViewportSize (libretro's names), hdr, paperWhite and peakNits. On the SDR picture the passes see it as the display shows it; with hdr: true, while the game presents HDR, linear nits (Rec. 2020): the HDR pass grades into an RGBA16F image first (hdr_encode.comp's HDR_NITS), the effects run over it, and hdr_pq.comp encodes their image. An effect without hdr runs before the expansion, and is bypassed (unsupported, saying so) while the game presents its own HDR. The template's check (fx_spirv.h, api::spirv) takes up to four samplers and reports them (inputs); gfx.effect's keep the picture alone. Built-in mods reach the same code through ModApi::gfx over the shaders they carry. The fake game lists an output effect's passes, images, inputs and fills, and EffectInfo.reason says why one is not drawn here. game.h's GamePass carries an output effect's passes (GAME_PASS_OUTPUT_FX at GAME_PASS_PRESENT, GameOutStep): MKWVK_API_VERSION 58. The modding API's version stays 0.1 (bumped when the release is cut: api-schema.md). Example: assets/modding/examples/scanlines. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueExtension 2 of the built-in mods' audit: each present tells the output effects whether the game drew its 3D world (vk_draw.cpp's world_drawn_at in the last 3 presents, the fact the ultrawide menu sides use, kept in wide_sides_tick's world_now for frame generation's display thread too). A pass reads it as the param worldDrawn the renderer fills (1 or 0), and an effect's when ("always", "world", "noWorld") draws it only in frames with or without the world: in the others it costs nothing and is waiting. GamePass.when and GAME_FILL_WORLD_DRAWN: MKWVK_API_VERSION 59. The fake game lists each output effect's when. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueExtension 3 of the built-in mods' audit: gfx.renderer() answers { tier, hdr, nativeHdr, menuOpen }: the memory and quality tier the Quality preset or Auto picked (1 to 5, null before it is known), whether the renderer presents HDR10, whether that is the game's own HDR picture (Native HDR, where an output effect without hdr is bypassed), and whether the Insert menu is open. The renderer answers one new option, HOS_OPT_RENDER_STATE (its bits), beside HOS_OPT_MEMORY_TIER, read through the post sink when a mod asks; built-in mods reach it through ModApi::gfx. The fake game's game.gfx.setRenderer sets what it answers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueThe CRT system mod draws the filter itself through the public longshot/gfx (ModApi::gfx, the code a script mod's gfx.outputEffect reaches): game/mods/crt/effects/downsample.glsl into a raster of the mod's size ({ lines: 240/480/720, maxScale: 0.5 }, RGBA8), then lottes.glsl, hyllian.glsl or zfast.glsl at the output's size, sampled nearest (zfast linear) with a black edge. The four are the renderer's compute adapters ported to fragment passes with the same math (the pixel centre is gl_FragCoord, SourceSize and OutputSize the renderer's params, style a float param; the box's loops counted, 32 texels each way, the same sums in the same order), compiled beside them by Longshot.exe mod shaders and carried in the mod's code. The effect takes the SDR picture only, so the renderer runs it before an HDR expansion and bypasses it on Native HDR as before; the mod reads gfx.renderer() each frame and sets the filter row's hints to the "Bypassed: ... Native HDR" line (ModSettings::set_hints, a native choice row's hints changed at run time). crt_filter and crt_lines keep their keys. It stays a Rust mod: a script mod's settings have no options-file line or Insert-menu place. Gone from the renderer: crt_policy.h, the four crt_*.comp and their headers, vk_framegen.cpp's CRT pass, the CRT decoding and hint in menu/game_rows.cpp, GAME_PASS_CRT and PostKind::Crt, scripts/shaders.py's crt set. tests/test_crt_policy.py checks the output effects' lines size is the old raster for every output size, test_crt_shaders.py the fragment ports against the pinned upstream math and their .spv's sources, test_upscale_independent.py the scaler's routing into the output effects, test_gfx_effects.py the renderer's taking of an output effect's passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pueA release lists its dependencies as its mod.json writes them (a repo's release says so, a single mod's are read from its manifest; checked by the manifest's own reader), and details gives them for each release. install plans first: the release asked for, then every required dependency (and theirs) the profile does not have at a version it takes, each the newest release its source lists that it takes; the plan installs what is needed before what needs it, and a dependency no source can give stops the install before anything is fetched. --plan (the op's "plan": true) only answers {plan: [{id, version, sha256, source, needed_by}], missing: [{id, needs, range, why}]}. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYmod pin <id> <version> installs the mod at that release when the profile has another, then pins it there ("pinned": true in its profile.json entry); updates, check_updates and installed's update offer then leave it, and an update named for it is refused saying so. mod unpin <id> lets it move again. installed gives "pinned": the version it is pinned at, or null. Neither op is the game's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYtags (the op and mod tags [--source URL]) counts, over every mod the sources offer (each once, as search has it), its tags and its categories, folded to lower case: {tags: [{name, mods}], categories: [{name, mods}]}, by name. The game may ask it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYmod add replaced a mod of the profile with the same id without a word and kept what the player had granted it. Now a replace is refused without --replace (the op's "replace": true), and one whose files are not the same (another content hash) drops the mod's grants: its profile.json entry's granted and its trust.json acceptance and unsafe grants, so the player is asked again. --plan ("plan": true) only answers what it would add: {id, version, sha256, replaces, same_content, code, permissions}. The answer says {id, version, sha256, replaced, grants_dropped, code, restart}. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe launcher's ModsEmulators.Scan, in the builder: Eden and its forks (one emulator where they share a data folder), yuzu, suyu, sudachi, citron, torzu and Ryujinx, by their data folders on Linux and Windows; each one's mods for this game's title id (yuzu's family: load/ or its qt-config.ini's load_directory, and sdmc's atmosphere contents; Ryujinx: mods/contents and sdcard's), with the emulator's switch (DisabledAddOns, Ryujinx's mods.json; null when not known) and whether it holds code (exefs). Read only, no link followed. Answers {emulators: [{name, data_folder, mod_folders, problem}], mods: [{emulator, name, folder, source, enabled, code}], looked}. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYenable/disable (the ops; mod enable <id>, mod disable <id>) set a mod's "on" in profile.json in place, under the profile's edit lock, the rest of the file as it was. The answer: {id, on, changed, code, restart} (code: a code mod's switch changed, which the next start builds in). Not the game's: its Mods tab has its own switch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYrequest_trust's confirmed (mod allow <id> --yes --sha256 HASH [--permissions a,b]) records trust with no window, exactly as the window's Accept does: the mod's code accepted, the unsafe tier it requires granted, and only permissions its mod.json declares (bad_args for one the schema lacks, refused for one it does not declare). It needs the content hash the player was shown and refuses with content_changed when the files are not it now; the game can never send it (refused). The answer is the op's {accepted}. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYorder (the op; mod order <id> --up|--down|--to N) moves one mod in profile.json, in place under the profile's edit lock, every other key kept. System mods stay first and in their place (system_mod for one; nothing moves before them); a mod that is not there is not_found; one of up, down, to (bad_args otherwise). The answer: {id, from, to, order} (places from 1, order the ids as they now are). Not the game's: its Mods tab moves them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYremove of a path (mods/<name>, a full path in the profile's mods/, or a bare name) that is not an installed id deletes that folder or file, by the rules of a mod of one's own: only a name directly in mods/, no link followed, read-only bits cleared. One that profile.json names is refused (remove it by its id); one that is not there is not_found. The answer: {id: null, path, profiles: [], deleted}. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe feature `runtime` (on by default) is the whole API. Without it, api is json, manifest, settings::decl and mods::{Enabled, Manifest}, and its bindings are their permissions' part alone (schema::emit::rust_permissions, $OUT_DIR/permissions.rs), with serde_json and thiserror as its only dependencies. A build script can then check a built-in mod's mod.json with the game's own reader (api::manifest::native) without compiling the game's crates for the build: longshot-game's registry of native mods, next. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA pure move, nothing in the files changed: assets/modding/docs/ is docs/modding/, assets/modding/examples/ is docs/modding/examples/, and assets/modding/templates/new-mod/ is docs/modding/template/ (beside the examples, not among them: every examples walker would take its {{id}} placeholders for a mod). None of them is shipped by a build, so assets/ keeps only what one does. The paths that point at them follow in the next commits. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe hosted page's help box had an empty title ("", not none) and the focused control's help alone: a row with no help text drew an empty box, and no row was named in it as the menu's own rows are. The box's title is now the focused control's name (its label, its title, or a Button's words: modui_settings_title), then its help and the hint; with none of them, as on a tab's strip, the box is not drawn. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe renderer's layout took the room of a row too wide back from every child without a width of its own, in proportion: a Slider, which takes the whole room it is given, and the Tune Button beside it both shrank, and the Button showed "T...". The menu's fixed width={96} did not help: 96 virtual px is less than the word and the Button's padding. The inputs that fill their room (Toggle, Choice, Slider, TextInput, Keybind) now give it up first, down to kInputMinW, and only then does the rest give up its share. The menu's Tune and Done lose their fixed width. tests/test_modui_row.py lays out that line with the real layout (gpu/vk/modui_layout.cpp) at the menu column's widths; it fails before this change. The fake game's tests passed because the fake game lays nothing out. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYl4mf-1: modtool's menu test ("closed, the menu reads nothing a frame") failed on the declarations' read started at the menu's start; the read is the menu's first opening's again, and costs that opening 1.2 ms now (3.0 before), its answer written off the script's thread. And the stateChanged condition wrapped as cargo fmt wants it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA setting's "native" object is gone: its fields are the setting's own and any mod's, read by the one reader (manifest::setting::read): store ("options": kept in longshot_options.ini under its id, which may hold a -; "run": for the run alone; in place of scope), place (its row in the Insert menu), presetExempt, shownIf (one of the mod's own settings, or <mod id>:<id>), hints (a line an option) and defaultText. A built-in Rust mod's settings are made SettingDecls from the same SettingSpecs (settings::decl::decl_of); a script mod's are declared into the settings service at its start and leave at its stop, so they are kept where their store says and their rows with a place join the menu's, told to the mod by settings.changed. A mod whose options key another mod's setting holds, or (a player's mod) one of the renderer's own rows, does not start (Settings::refused). What only a system mod may have: a "button", and legacyOption and legacyId until input movies name settings by key (the clean break removes both). New: settings.setHints(id, hints | null), a choice's hints in place of its declaration's (the CRT filter's "bypassed" lines), and the fake game's menuRow(id), optionsLine(key) and setOptionsLine(key, text) (its longshot_options.ini). The schema, the shared vectors, settings.md, system-mods.md and DESIGN.md say the same; the built-in mods' mod.json files are flattened, their keys unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYFormat 3, read by site-table for every owner: the core's game/sites/sites.toml, each built-in mod's game/mods/<name>/sites.toml and a player's unsafe mod's sites.toml. A row is the site: its definition, what finds it in any build (signature, signature_offset, guards, offset), and an entry for each supported build, builds.<id> = { fn = "f_...", ... }, keyed by the build id's first 8 or more hex digits, holding where it is there and what of the rest differs (an offset, an anchor, a vslot's slot, or the arguments in other registers: the same names and types, checked). Long entries are a [site.builds.<id>] table of the row. The anchor key in becomes within (in is no key now). hot = true marks the sites known to be reached many times a frame (the UI's per-pane sites, anim.loopStep*, actors.update, heap.*, barrier.*): metadata only, to be confirmed by a hit-count run. game/sites/<build>/locations.toml is gone: every site's entry moved into its owner's row (the mods' into their own files), and the named locations are [[location]] tables of the core's file with builds entries too. For each site the builder uses its entry for the build (its signature checked there), else its signature alone (sites::find_unlocated), else: a built-in mod's required site leaves that mod out with why (logged, never a stop), an optional site is not placed, and a required core site makes the build unsupported when no core site names it and stops it when one does. The HOS_SITE_OUTCOME check reads every owner's rows, so a mod left out does not trip it. A player's mod reads the same rows with the mods' rules on top (its entries hold fn, offset, signature, signature_offset, guards and args; old format 1 tables are refused saying so), its list rows carry the build's registers. game-sites' build.rs reads the tables with site-table: the forms, the mods' slots, and PLACED, each supported build's placed sites by its key (the same left-out rule). The lift's key holds every owner's file. The supported build's sites, their order and owners (site_owners.txt) are unchanged, so the lifted output is the same. New repository tests: a supported build's every site placed by its entry, none left out; a mod uses only the core's sites and its own (its mod.json and sources); only game/mods/text names its site. tests/sitecheck.py reads the new rows; the site-event example is converted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYLongshot.exe mod sites port reads a mod's sites.toml (a player's, or a built-in mod's in game/mods/<name>) with the tables' reader and, for the --to build: says which sites already have an entry; finds each other one by its own signature, else by another build's entry's (the --from build's first, its offset, signature and guards carried into the new entry), else with --from by that build's code grown into a longer signature; and lists the ones it cannot find. --write adds each found one's builds.<id> = { fn = ... } line to its row, before any subtable of it, with a key no other of the row's starts, and reads the file back first. The search is the lift's own (sites::modsites::find_one, now public) rather than a copy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA mod's texts in the player's language: its folder's strings/<lang>.json (a language code each, en.json, pt-BR.json; a JSON object of texts by key, nested objects joined with '.'), looked up with t(key, vars?) in the menu's language (renderer_setting_text("menu_language", LANG_CODE): the Menu language row, Auto worked out to the game's), then the language's first part, then English, then the key itself (said once when the mod's en.json lacks it too). '{name}' is filled from vars. lang() and langs() say the language now and the ones strings/ has. No permission; the files are read at a mod's first lookup and again when it starts again. Longshot.exe mod check checks strings/ as the game reads it (a language code's .json, an object of texts); a mod test sets the language with game.menu.setLang(code). settings-host's texts are documented as English, which the menu mod translates. docs/modding/i18n.md; schema-gen outputs. Tests: lookup and fallback, placeholders, the file and code rules, mod check's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe renderer gives every text in English now (vk_menu_i18n.cpp's tr is the text itself; it keeps the Menu language row's list and the game's language), and the menu system mod shows each in the menu's language through longshot/i18n: game/mods/menu/strings/<lang>.json, the 13 languages of gpu/vk/menu_i18n.h moved as they were (each keyed by its English text), and src/tr.ts, which also translates a text made from a printf format ("3 of 9" from "%d of %d", src/formats.ts) through the format's translation, as the C++ lookup did. src/host.ts is settings-host with its texts translated as they are read; the menu's own words (Tune, Done, Cancel, Swap, Loading) are translated too, with new entries for the four the tables lacked. What the renderer draws itself, the FPS counter and the start-up screen, is English now. tests/test_menu_i18n.py reads the strings files (every language of the row has one, every text is the menu's, conversions kept); test_menu_i18n_count and test_share_message_i18n, which compiled the C++ tables, go; test_framegen_by_row reads the strings files. A mod test checks a label and a made text in French. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe TS menu reads every row's state at the start (renderer_setting_state, menu_decl_state). Its hint line is made as std::string(hint(v, -1)), and most hints give nullptr for a value with no line: libstdc++ throws std::logic_error ("basic_string: construction from null is not valid") and the renderer stops the game at start. The check cuts those lines out of menu_decl_state and runs them with the real modules and model over each row's every value, the restart tag on and off. Fails here: the fix follows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYmenu_decl_state made a row's hint line as std::string(hint(v, -1)); most hints give nullptr for a value with no line, so libstdc++ threw std::logic_error ("basic_string: construction from null is not valid") when the TS menu read every row's state at the start, and the renderer stopped the game ("vk: FATAL: std::logic_error came out of renderer_setting_state"). Came with mwurlplr (the restart tag in the declarations). The hint is now taken only when there is one; DeclList::keep takes a nullptr text as "" too, for the declarations' other texts. tests/test_menu_decl_state_hint.py passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe installed operation (the game's channel, mod serve) answers the same {format: 1, game, mods} document as the command line, so the game's Mods tab and the launcher read one thing; its service tests read it by id. mod resolve --on ID --off ID gives the resolution as if those mods were switched so (the profile's list read through an overlay with those switches, an entry added for a mod it does not name; nothing written), for the launcher's "switch on what it needs", with its tests. modtool reads the stamp rule, the system table and the packages from their one place. tools.md says why settings --set refuses while the game runs: the game's own Mods tab edits them live. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYinstalled gains list {state: profile | none | not-a-list, path, old_lists (the game folder's mods.json or longshot_mods.txt, read by nobody)}, skipped [{path, why}], and per mod in_profile and content {romfs_files, romfs_more, cheats, exefs_patches, modules} for the launcher's kind chips. mod settings gives every setting its text, read-only: a choice's value is its option's index, and --set takes the index, never the label. tools.md says so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe C++ menu drew the microphone test's levels in its help box; that drawing went. The Audio tab has a Microphone level line after Test microphone, shown while the test runs: a line declaration with a range (0 to 1000) whose state is its level (after the gain) and the meter's text ("Testing: 12% -> 24%", then what the test hears). The menu system mod draws any line with a range as a meter, its text and a Progress bar: a generic piece, read through settings-host like every row. The test stopped at once with the TS menu: it ran only while the C++ menu's tab was Audio, and that tab no longer moved. menu_on_tab is now the page whose rows the menu mod read in the last half second (menu_decl_state notes it; the mod reads only the page it shows). Tests: a mod test of the meter line; test_microphone_test_gain checks the line and the page-read rule (stale, another page). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYt(key, { name }) left every {name} as it was from a script: a variadic value reaches the service as the object's JSON text, which vars_of did not read. And a mod keyed by its English words (no en.json) got its key back unfilled. Both are filled now; a test covers the text form. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe tab's own words (the list's lines, a mod's page, Permissions, Keybinds, Commands, HUD layout, the permission prompt, Safe start, About, the switch's states and the help) go through longshot/i18n, keyed by their English, their parts as {name}s; game/mods/mods-tab/strings/<lang>.json has the 13 languages of the menu. What the loader says (a mod's detail, note, state, warning) stays its own. A mod test checks the tab in French, a filled-in part included. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe Mods tab now says its texts through t() (its strings/ in 13 languages), so test_gfx_effects no longer found <Section title="Screen effects"> or the GPU time's English line. It looks for the section and the line as they are written now, t("Screen effects") and t("{ms} ms of the GPU a frame.", ...). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe user's decision on observe-only mods. A mod is observe-only when its code is its sites.toml alone and it asks for hooks.observe and neither hooks.change nor hooks.unsafe (nor exefs). Its sites can then only name the game's own (the build leaves out a site of its own without hooks.unsafe), and the game lets it hear only events and their arguments (a filter needs hooks.change; a field or string capture stays hooks.unsafe). Such a mod is taken with no acceptance by code hash: no warning, nothing written to the trust file, and no new question when it is updated. Its low-risk permission is shown at install as any mod's. The warning ("its own code changes the game's code") is left for hooks.change, hooks.unsafe and ExeFS code. One rule, mods_stamp::observe_only, asked by both sides: the stamp takes such a mod's sites without an acceptance and leaves it out of the trust set; game_files::code_mods and build-driver's modsites::collect take its sites; api::loader's code_status neither asks nor warns (Row::observe_only), and so neither does the Mods tab; mod installed's trust says observe_only. Docs: unsafe.md, hooks.md, tools.md. Tests in mods-stamp, build-driver, api's loader and modtool's installed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYDamage taken's port needs two things the API lacked. A scale that comes after the other mods' damage rules, as the native mod's did. And a way for a script to see the Cheats mod's Debug tools, which gate it. - DamageRule's last (rules.damageTaken / damageDealt add({ ..., last: true })). A last rule takes the hit the other rules made (the game's when none matched), and the last rules combine among themselves as the others do: scales multiplied and rounded to a quarter heart (halves up), then adds, then min and max. oot::rules::apply_hit runs the two passes; LifeRule gains last in its padding (size 80 kept). - player.lifeWrite, the game's other compare-and-swap of a life (add w12, w11, w10), never saw the mods' rules; only the native Damage taken scaled it. The core's engine callback there now applies Link's last rules over the hit that write takes off (oot::rules::life_last). It reads the published rules.life table with its reader count (game_sites::rules::with_live, the C's enter and leave), then heart protection as before. Both sites log the first 32 writes that lower Link's life, so a game run shows which write a hit goes through. - A parity test runs a last rule at each Damage taken scale (0.5, 2, 4) against the native scaled_life on the same written hits at both writes: lives to 20 hearts, hits to 25 hearts, alone and after other mods' rules (147,258 hits). - mod.json's reads ("<mod>:<id>", at most 32, only with a runtime) under the new permission settings.read (low risk, read only; each needs the other). settings.get("<mod>:<id>") gives the value of a setting reads lists, or null while that mod does not run; any other is UnknownNameError. settings.changed tells its changes with that id. The prompt's and the Mods page's permission rows carry the names (Asked/PermissionRow names, modsHost's names), and mod check prints them. Drawing them in the TS Mods tab is the UI2 helper's. The fake game puts the system mods a mod reads in its game, as it does its dependencies: systemMod(name).setSetting is what the mod reads. - The schema (types.toml, api.toml, settings.toml, modsHost.toml), the generated reference, permissions and scripting pages, the website's mod.schema.json, and 4 new cases in tests/mod_vectors/manifest.json (the Launcher's reader needs reads to pass them). Docs: rules.md, settings.md, manifest.md, actors.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA launcher asks the builder for a profile's mods and sources before the player has set up the game. With the builder's flags before `mod`, as docs/modding/tools.md writes the line, `--profile` first was taken for a play, which stopped with exit 120 ("Longshot isn't set up yet") for installed, resolve, source list, emulators and tags. - main.rs: --profile/--output/--cache before `mod` run the mod tools (mod_line), never a play. - installed/resolve/build-state: `game` is null while the profile's profile.json names no game files. - installed: while no game folder is built, every built-in mod is listed from the build's own table (api::system::table, the native registry) with the new state `not-built` ("not built yet"), no load order. - build-state, the one answer that needs a build, fails with `no_game`. - Tests: modtool's state tests on a profile not set up, and CLI tests (tests/mod_no_game.rs) of each command, flags before and after `mod`. - docs/modding/tools.md: the null `game`, `not-built`, `no_game`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY- romfs.load(path, { zstd?, dictionary? }): a file whole on a reader thread of Longshot's (lsmod-romfs), its Promise settled at a later frame; with zstd, decoded with the game's dictionaries, a frame that names none with the dictionary named (bcett.byml.zsdic for a map file). At most 64 MiB, 8 loads of a mod waiting. A mod's layer is read and decoded there too (host_sys::romfs::zs_decode_named over host/zs.c's hos_zs_decode_named); the host's index through host_sys::romfs::Later, which the stand-in host serves from the bytes it had at the call (its RomFS is the test thread's). - game.flags.placement(id): a placement's Bool64bitKey flag by its 64-bit id, null when the game data has none; where each was found kept (64 ids), so a read after the first is one entry. - player.provideStat("heartContainers", n | null): a mod gives the core a count it cannot read alone. The last given wins, the one before comes back when that mod stops; oot::travel's map refresh makes the pieces of heart from it (set_heart_containers_taken). The native mod's fn source stays beside it until that mod is ported. - The fake game: romfs.add and romfs.remove (typed already, never there), game.stats (what the mods gave). - The reference, the permission table and the guide regenerated; unsafe.md tells load. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe eight dungeons' map files are read once, the first time Link is in play, with romfs.load (zstd, bcett.byml.zsdic for a frame that names no dictionary) on Longshot's reader thread; src/byml.ts, the native BYML reader line for line, finds each Obj_Heart_Container's placement id; their flags are read with game.flags.placement every 2 s and the count given with player.provideStat("heartContainers"), which oot::travel's map refresh makes the pieces of heart from (its native fn source goes). The log line is the native one's. Its parity: test/parity.test.ts, the native tests' cases and fixture (test/map-file.ts is its map_file), answered as the native code answered them; test/heart-containers.test.ts runs it on the fake game. The crate sysmod-heart-containers goes from the workspace and longshot-game; DESIGN.md and system-mods.md say so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYIts rules named one capture "screen" at both menu.buttonWait and menu.buttonWaitNoDecideAnim, and longshot/hooks refuses a capture name used twice: in the game the mod did not start ("setRules(): rule 2: the capture screen is named twice"). Each site has its own now (CAPTURES: screen_a, screen_b), read the first site's then the second's each frame. Tests: each rule's capture name is its own, and with the row on at the start the mod takes its rules and runs with no fault. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYl4u2-1's run left two failures. A window whose first control is a List never gave it the focus as it opened: the want-focus pick took focusable kinds alone while the D-pad's walk counts a List, so the first Down only reached the list. It is picked as the walk picks it. The test's walk also stopped before the rows asked for could leave 0 (four to spare each side): it walks 20 rows now. The UI2 demo's tests walked game.ui2.tree() as nodes, but it is the roots ({ mod, root, surface, closed, node }), so they found no rows: they walk each root's node. ui-next.md's line for tree() says that shape. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYUI2 gets what the old mods' UI has and it lacked (game/DESIGN.md, "Later" steps 1 and 2; contract version 3). - Text: the input method's composition comes from the host (MkwVkHost.text_compose: SDL's text editing events, Windows' WM_IME_COMPOSITION through imm32, loaded when first needed, whose result is typed as code points), its windows are placed by the field's caret (text_area), and Ctrl+C and Ctrl+X put a field's selection on the system's clipboard (MKW_UI2_OUT_COPY, clipboard_put; the window's thread writes it). Ctrl+A, C and X reach a field. - The output says the focused control's label (a new input prop) and help: the Insert menu's help box. - World roots: a World kind mounted on "world" (gfx.world): the main thread places each a frame (its point or its actor, actors.read), the UI thread paints it above its point, and the frame's root groups (MkwUi2Root) let the renderer put it on its own picture, scale it for metres, fade it, test it against the scene's depth, or draw it in the scene into the world layer's atlas (occlude "depth"). - Slots: a Slot kind other mods fill by name (mount { surface: "slot", mod, name }, made a hash by the main thread), and ModPage (a Slot with of: that mod's settings page); a filler is laid out in its slot's width, drawn where its owner painted the slot, and its controls join the owner's focus. - The hosted page: the renderer asks for a mod's settings (or debug) root laid into a rect (MkwUi2Input.host_*); the Insert menu hosts system/menu's this way once it shows, gives it its input (MKW_UI2_IN_HOSTED), draws its help box from the output and its prompt bar, typing prompts while a field is typed into; Back the page does not take and its @close controls come back as MKW_UI2_OUT_BACK and CLOSE. - HUD roots take id, title, anchor and margin; the Mods tab's HUD layout lists UI2's and its places (another region, hidden) reach the UI thread. - Image and Icon take tint; Icon takes item (the game's picture of an item, through the item icons' reader); thumbnails (capture:) are UI2 images too. - Headless, the UI is ticked at the shots' size and drawn into each (menu_record_image). MkwVkHost version 66 (after 65's engine_text): text_compose, text_area, clipboard_put. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe menu mod mounts one Box on "settings" (vk_menu hosts system/menu's as its body): a Tabs of the renderer's tabs (only the shown panel drawn; the Mods tab's a Slot system/mods-tab fills), each page a Scroll of the kit's Sections and rows. A toggle is the kit's Toggle, a choice, slider and text a Field around its input (its label the input's name for the help box), a binding a Row of its inputs, a ranged line (the Microphone level) its text over the kit's Progress, About and the questions Sections of the page. The focus keys are as before ("@back", "@no", "@yes", "@close:" and each row's key), so Back presses the page's own control and Tune closes the menu. The tests host the page (game.ui2.host) and read UI2's tree. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYMinimap's styles named width and height at the top, which UI2 refuses (size: { width, height }); Link HUD's List had no height, so one row showed and the rest were cut. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe new test is link-hud's rupee log in core: a row, a new one before it, then none. It panics in taffy ("invalid SlotMap key used") until the List's taffy node is replaced when it loses a row. The scrolling page's rows were inserted before node i (the Window for i = 1), which the shadow refuses: each is appended now, so the test reaches Down. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYlistening programs, unset variables and the platform ("unavailable"), nobody listening ("failed"), attempts and connections, as docs/modding/ipc.md and longshot-testing.d.ts say; net.rs hands each IPC open no game.discord() took to fake.js. A test of the fake covers both ways, the close and each refusal. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYvk_ui2.cpp no longer includes vk_modui.h: the pointer read once a present for both UIs, and whether an old-UI window has the focus (MKW_UI2_IN_OLD_FOCUS), live in gpu/vk/ui_input.{h,cpp}. vk_modui.cpp's modui_tick notes its read there and hands its focus check (now static) to ui_input_begin, so the old UI can be deleted without touching UI2. Same behaviour; gpu/vk/*.cpp is globbed by the builder, so no list changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYrow_table (gpu/vk/vk_menu.cpp:509) left out every module row of kind Line ("a line or custom row, which the Insert menu doesn't draw yet"), so the microphone_level meter never reached the declarations, and the menu mod's LINE (its text over a Progress, read every frame with flags.live) had nothing to draw. A line is now kept (no value, no slot in the ini); only a custom row is left out. tests/test_menu_rows_model.py checks a module's line is kept and not logged; menu_rows.json gains the line, as test_settings_decls.py --write makes it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYgame.time was the runner's wall clock in the fake game, so a test's frames(n, { dt }) moved it by milliseconds: Discord's rate and keep-alive were measured in them. It is now the world's seconds, each frame's dt added (world.rs, hooks.rs "time"). read.mapName looked up the map's whole name (SunkenPeak_Adult) in Location.msbt; the game takes its tails off first (longshot-game::reader::place_stem), so the fake reader does too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYimport { stopping } from "longshot"; stopping.on(fn), with the same Stopping payload. The schema allows an event in the module longshot (named alone, as its functions are: feature "stopping"); lifecycle.toml, its module and lifecycle.md go, its text now scripting.md's "When the player turns your mod off". No mod imported the old module. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA relative import ending in .ts or .tsx names that source file: import { x } from "./util.ts". The game's loader, mod check's link and the declarations reader share one resolver (script::modules::find_module). The older forms still load: ./x.js is x.js, else x.ts, else x.tsx (.mjs: .mts), and an extensionless ./x is the first of x.ts, .tsx, .js, .mjs the mod has; mod check warns (import.extension) about an older form that loads a TypeScript file, naming its .ts form. The template's tsconfig and every built-in mod's and example's get allowImportingTsExtensions (with noEmit), and their imports use the .ts form. The guide (getting-started, scripting, testing, workers) says so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYturnOff() stopped the mod with no stopping, so a mod's goodbye went untested. As the loader does, the fake now fires longshot's stopping first: { reason: "dependency", mod } to each running mod beside it that needs it (which then stops too), and { reason: "disabled", mod } to the mod itself. stop() still fires none. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYsettings.changed told a mod of its own settings and, as "<mod>:<id>", of the other mods' settings its mod.json's reads lists, so a listener had to tell them apart. Now changed is the mod's own settings alone, and a read setting has an event of its own, settings.readChanged { mod, id, value } (order 13, with settings.read; the later acquire events move up one). Damage taken listens to the Cheats mod's Debug tools with it. changed.on() takes, first, the ids it is told of: changed.on("text_speed", fn) or changed.on(["text_speed", "text_size"], fn); changed.on(fn) stays. An id the mod does not declare is UnknownNameError when it subscribes (said at once, in the game and mod test alike, where a lint would miss computed ids). The schema marks such an event filter_ids (its ids' TypeScript type, SettingId), which the d.ts types as IdFilteredEvent; a record field may now be a value. The built-in mods and the settings guide use the filter. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYtaffy's min-content measure broke a Text at width 0, and with overflow-wrap: break-word that gave one glyph: a flex item's automatic minimum was a glyph wide, so a button's label shrank to "Tu…". The min-content width is now parley's own (the widest piece between soft wrap opportunities; a nowrap text's whole line), as CSS's is. A width taffy got from the text's own size could also come back a rounding short and push its last glyph or word onto a line of its own ("Restar/t", "Colour vision/>"): lines now break with the half pixel of slack the ellipsis check already had. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe forward declaration put 'int decl_state_locked(' in vk_menu.cpp twice, so the source checks that cut its body (menu_stepped_sliders, microphone_test_gain, intel_quick_compute, menu_restart, upscaler_rows) found the declaration or refused the marker. The code is unchanged, only moved. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe bindings gave an event its namespace from its path's dot, and `stopping`, longshot's own, has none: its namespace was None, the script runtime took it for a handle's event, and `import { stopping } from "longshot"` failed ("Could not find export 'stopping'"), in the game and the fake game. The namespace is now the one that declares it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe mic fix made a scripted run (RX_VK_MENU_SCRIPT) count as focused, so the check's old text mic_tick{mine} no longer matched. It now checks the rule as it stands: the test runs only with the focus, and a scripted run counts as focused. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYswitch_on tried local/{name} and then the bare id, and the ExeFS and code module lists were matched with local/ cut off a row's id: a folder's name could be taken for a manifest mod's id, or the other way round. The builder takes ExeFS patches of manifest mods alone and names them by id, so the loader now looks a switch and a list's line up by the row's id: only a manifest mod is a switch, and nothing is stripped or guessed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYt(key, vars) takes an object for a text's {name}s or a list for its printf conversions in order (%d, %u, %s, %c, %x, %.1f, widths and flags, %2$s positions), and a value may be a text of its own ({ key, vars }), looked up in turn. Each lookup is kept by its key and values until the menu's language changes (8192 at most), so a mod calls t as often as it draws and needs no cache of its own. Unit tests: the printf filling, nested texts, the cache. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA declaration's, a row state's and renderer_setting_text's texts are never finished English now: a literal is its own key, and a text made from a format is its English, MKWVK_TEXT_SEP and {"key": "%d of %d", "vars": [3, 9]} (gpu/vk/menu_text.h: mtext::make, put, Key and Of for a text of its own). Every site that formatted a row text (labels, values, hints, confirms, the binding question, the restart question, the mic meter, the modules' value texts) passes its key and values; the control bridge and the bug report read the English (mtext::plain). A slider declares its unit (MkwVkSettingDecl.unit, GameSettingRow.unit from a system mod's format) instead of the menu working it out from the texts. settings-host gives each text as SettingsHostText { key, vars } and a slider's unit; the fake game takes a test's texts either way. The checks that compile a row's code read its English (MKWVK_MTEXT_ENGLISH). The menu calls longshot/i18n's t(text.key, text.vars) like any other mod: src/tr.ts and src/formats.ts are gone (no format matching, no cache of its own; the Mods tab's went in the commit before). A slider's unit is its declaration's (unitOf gone). strings/<lang>.json stay keyed by the English: the formats made from pieces before (Restart to apply %s?, %s and %s, the pipeline list's and the bug report's lines, %ux%u (native)) take their pieces' translations; five formats nothing makes now are dropped. tests/test_menu_text_keys.py: the texts are keys, and every key has a translation or is listed with why. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYFor windowed checks of the Insert menu and the mods' UI with the mouse: {"cmd":"pointer","action": "move"|"down"|"up"|"leave","x","y","button"}, in the window's pixels. host/posix/display_sdl.c publishes it as the window's own sample, and while the bridge has the pointer the real mouse's point and buttons are ignored (its window size still counts) until leave. Linux only, as key. The fake game's test covers the command's arguments and refusals; the docs say how to click (down, wait a frame or two, up). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe fake game records the tested mod's script CPU each frame, as its runtime counts it for the budgets (callbacks, UI flush, collector): game.scriptTime. The menu's new test draws the Graphics tab with every row of menu_rows.json, reads it again 20 times with a row changed, then switches to each tab and to each page a link opens. It logs the numbers ("menu cost: ...") and holds a steady frame under 1 ms and a switch under 3 ms. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA stop after the faults in a minute was told only as words ("stopped after 3 faults in a minute; the last, in ..."), which the loader's restart of a built-in mod and the menu's fallback matched as text. The reap now gives a Stop: its reason in words, and FaultStop { count, at, what } when its faults stopped it (ModState::stop_faults, set by fault()). The loader keeps it on the row (Row::fault_stop) and restarts a built-in mod by it; no text is matched. The fallback names the menu's system mod that is down, system/menu or system/mods-tab, with its real reason: the faults that stopped it, or its row's why on a line of its own when it did not start; Restart the menu starts that mod again. Its two texts take the mod's id ("(%s)") in every language. Tests: the mods-tab-only case, a plain stop, the runtime's FaultStop. Also drops legacy_switch from the loader test's SystemEntry (gone with l5w2). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA test reads each scaleConstant hook as published ({ owner, program, buffer, word, factor, reciprocal }), so a mod's test can check a factor follows its setting. FakePrograms is kept by the session for it; gfx.md and the testing types say so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe table that decided which of the game's sounds are Navi's, the ocarina's and so on (host/audio_source.h's classes) and their twelve rows move into a TypeScript system mod, system/controller-speaker, over a new generic API: audio.routeToPad(archive, asset, { mode, rumble }) under its own permission audio.pad (schema, generated d.ts and docs), a PadRoute handle with setMode. Patterns are globs with '|' alternatives; the first route made has a sound. api::services::pad_routes holds the routes, longshot-game::pad_routes answers the host (game.h game_pad_route_*), and the host reads the player's archives again when the patterns change. The host keeps the archives' reading and the speaker, and no sound name: HOS_PAD_SPEAKER_<CLASS> and _OCARINA_RUMBLE are gone (the ocarina's half rumble is its route's rumble 50), as are the renderer's class rows, opts.pad_speaker and HOS_OPT_PAD_SPEAKER_CLASS*. The rows keep their keys (MOVED to game:CONTROLLER_SPEAKER) and places. The C tests use made-up names; the fake game's game.audio.padRouteOf checks the mod's table against the old classes' cases. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe UI core animates styles with no script a frame: transition (opacity, colours, translate, scale, size) eases a style change, enter plays as a node first shows, exit as a HUD root or a window goes (from its last draw list), and mount(..., { for }) unmounts a root after seconds (the lifetime op, the expire event). translate and scale are new painted properties. The fake game's UI clock is its frames' dt; game.ui.look gives the animated look. Area names is ported onto it (banner.ts gone). Docs, d.ts and core tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe title's removal had turned the comments about C files gone before it (once host/ or game/'s files named for the title) into names of game_*.c files that never existed. Each is gone or points at the code's home now: the history notes in the Rust and the mods that replaced that C are dropped ("This was ...", "ported from ..."), the host's and the renderer's references point at the Rust that holds the code (game-core's menus.rs, fixes/*.rs, longshot-game's layout.rs, game/mods/sprint-walk ...), and game/DESIGN.md's port table names the C it ported in words. docs/user/images/guide/manifest.json keeps a past revision's file path as it was (an exception of tests/test_no_game_title.py), and the discord golden's harness saves the area names' C under a name of its own. The builder's .nup picker asks for "your game dump (.nup)" and says what it takes: one .nup file, version 131072 (build e0f3ccfa); recomplauncher.json's game input says the same. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYsprint-walk's sprint setting is in the snapshot ("abi": ["renderer"], game/settings_abi.h and host-sys's mirror regenerated by schema-gen), and gpu/vk/menu/sprint.cpp's applier lays Sprint's controls out when it moves. Before, only a change in the Insert menu did (game_rows.cpp's renderer_follows, gone): LONGSHOT_SET and the control bridge changed the setting and left the controls as they were. The value the run started from (menu::first_snapshot) moves nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYsystem/menu faulted in ChoiceRow ("cannot read property '0' of undefined"), and with it every keys3 check that opens the menu and the menu mod's own tests: view.ts placed each declaration on its page with a spread, { ...d, page, section }, but host.ts's declarations look their texts (label, help, choices, verb, confirm) up through getters on their prototype (00fda763), which a spread drops; the copy's choices were undefined. The code was wrong: placed() copies the declaration with its prototype. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe menu mod answers Restart Needed and Keep changes? with settingsHost.answer(yes), which is settings_link::action(Answer). Before, it went through set("@ask", 0|1) on the renderer's question row. The fake game's menu.asked lists the answers as "answer 0|1". @ask's state text still gives the restart's list of settings. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYServices gets a new host, SettingsAtStart (longshot-game's settings_now::AtStart). It gives a native setting's value at the start, which keys changed since the start (an output size by its width and height), and whether the mods changed. - settingsHost.status() gains restart: while the question is Restart Needed, the keys of the placed native settings that take a restart and changed, in the menu's order, then "mods". - The menu mod names them from its declarations' labels ("the mods" for theirs) and joins them the old way (listOf: "%s, %s" then "%s and %s"). It no longer reads the renderer's @ask row. - The Controls grid's gamepad names use Button prompts' value at the start, as the renderer did. The setting applies at the next start. - The fake game's menu.status({ restart }) gives the list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA reload now compiles each TypeScript module of the mod's folder first (ScriptHost::check, the game's own compiler through script::ts::check_folder; not test/, node_modules or dot names). One that does not compile stops the reload before dev.reloading: the old instance keeps running, the error is logged and put on the row, where the Mods tab's status ("Running. Its new code does not compile, ...") and the inspector's show it. The next reload that compiles replaces the instance as before and clears it. For every folder mod, and the system mods of HOS_SYSTEM_MODS_DIR. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYLsCapabilities (LS_CAPS_LAYOUT 10) gains what only the renderer's rows knew: - reshade_files (LS_CAPS_LIST, the User preset file's files), outputs and mics (the Output device's and the Microphone's names in their rows' orders); monitors, gpus and the sizes were there; - upscaler_why[3]: why DLSS, FSR and XeSS are not offered, each a text key ("" offered), as the Upscaler's line said; - dlss_fg_most and framegen_by_fixed: Frame generation's multiplier end and Frame generation by with nothing to choose; - locked (LsLocked: key, why): the settings locked now and why, for the DLSS, upscaler, Render resolution, frame generation, Intel, present queue and ASTC rows. They read the rows' own locked() for now; 4b-4 moves each into a module function. generation moves on when any of them changes. host-sys mirrors them with readers (reshade_files(), outputs(), mics(), upscaler_why(), locked()), the field list and the size checked against the header. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYshaderc-sys is configured by CMake, which keeps its compiler in the build-script output's CMakeCache.txt and refuses another ("You have changed variables that require your cache to be deleted"): a work folder warm from before the pinned clang for Linux's cc (the last commit) failed in cargo build -p longshot-rs. The builder now records the C compilers it gives cargo in rust-target/cc-env.txt; when they differ (or the record is missing), every -sys crate's build output and fingerprint go, once, with a line in the log. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYthe_mirrors_are_the_headers_structs cut each line at /* only, so a comment's second line in LsRendererStatus (the options file's lines note) was read as fields ("/", "open"). The struct's body is read with every comment taken out first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYbuild-linux.yml names upload-artifact in a comment before its tools check, and its cache paths start with ${{ runner.temp }}: the check finds the upload step's uses: line, and reads each path whole rather than split at spaces. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYdecls() answers { generation, decls } at once, read from the settings service each call: nothing waits on the renderer any more. The off-thread read, its kept answer and 'ready' are gone, from the schema too, and changed no longer fires for a read becoming ready. The menu mod drops its not-ready path. The page still says Loading for its first frame, until its rows are read. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY- Custom output size is now an options row with a new codec, outputText. Its value is output_res's line as the size typed ("" for the game's own). A size is checked as the field's apply checked it (the width, an x, then the height; each rounded down to a multiple of 8; at least 640x360, at most 5120x2880's pixels, 5:4 to 48:9) and written as output_res=WxH, through the options document, which keeps the environment's hold. settingsHost.putText rejects a bad size with the field's own words. - Dynamic resolution's value and set go through the game's options document. A new SettingsAtStart host has dynamic_resolution and set_dynamic_resolution (longshot-game: DocOptions). A change also makes the Quality preset Custom. Its run value follows the document each step, so the Render resolution's shownIf stays right. - Test vibration's cell and line come from the renderer's vibration status. Save my pipeline list's cell (Save / Saved / Not saved) comes from its pipeline_list status. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY- game.menu.declare(decls) now makes each test declaration a setting of a native mod's own (system/menu-test) in the settings service: a toggle, a choice (its choices, or a value from 0 to hi), a slider, a button, a text or a binding, each placed on its page. The menu's own kinds (tab, page, heading, link, line, question) are its layout's and are skipped. - setRow(key, { value, locked }) sets the setting and its mod's lock. - asked lists the mod's changes of them (set k v), the renderer's buttons pressed (press k), the answers and the recordings. - setLang and upscaler set the renderer's status (menu_lang, upscaler), and status() keeps them. - setText and hold are gone. reads counts settings-host's reads, kept per thread. - menu.test.ts follows: the texts come from declarations, the renderer-made texts' and Loading-while-held tests are gone, and menu_rows.json's rows go by the menu's keys. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY- settingsHost.bind's pad and key slots now go through host_sys::bindings::bind: hos_rebind_control with ONE_KEY and Rebind's SWAP as the Controls page's binding_take used them, and hos_bind to clear a slot. The game's options document then writes the controls' pad_/key_ lines and the Layout preset (SettingsAtStart::controls_changed, DocOptions::put_controls, which the renderer's save path shares). A binding's slot values move to host_sys::bindings::slot. - The caps' new lists are choicesFrom choices: aspects ("21:9", "%s (monitor's)", "Monitor's shape" when the shape is not known), menuLanguages, gameLanguages and nfcTags, each name shown as it is. - Nothing in api, modtool or longshot-game reads the renderer's rows any more. host-sys's renderer_settings module, its fake (fake::settings) and the rx_setting_* externs with MkwVkSettingDecl/State are deleted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe bridge's key command needs a window, so headless test runs could drive the Insert menu only with RX_VK_MENU_SCRIPT's keys at fixed times from the first present, one boot per script. menu_key ({"cmd":"menu_key","key":"down"}) hands one press straight to the renderer's key presses as the bridge's (hos_vk_note_bridge_key_press, which the menu already counts without a window or the focus), when the test asks: one running game can be driven through many menu walks, each waiting on the game's state. No renderer change. The names (host/control_menu_key.h) are checked by a game-free test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYmenu_game_set("quality_preset", 1) is made at the game's next frame, after the plain scale's lines, whose rows the preset's rules then set back. The renderer now sets Minimum's rows and the plain scale itself and hands each to the game as its line, the preset left as it is, as apply_preset(1) did. hand_line's comment says what the game does with a line: keeps it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe renderer's model, row table and slots are gone (4b-4); the menu's layout is the menu system mod's (game/mods/menu/src/layout.ts) over the mods' declarations. - Deleted, with their cover: - test_menu_modules.py (every module's place resolves, its rows in order): menu.test.ts "layout: every tab draws its rows, headings and links in the menu's own order, each with its label" and "a row the layout does not name goes where its place says", and longshot-game menu::tests::every_system_mods_row_keeps_its_place. - test_menu_module_slots.py (kModuleRowsMax, rows left out): menu.test.ts "layout: the menu names every row the renderer has once, and no key the settings do not hold"; no slots are left to run out. - test_menu_decl_state_hint.py (decl_state_locked's hint): the hints are the declarations' and the game's (api settings_host::tests::a_game_rows_scale_and_lock_reach_the_menu, menu.test.ts "a row's texts are its declaration's"). - test_renderer_setting_states.py (MKWVK 67's member, gone at 77): the members now wired are test_settings_link.py's. - test_settings_decls.py (the golden from the renderer's decl_build): FROZEN's renderer keys declared is test_settings_area_keys.py's; the rows the mod draws are menu.test.ts's. - test_menu_sections, test_settings_table: read layout.ts's tabs, headings and links with the declarations' labels and conditions. - test_menu_locked_button: a locked row's press is refused by settings-host's press before any press runs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYThe renderer's Controls page gave Sprint's Toggle cell its help ("Toggle for Sprint: On, a press of its key or button starts Sprint ..."); with the page the menu's, the text was left only as a key of the translation tables. The menu's binding row gives it again (TOGGLE_HELP, by the binding's key), its English the strings' key, with a check in the fake game. menu.test.ts: the countdown check lets the language's change redraw before it answers; the binding check says which pad values it saw. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYgpu/vk/menu_text.h and the renderer's declarations went with its rows: the renderer makes no menu text. The keys are now the area mods' setting labels (the renderer's rows' until the cutover), the menu mod's layout labels and the keys and literal texts settings-host and the other api services hand the menu ({"key": ...}, text_json). UNTRANSLATED and SAME_IN_SOME lose the renderer's formats that nothing gives now and take the game's texts with no translation yet. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYMKWVK 77 took the rows' reads off the API, and with them the only thing that set the renderer's page_read: menu_on_tab("audio") was false from then on, so mic_test_tick stopped the test the frame it started (Test microphone did nothing; boot's mic check). settingsHost.rows now tells the renderer the page of the rows it reads, when it moves. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uYA job's scope was named by its name and process alone. dev.py packs builder runs longshot-builder's compile as two jobs in one process, and the first's scope lives on while an sccache server it started is in it: the second's systemd-run failed ("Unit longshot-job-longshot-builder-<pid>.scope was already loaded"), and the build with it (three builds of five here). The scope is named by when the job was queued too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY## Summary Mods can register usable items in **Quick Select Items**, which opens with **L** or **R** by default. Confirming an item equips it. A script can read the selection and set the count shown on the tile and HUD. An item can reserve a + menu slot with `slot: { id }`. Until the layout supplies its button, the item remains available in Quick Select Items. The Hookshot retains its icon and the previous native item loses its highlight when a custom item is equipped. Creating layout buttons is future work. The branch is now based directly on `mod-api` at `e544bc2e9`. Controller PR #2516 has merged, so its commits (and the compiler-selection fix to `tests/test_pad_motion_policy.py`, which landed with it) are no longer carried here: this PR is the 11 item commits only. In the port, the removed `sites.def` lines became `engine =` keys on their `sites.toml` rows, and the fake game's RomFS uses upstream's `game.romfs`. This supersedes #2340. See `game/crates/game-core/src/equipment.rs` for menu behavior and `docs/modding/api-guide.md` for the mod-author example. [Diff against the base](e544bc2e9...e0202d7c3) ## Testing **Tested:** Windows, GeForce RTX 3090, on `e0202d7c3` (packed over a `mod-api` base), Adult Kakariko with a test mod adding three custom items. The custom items appeared in Quick Select Items with icons and shadows. Equipping them and using them changed their HUD counts. With a custom item equipped, the + Items page opened, closed and reopened with no stale native highlight. Switching back to the Hookshot, it showed and worked normally. The test mod passes `longshot-builder mod check` on this head. On the ported head, the unit tests pass apart from failures that also fail on plain `mod-api` at `e544bc2e9`. Before the port, all 236 content, 312 OOT and 30 game-site tests passed with the game-site suite run serially, the Rust mod tool regression passed for selection, trigger release and independent equipment slots, and all 27 ported hook contracts and placements matched the prior implementation. **Still to test:** - Linux, by hand. Equip a custom item, switch back to the Hookshot and reopen the + Items page. Check selection, HUD count, native highlight and menu transitions. ## Measurements The earlier Windows play log recorded 60.0 fps in its final two reporting intervals. A matched, interleaved performance comparison against the base is pending. ## Risks Both menus use the same pouch row IDs. The changes reorder display entries and skip missing buttons while retaining those IDs. Incorrect mapping could affect a native upgrade, cursor movement or an icon. Custom selection lasts for the session. ## Checklist The integration target is `mod-api`. The change is complete and hand-tested on Windows on `e544bc2e9`. `mod-api` has moved on since; against its current head this branch conflicts only in three docs lists (`docs/modding/permissions.md`, `reference.md`, `scripting.md`), and the code merges cleanly. I will rebase on request when it is picked up for merge. The strict suite, matched timings, paired screenshots and Linux verification remain open. ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [ ] 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] A fix: a game-free test that fails on `main` and passes here. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [x] Docs updated. - [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. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] 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) Co-authored-by: snaildev99 <[email protected]> Reviewed-on: #2528## Summary The runtime takes a mod's content by its id (`items.grant(":Rupee7")`), but its flags only by their game names. A mod that declares a flag with `content.flag({ id: "Seen" })` has to write `"M1a2b3c4d.Seen"` everywhere it uses it: the FNV-1a hash of its own id, worked out by hand. `content.md` lists `:id` for flags as not yet. Now `game.flags.get`, `has` and `set`, and `flagChanged`'s filter, take a mod's content flags by their ids, as the rest of the runtime takes its content: ```ts flagChanged.on((e) => log.info(`${e.flag}: ${e.value}`), { flag: ":ChestOpened" }); // e.flag: "M37444242.ChestOpened" flags.set(":ChestOpened", 1); flags.get("other/mod:Seen"); // another mod's ``` - `":id"` is the calling mod's own flag, `"owner/name:id"` another mod's; each is read as the game name `content.flag` makes (`content::plan::word` and the id). A game name is taken as it is. A mod's tests, which the game runs as `tests:<id>`, name its flags as the mod does. - `flagChanged` tells the flag's game name in `e.flag`, whichever way the listener named it: the filter is kept as the game name when the listener subscribes, so it matches the event. - In `game.flags` and the `flagChanged` filter, a name with a `:` that names no flag (no id after it, an id that is not a declaration's) is `UnknownNameError`; `has()` is false. The test game's `flag()` returns `undefined` for such a name. - The test game's `flag()` and `setFlag()` take the same names (it runs the same services). Read first: `flag_name` and `flag_watch_refused` in `game/crates/api/src/services/game.rs`, then `watch_refused` in `game/crates/script/src/runtime.rs` and its caller in `script/src/bind/mod.rs` (`api_on`: the filter the hook hands back is the one kept). The test game: `flag_name` in `game/crates/modtool/src/testing_game/hooks.rs`. This is #2572 moved onto the current `mod-api` (rewritten since), on a new branch so the pull request is only this change; #2572 can close. It was #2287's change to the C mod API first. Part of #1958's Modding API; targets `mod-api`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24. In the game: a quick build of current `mod-api` with this change and the flow patches' (#2656), `dev.py game-tests`, the repository's `kokiri-start`. A mod's own test passes: the mod reads its content flag as `":Seen"` (0, `has` true, `":9Seen"` refused with `UnknownNameError`), sets it (`game.flags.set Mf7b05380.Seen 0 -> 1` in the log), `flagChanged` tells `Mf7b05380.Seen 0 -> 1`, and the test's `game.flag(":Seen")` reads 1 (a mod's tests, run as `tests:<id>`, name its flags as the mod does). Checks: `cargo test -p api -p script -p modtool` (api's `flag_name` against an FNV-1a written out in the test: a game name, the mod's own, another's, six names refused; script's service hooks keeping a `:id` filter as its game name; modtool's testing_game: a mod that reads, writes and watches its flag as `":Seen"`, `e.flag` its game name, a bad name returning `undefined` from the test's `flag()`, the test's `flag(":Seen")`); `cargo check --workspace --all-targets`; `cargo run -p schema-gen -- --check`; rustfmt. Two tests fail on `mod-api` itself and here, on Windows: `api`'s `a_content_mods_changed_module_runs_again_and_its_outputs_are_served` and `modtool`'s `eden_and_ryujinx_mods_are_found_with_their_switches`. **Still to test:** - Linux, and clippy with warnings as errors: `mise run rust` and `mise run test` (by hand, or CI) ## Measurements Nothing to measure: a name without a `:` costs one search for it; a `:id` name is one FNV-1a over the mod's id per call, and `flagChanged` names it once, at `on()`. ## Risks A game flag's name never holds a `:`, so no name that worked before reads anything else now. The generated docs' schema hash (`docs/modding/*.md`) conflicts with any other schema change: whichever of this and #2656 merges second needs `cargo run -p schema-gen` again. A filter given as `:id` tells `e.flag` as the game name, which a listener comparing `e.flag` to the text it gave would not expect: the docs and the record's doc say so. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). <!-- Windows run as Testing says; clippy and Linux: CI --> - [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] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. <!-- Windows built and played; Linux: CI --> - [x] Docs updated. - [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. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] 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) Co-authored-by: BeanBot <[email protected]> Reviewed-on: #2657## Summary Mods can't tell when the ocarina plays a song, or how it was played. A mod that wants to react to songs (a tracker, a randomizer, a mod that changes what a song does) has nothing to listen to, and an event flow can't branch on whether a song was sung or pressed on the buttons. This adds two things to the Modding API: - **`songPlayed`** in `longshot/game`: `{ frame, song, source }` for the first song the ocarina recognises in each try, keeping at most 16 songs between frames. `song` is one of the game's thirteen (`sunsSong`, `preludeOfLight`, `scarecrowsSong`...), `source` is `"microphone"` (sung or played on an instrument through the game's Ocarina Mic Input option) or `"buttons"`. It arrives at the acquire phase like the other game events (order 28). A filter keeps a listener to the songs it wants, as `flagChanged` does: `songPlayed.on(fn, { song: "sunsSong", source: "microphone" })`. - **`bind: "ocarina.sung"`** on a `content.flag` bool: the game side sets the flag on the game's own thread the moment the song is recognised, before the event flow goes on, so a flow (with a flow patch, #2656) can branch on it with no script in the way. It comes from the same site as `songPlayed`, so `has("game.songPlayed")` says whether a build sets it. How it's found: the event flows ask the query node `QueryMelodyTypeForNormal` (`f_82a7c980`) which song was recognised; a new core site `ocarina.melody` sits just after its answer (`w1`), with an engine callback. A try is one run of the note-wait action (the existing `ocarina.waitStart`), told once. It's the buttons' when a note button went down in the word the game reads during the wait, including before the first controller read of the try; a button already held is not a note until released and pressed again. It's the microphone's when no note button went down and the game listened on the microphone at some point in the wait (the game stops its streams just before it recognises the song, so this is kept for the whole try). If neither happened, it's the buttons'. Read first: `game/crates/game-core/src/ocarina.rs` (the try, the site's callback, the bound flags, what the API takes), the site's row in `game/sites/sites.toml`, then `game_events_step` in `game/crates/api/src/services/game.rs` and `content_binds` in `services/content.rs`; the schema's `songPlayed` (`game.toml`) and `Song`, `SongSource`, `SongPlayed`, `SongFilter` (`types.toml`). The host's part is small: `host/nn_hid.c` `oc_track` hands each read's five note buttons and `host/nn_audio_in.c`'s new `hos_mic_listening` to `game_ocarina_notes` (`game/game.h`). The test game plays a song with `game.playSong(song, { source })`, through the same `game_core::ocarina::tell` the site uses. This is #2267's change, made again on the Rust mod API and the new hook sites; #2267 (the C mod API) can close. Part of #1958's Modding API; targets `mod-api`. Magic Singing (a mod that skips the song cutscene when you sing) uses it with the flow patches (#2656) and flags by id (#2657). ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24. In the game (a quick build of current `mod-api` with this, #2656 and #2657; `dev.py game-tests`, the repository's `kokiri-start`): the lift places `ocarina.melody` in `f_82a7c980` (`gen/edits.txt`); a mod that `requires` `game.songPlayed`, declares a flag with `bind: "ocarina.sung"` and listens to `songPlayed` (once with a filter) starts, `has("game.songPlayed")` is true, its bound flag is in the game, and its test passes. Checks: `cargo test -p game-core` (`ocarina`: a try told once, on the buttons or heard, a held button that is no note, none recognised, nothing kept while not watched), `-p content` (the content vectors: a bound bool flag, `bind` refused on an int and for an unknown target), `-p modtool` (the test game: `songPlayed` and a filtered listener, the bound flag set at once each way, an unknown song refused), `-p api`, `-p game-sites`, `-p sites --test repository`; `cargo check --workspace --all-targets`; `cargo run -p schema-gen -- --check`; rustfmt. Tests that fail on `mod-api` itself and here, on Windows: `api`'s `a_content_mods_changed_module_runs_again_and_its_outputs_are_served`, `modtool`'s `eden_and_ryujinx_mods_are_found_with_their_switches`, and `longshot-game`'s three path tests (`a_folder_of_mods_tests_each_of_its_folders`, `a_mods_profile_sits_inside_the_launchers_save_folder`, `a_separate_mod_moves_the_saves_into_its_profile_and_records_it`). The C version (#2267) was played: songs on the buttons told once as `"buttons"` with the bound flag 0, songs sung told as `"microphone"` with the flag 1 and the flow taking the bound branch. The site and the offset are the same here. **Still to test:** - Songs played in this build: one on the buttons and one sung, `songPlayed` and the bound flag each way (a playtest: the ocarina in hand) - Linux, and clippy with warnings as errors: `mise run rust` and `mise run test` (by hand, or CI) ## Measurements Nothing to measure: the site runs once per recognised song and sets nothing while no mod listens or binds a flag; the note tracking is a few loads and compares per controller read. ## Risks A new engine site in the melody query: if its signature stops matching on another build, `songPlayed` is absent there (`has()` false), a bound flag stays false, and nothing else changes. With no mod using it, nothing a player notices. The generated docs' schema hash (`docs/modding/*.md`), and `testing_game/tests.rs` beside #2657's new test, conflict with #2656 and #2657: whichever merges later needs `cargo run -p schema-gen` again and both tests kept. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). <!-- Windows run as Testing says; clippy and Linux: CI --> - [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] A check under `tests/` that reads changed source is updated, not weakened. (`builder/crates/sites/tests/site_owners.txt` names the new site) - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. <!-- Windows built and played; Linux: CI --> - [x] Docs updated. - [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. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] 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) Co-authored-by: BeanBot <[email protected]> Reviewed-on: #2658## Summary `world.ray` is in the Rust mod API, cast on the physics step's own thread, but Preview: no run had shown it, and `has("world.ray")` had no answer at all (the feature table had no line for it, so it was false even with the Preview list lifted). A first run shows the cast works, and shows its one guess was wrong: the "scenery" preset (48) is every layer, Link included, so a ray down through him stopped on the top of his head, 1.17 m above his feet. A colliding camera rig casts the same ray, so its eye would stop on Link too. This makes rays a feature, with what other engines' raycasts offer (Unity's `Raycast`/`RaycastAll`, Unreal's line traces, Godot's `intersect_ray`), on the same step-thread design: - **`ray(from, to, options?)`** and **`rayAll(from, to, options?)`** (new): the nearest hit, or every hit along the ray, nearest first, each body once and an actor's several bodies one hit (at most 16). `rayAll` is the game's own every-hit ray query (Havok's all-hits collector), built as the game builds it. - **What it hits, by kind** (`RayOptions`): `ground`, `objects`, `characters`, `water` on by default; `player` (Link) off, so a ray cast from Link doesn't stop on him at once. Each kind is the game's own entity layers, named in the binary and checked a bit at a time in a run of the C mod API's rays (#2422). - **`ignore`**: an actor's key; the ray passes through its bodies (their collision group, as the game's own helpers put it in a ray's filter). - **What it hit** (`RayHit`): position, normal, distance as before, plus `kind`, `actorKey` (the actor whose body it is, for a mod with `actors.read`) and `inside` (the ray started in it). - The camera's `collide` asks for the ground alone (`Ask::scenery`). - `has("world.ray")` is true where the build has the query and both step sites; `has("world.rayAll")` where it also has the every-hit query (`rays.allInit`, `rays.hitsVtable`, `rays.hitsClear`). How, in short: the query is built as before, its filter set from preset 48 and then given the asked kinds' layers, and an `ignore` group. `ray`'s hit kind is the ray cast again with one kind's layers at a time until the same body (by its handle) is hit; a ray of one kind costs one cast. `rayAll` is the game's own every-hit ray query: the ray query's cast method reads a mode at `+0x8c` (0 Havok's closest-hit collector, the ground check's and `ray`'s; 1 its all-hits collector, each hit made a record in the query's hit list at `+0x68`). The game's f_83010540 (the water's surface and the ground under it) builds one with f_83010ac0, which makes the list in the query's own buffer and sets the mode, casts it with the same executor, walks the list and clears it; `raw_all` does the same. One cast, whatever the ray passes through; each hit's kind is its body's own layer; each body's nearest record kept and an actor's bodies one hit (their collision group: Link's two). Which actor a hit is: the listed actor one of whose bodies has the hit's handle, on the main thread as the answer settles. A slot's ask and answer move behind a lock each that only the state's owner takes, so they can carry the hits. Read first: `game/crates/game-core/src/rays.rs` (`Kind`, `Ask`, `Answer`, `raw`, `aim`, `classify`, `raw_all`, `contacts_of`, `cast`, the actors' bodies), its layout in `layout/rays.rs` (the every-hit query's at the end), the `rays.*` named locations in `game/sites/sites.toml`, then `ray_ask` and the answers' JSON in `game/crates/api/src/services/world.rs`; the schema's `ray`, `rayAll` (`world.toml`) and `RayHit`, `RayKind`, `RayOptions` (`types.toml`). `docs/dev/reference/world.md`'s Rays has what was read and run. This is #2422's change, made again on the Rust mod API's own rays; #2422 (the C mod API) can close. Part of #1958's Modding API; targets `mod-api`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24. In the game, quick builds of this head, through `dev.py game-tests`: - **Link's house** (`kokiri-start`), rays from 2 m above Link to 3 m below him, all answered a frame after they were asked: the default kinds meet the ground at his feet (y 118.44), no actor; `player: true` the top of his head with `kind` `player` and his key; with `ignore` his key, the ground; from his chest, him at once with `inside`; `ground: false`, a miss. `rayAll` with `player: true`: him once (two bodies) with his key, then the ground at his feet; with `ignore` his key, the ground alone. - **Kinds, in Kokiri Forest** (a second probe takes Link there with `world.travel` and casts straight down through every listed actor): the withered Deku Babas met as `character` with their own `actorKey`, by `ray` and `rayAll`; grass as `object` with its own key; the treasure chests and trees as `object` (no key: hit on a body their actor's list does not name, as documented). Water-only rays over a grid met the stream; at open water the default kinds met its surface as `water`, `water: false` the bed 0.20 m below, `rayAll` the surface then the bed. Under a ledge, `rayAll` gave the ledge's two ground bodies, then the water. - **A colliding camera rig** (on a local build with `camera.override.collide`'s Preview lifted, not in this branch): the eye 6 m behind Link in his house, `collide` on, stopped 1.44 m from its pivot, short of the wall; off, 6.00 m; on again, 1.44 m. Checks: `cargo test -p game-core` (`rays`: the query as the ground check builds it; `ray`'s nearest by kind in a made-up world answered as the executor does: the default kinds, the characters off, Link asked for and told from the ground, from inside him, his group passed through, a hit past the end, nothing asked; every hit through the game's every-hit query faked as the build has it: its constructor's list and mode, an executor filling the list in no order with Link's two bodies and a floor's two triangles, each thing once and nearest first, kinds from the bodies' layers, the group passed through, from inside Link, a miss, nothing asked making no query, every list cleared, a list not the build's refused; without the sort it fails; the slots), `-p api` (the answers as RayHits, a key only with `actors.read`, `rayAll`'s list; the features), `-p modtool`, `-p game-sites`, `-p sites`; `cargo check --workspace --all-targets`; `cargo run -p schema-gen -- --check`; rustfmt. Tests that fail on `mod-api` itself and here, on Windows: `api`'s `a_content_mods_changed_module_runs_again_and_its_outputs_are_served` and `modtool`'s `eden_and_ryujinx_mods_are_found_with_their_switches`. **Still to test:** - A colliding camera rig played by hand (`camera.override.collide` stays Preview here until its own change lifts it) - Linux, and clippy with warnings as errors: `mise run rust` and `mise run test` (by hand, or CI) ## Measurements Nothing measured: with no ray asked the step sites stay off, as before. A ray is the game's own query: `ray` one cast plus one per kind tried to tell its kind (none when one kind is asked), `rayAll` one cast of the game's every-hit query, whatever it passes through. They run on the physics step's thread, after its step. ## Risks Only mods that cast rays, and a colliding camera rig (still Preview), reach this code. The camera rig's ray now asks for the ground alone (preset 48 hit Link before, the rig's own pivot). A build whose every-hit query differs (its hit list's vtable not the build's) gets no `rayAll`: `has()` false, nothing read or cleared. The test game still has no world to cast against: `has("world.ray")` is false there, as before (a fake caster for tests is a follow-up). The generated docs' schema hash conflicts with any other schema change: whichever merges later needs `cargo run -p schema-gen` again. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). <!-- Windows run as Testing says; clippy and Linux: CI --> - [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] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. <!-- Windows built and played; Linux: CI --> - [x] Docs updated. - [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. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] 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) Reviewed-on: #2662## Summary A mod can't change one of the game's event flows (the cutscenes and scripted moments: a song played, a door's question, a chest) without shipping a whole replaced copy of the game's file. That copy is game data, so it can't be shared, and two mods changing one flow overwrite each other. This adds a new kind of typed patch, `"flow"`, next to `ops`, `rows`, `placements`, `texts`, `flags` and `rails`, in a mod's `patches/` folder or through `content.patch`. It names the flow's own events, so the mod ships none of the game's file: ```json { "target": "Event/EventFlow/Dm_SY_Ocarina.bfevfl.zs", "flow": [ { "op": "action", "id": "Tune", "actor": "GameSystemActor", "action": "EventTriggerPlayAutoFixedTune", "params": { "IsLearningWarpMelodyDemo": false }, "next": "Event137" }, { "op": "branch", "id": "TuneIfSung", "before": "Event171", "flag": ":Sung", "then": "Tune" } ] } ``` - **`action`**: a new action event, an actor and action the flow already has, with params, then its next event. - **`branch`**: a check of a bool flag before an event. Whatever went to that event (events before it, a switch's cases, a fork's branches, an entry point) goes to the check; clear goes on as before, set goes to `then`. Two checks before one event chain. A fork's join is never moved. The flag is the game's by its name, or a content flag by its id (`":Sung"` the mod's own, `"owner/name:Sung"` another's), as the runtime takes content. Each mod's new events are named after it (`local/my-mod.Tune`: its id, a `.` and the op's), so mods never collide, and their patches apply in the Mods list's order, each on the one before's output. An op naming something the flow doesn't have is left out with its reason in the log; the rest apply, as with the other typed patches. Flow patches never conflict. The target's own header (`BFEVFL`) picks the applier: a flow patch aimed at another file fails by itself, and that file's other patches still apply. A patched flow's cached file is named by each flow patch's mod id as well as its text, since its events and flags are named after the mod. Longshot writes the patched flow with its own writer: every byte of the game's file before its relocation table is kept (a flow is taken only when its flowchart, events and the pointers its table names are all before that table), the events move to a longer array after it, the new events' params (with a DIC built as Nintendo's tree, so the game finds each param by name), cases and texts follow, then a new relocation table. The game's `EventQueryIsGameDataBool` answers **0 for a set flag and 1 for a clear one**, so a check's case 0 is "then". A text param is at most 65535 bytes, the longest the format's u16 length holds. Read first: `game/crates/content/src/evfl.rs` (the reader, the ops and the writer), then `read_flow_op` in `content/src/patch/parse.rs` and the flow branch of `apply` in `content/src/merge.rs`; the schema's `ContentPatchFlowOp` types it for `content.patch` (the test game reads patches with the same reader). Docs: `docs/modding/files.md`, "Event flows". This is #2578 moved onto the current `mod-api` (rewritten since), on a new branch so the pull request is only this change; #2578 can close. It was #2268's change to the C mod API first. Part of #1958's Modding API; targets `mod-api`. Magic Singing uses it with `songPlayed` (#2658). ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24. In the game (a quick build of this head on current `mod-api`, which has the flags by id, #2657, and `songPlayed`, #2658; `dev.py game-tests`, the repository's `kokiri-start`): a test mod with Magic Singing's 96-op patch on the ocarina's flow (`Dm_SY_Ocarina`) and its two content flags. The patch applies at the start with no op refused, the game loads the patched flow (`Dm_SY_Ocarina.bfevfl.zs <- modcache\files\... (made of the mods' copies)`), and the mod's test passes in play. This build made the patched flow fresh, and it is byte for byte the file served on the previous `mod-api`, which was read back with the evfl library: all 96 ops as written (the actions' actors, actions, params and next; each check `EventQueryIsGameDataBool` on the mod's flag, case 0 to `then`), the 330 original events unchanged but their links, the 102 links into the 46 checked events moved to each chain's first check, no fork's join moved, the 20 entry points as they were. Checks: `cargo test -p content` (`evfl`'s own tests on a made-up flow, read back by a reader of the test's own: two mods' actions and checks in order, their params found by name through the DIC as the game looks them up, the bytes kept, every pointer in the relocation table; a flag by a mod's id, the patching mod's own and another's; bad patch files and a file that is not an event flow refused; the output past the largest flow refused; the DIC finding every name of many; a flow whose flowchart is after its relocation table, or whose table names a pointer past the data, refused; a text param of 65535 bytes applied whole and one of 65536 left out. `merge`'s tests: two mods' flow patches served in order; the same patch text under another mod's id made again for it; a flow patch aimed at a parameter file failing alone, the file's other patch applied. Each of the review's four tests failed on the commit before the fix. The content vectors, which hold the reader to the flow rules); `cargo check --workspace --all-targets`; `cargo run -p schema-gen -- --check`; rustfmt. **Still to test:** - Linux, and clippy with warnings as errors: `mise run rust` and `mise run test` (by hand, or CI) - The patched flow played with a check's flag set (`songPlayed` is in `mod-api` now): a by-hand playtest, as a headless run cannot play the ocarina ## Measurements Nothing to measure in play: the patch is applied once at the start, with the merged files; a patched flow is a few kilobytes larger than the game's. ## Risks Only mods that ship a `"flow"` patch reach the new code; with none, nothing changes. A flow patch that routes the game somewhere wrong is the mod's to fix (turning the mod off restores the game's flow). The generated docs' schema hash (`docs/modding/*.md`) conflicts with any other schema change: whichever of this and #2657 merges second needs `cargo run -p schema-gen` again. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). <!-- Windows run as Testing says; clippy and Linux: CI --> - [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] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. <!-- Windows built and played; Linux: CI --> - [x] Docs updated. - [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. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] 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) Reviewed-on: #2656bd7bcb52into mod-api, over l50's builder commit3d1396c4(#2434) 8646b7de06A manifest's permissions and optionalPermissions are Vec<ManifestPermission> (Plain(Permission) or Net(origin), the origin normalized), parsed when the manifest is read. Grants hold the typed set; ModApi::require and has_permission take the schema's Permission; the literal compares ("exefs", "ipc", "content.add", ...) and ModManifest::lists/asks are on Permission; HOOK_TIERS/held_by are typed. Name strings stay only at the boundaries: profile.json/trust.json JSON, script calls by name, the Mods tab's edits, and modtool's output. Co-Authored-By: Claude Opus 5.5 <[email protected]>The reconciler's default props test compares arrays item by item and elements by type, key and props, a few levels down, with nothing allocated: a parent drawn again leaves a <Line style={[a, b]}>{text}</Line> child and its subtree alone. useHost's shareValue makes nothing while the parts are the same, and is exported as share(before, now) for values read on a timer. The menu: state and status read again only when changed fires (deps []), not after every render; each row's line reads its own row on its own event, the page laid out again only when what is shown changed (layoutOf). The mod inspector shares each read's snapshot and keeps its table's row render, so a read draws only the mods that changed. The cost tests' steady ceilings tightened (menu 2.5 -> 1 ms, inspector 8 -> 1 ms) and an idle menu frame checked under 0.1 ms. Co-Authored-By: Claude Opus 5.5 <[email protected]>08d92856fixed (#2434) e58e3ef788New build_driver::mods_watch: the channel's `mods_watch` op starts a thread that walks the profile's mods/ (depth 8, 20000 entries, dot names and node_modules not walked into) and profile.json every second and says what changed as {"event":"mods_changed","paths","list","overflow"}. The game's api::watch takes its notices from a Fed queue (api:⌚:FED, set by builder_link when the builder serves mods_watch; paths checked plain) instead of the system's when HOS_MODS_WATCH is the default; poll and 0 are as before. No C changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>- longshot-builder play.rs COMMANDS names sandbox-revoke (l68's command), so every_command_it_takes_is_one_play_leaves_alone holds. - build_core::session_bus asks org.freedesktop.portal.Inhibit (idle) when the builder runs in a Flatpak (/.flatpak-info) or a Snap ($SNAP); the wire format takes u and an empty a{sv}. Co-Authored-By: Claude Opus 5.5 <[email protected]>- host/hos_main.c: prepare_only only on Linux (its one reader is the Steam pipe arm); Windows set it and read nothing (-Wunused-but-set-variable). - {sizeof x} initialisers made designated ({.dwLength = sizeof m}, {.dwSize = sizeof te}) in host/hos_main.c, host/mkw_glue.c and host/profiling.c (-Wmissing-field-initializers). Co-Authored-By: Claude Opus 5.5 <[email protected]>c2c6bb8dand4370e51c(#2434) d71f422996A setting's "lockedBy" = { setting, why, value? }: while that setting (the mod's own, or another mod's as owner/name:id) is on, the Insert menu shows the row greyed out with why under its help and with value, and refuses the player's change; the kept value is left alone. Read and checked in api::manifest::setting (LockedBy), carried by SettingDecl, applied when the rows are published (Settings::declared_lock), in mod.toml's JSON Schema (and the website's copy) and the settings JSON. system/audio's mute_in_background (value on) and system/controls' controller_in_background (value off) use it with main's reasons; Pause in background's help is main's again. docs/modding/settings.md "Locked by another setting"; tests/test_pause_background.py checks the two rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>Possibly related, for context:
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.