WIP: feat(game)!: the game side and the whole mod API in Rust, with system mods and the sandbox on by default #2434
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2434
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/game-rs"
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
Stacked on #2411. Review from the first commit after
fefe58d7(#2411's head). This merges after #2411 and#2286.
What it does. The game side and the whole mod API are now Rust. The host's C is still there, and the renderer is
unchanged apart from the menu's link to the game side.
game/crates:guest,host-sys,oot,game-sites,api,content,script,schema,mod-formatandlongshot-game.longshot-rslinks them into the game as one static library.game/mods, one Rust crate each:title, sprint and walk, text, voice language, widescreen.
system_mods/by the build andtrusted only when their files hash to the build's table.
Mod), with typed settings and state,thiserrorerrors, and one undojournal. A mod's stop puts back whatever it changed.
the mods' network and IPC, crash reports, and the links and folders the game opens.
mod.jsonthat asks fornativeis refused with a messagesaying why. See
game/DESIGN.md, "What was removed".What players see change
of them, no longer a Gameplay tab row).
mods.json("cheats"), so switches saved by an older buildare not carried over. This needs a line in the release notes.
HOS_SKIP_OPENINGstill takesprecedence over it.
tests/test_menu_ini_keys.py's FROZEN list is kept, so aplayer's
longshot_options.inireads the same. The old option numbers are kept only so older input recordings stillreplay.
game/DESIGN.md, "Fixed on the way" (51 entries), with whatthe C did and why it was wrong. Otherwise, what players see is unchanged.
Read first
game/DESIGN.md: the design, the crates, threads, site chains, theModtrait, the undo journal, settings and thescript engine.
game/game.h: the line between the C host and the Rust game side.gpu/vk/vk_api.h:MKWVK_API_VERSION49 to 53 (the game's rows, the Mods tab, the broker, the mods' UI, a gamerow's default).
Testing
Tested: On Linux (CachyOS, Linux 7.3, RTX 3090, NVIDIA 620.70.06, Ryzen 9 7900X), three headless runs through the
job queue, each booting the repository save
kokiri-start.not installed". Fixed: the build installs them in
system_mods/, with a test.HOS_SAMPLE_ALL). gdb could not attach:Yama's ptrace scope is 1.
gmd::SaveDataMgr. It callednn::fs::Commitwithout end: each commit failedsyncing the user folder's parent folder, which the sandbox does not let the game open.
before it confines the game.
tests/test_fs_save_commit.pyhas a case that fails without the fix.client moves them, with tests in
tests/test_longshot_ctl.py.[error]lines.mod, so it correctly did not start.
fs: save: published 1 files), with no retries.HOS_DISCORD=0unless thecaller asks otherwise, with a test.
The checks
-D warningsclean for Linux and for Windows (x86_64-pc-windows-gnullvm).cargo test --workspace: 1616 passed, 0 failed, 1 ignored.tests/run_all.py): 659 passed, 17 failed, 99 skipped.fefe58d7, the base:test_amd_subgroup_profiles,test_flat_map,test_guest_holes,test_menu_save_atomic,test_menu_text_field,test_pipeline_share,test_prepare_cache_save,test_rdna2_mesh_only,test_readback_timeout_source,test_rumble_menu,test_shader_profile_caps,test_target_image_reuse,test_vibration_menu,test_vram_compact,test_wb_spans.test_mise_buildfails on the base too: this PC's mise lists atoolstask.test_lifterfailed on a formatting slip, since fixed; formatting is clean now.test_longshot_ctl,test_fs_save_commit,test_bug_report_defaults, thetest_menu_i18npair, thetest_sandbox_*checks,test_switch_table,test_menu_ini_keys,test_pipeline_tour,test_dev_abandtest_parity_gates.longshot.exe,longshot_vk.dll, the SDL DLLs andsystem_mods/.sandbox_windows.c(the AppContainer),broker_windows.c,broker_net.c,pad_mods.c,mod_watch.candhos_crash_dialog.c.Still to test:
(
scripts/parity_gates.py) and the feature checks. Expecting the same results as #2411's head, apart from theentries in "Fixed on the way". (@Beanstalk, or by hand)
with the broker running, saves committing, shots written, and mods' IPC working through the broker. (@Beanstalk)
mods' UI, run by hand with the example mods. Expecting every mod to start, stop and undo its changes as
game/DESIGN.mdsays. (by hand)kokiri-startwith the sandbox on. Expecting play, savescommitting, and no sandbox refusals in the log. (@Beanstalk)
Measurements
Not measured yet. This is a port: the renderer and the lifted game code are unchanged. But the per-frame hooks
(frame-time step, barriers, OCB hold, texture compaction) now run in Rust instead of C. An fps and frame-time A/B
against #2411 in Kokiri Forest, Hyrule Field and the Market, at 1080p, native and uncapped, is still to be done before
this leaves WIP.
Risks
area of the game. The parity gates and feature checks above are what catch that. The fallback is a revert of the
whole stack; there is no switch back to the C game side.
HOS_SANDBOX=0, set in the real environment, turns it off for debugging;longshot_env.txtcannot.longshot_options.ini, saves and caches read the same.MKWVK_API_VERSIONis 69: a renderer built for an older version refuses to load, as it should.To do
HOS_START_SLOT): a known gap, shipped without it. skip-title cannot see the save list open until thelist takes a button, so the title's repeated A can land on the newest save before the cursor moves. A fix needs a new
site for the list's open wait. skip-title's README lists it.
path).
Checklist
Ready for review
main; the title is a Conventional Commit. (Not onmain: stacked on #2411 and mergesafter it and #2286. The title is a Conventional Commit.)
only, and is in Still to test.)
mise run testpasses (any failure that also fails onmainis named). (The 15 failures, plustest_mise_build, also fail onfefe58d7, #2411's head; they are named in Testing.)main, or Measurements says why there is nothing to measure. (The A/B against #2411 is still tobe done.)
third_party/untouched; nothing GPL-incompatible.(The site tables hold masked signatures and addresses only.)
When it applies
mainand passes here. (Each fix made after a run has one; for the savecommit,
test_fs_save_commit's new case fails on the old source.)gpu/vk/switches.def.(The sandbox ships on by default for safety, not from measurements; its cost is not measured yet.)
tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged). (49 to 53.)mainand here, for a change that shows on screen. (Only this side's shot ofKokiri Forest so far; the #2411 side comes with the parity gates.)
game/DESIGN.md,docs/dev/reference/for the architecture, the control bridge and thesandbox, and the modding docs.)
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Op::Checked { fast, slow, helper, args }: the fast value unless slow holds, then a helper's. A Helper is a pure function a function carries (one block of pure ops over Op::Param, ending in a return), written once per module by its name: internal, noinline, cold, memory(none). The writer lowers the op as a branch weighted unlikely around the call and a phi. Op::IsSubnormal (llvm.is.fpclass), FBinOp::Maximum/Minimum (llvm.maximum/minimum) and Reduce::Or for the fast paths' checks. The verifier checks the new ops and every helper; sync.rs syncs nothing for one. words --count-checks counts the fast paths' runs and slow ones, for the semantics check. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8lift::Program takes the edits (edits::plan_edits) and writes them in as each function is built: before, after or in place of an instruction, at a conditional branch, at the entry in a block of its own; a wrapped function is lifted as its body f_1<entry> and its wrapper f_<entry> (lift::Lifted), both in its unit. lift::whole plans the edits from the placed sites, host/'s entry hooks (with their size gate) and the patches' Rust data, and keys each function by its edits' key (FunctionEdits::key); EDITS_SOURCES (the edits and sites crates) is in the whole lift's key, LIFTER_SOURCES holds only the edits' lowering, so one patch's or site's change lifts again only the units it lands in. The held mechanism is gone (held.txt, --allow-held, --patched, LiftOptions::patched, LiftOutcome::{held, complete}): an instruction the lifter does not cover stops the lift. gen/edits.txt lists each edited function, its key and what changes it; LiftOutcome::edited counts them. The plan's old records are no longer read, and --check-plan compares the discovery alone. On the supported image: 294518 functions in 495 units, 99 edited, none held; two lifts give the same bytes; one site's table entry changed rewrites one unit. Tests: each form on synthetic functions, verified, through the passes and compiled by clang; the forms run against a C harness of the host's side; the whole lift's cache over a site added and its form changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8- hos_romfs_head of a zstd-stored file decodes its frame's first blocks (hos_zs_frame_head), not the whole file. - A decoded zstd-stored file is kept after its last close, 256 MB of closed copies at most, the least recently used let go first; the most held at once is logged as it grows. - hos_romfs_case finds folders too (mods.c's mod-only listing listed a mod folder the game also has twice), and the very spelling first (of two names that differ in case only, the other could be found). - hos_romfs_ready says whether a RomFS is there: an index open, or a folder that exists (the beside path was set always). - The index is checked at open: every entry within the .nup, sizes sane, the names in strict order (lookups are binary searches); else romfs_index_bad. - Windows: the .nup's handle is overlapped, each read waiting on its thread's event (one synchronous handle served every thread's reads one at a time); a long path is made whole by GetFullPathNameW ("..", a relative path) and extended as \\?\ or \\?\UNC\; the index's path beside image.bin takes either separator and refuses one that does not fit. tests/romfs_test.c checks each (they fail on the code before), with two names that differ in case only and damaged indexes from the Rust side. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8The line between the generic host and renderer and the game, as two headers: - host/game_host.h: what the host gives the game. The host's own headers the game's C used (the paths, hos.h's guest memory and Ctx, game_call, the RomFS, the size tables, the settings file, env_on, the picture's size, the input recordings, the control bridge's watches), and the host's functions and values the game declared one by one where it used them. Every game/ file includes it in place of its host includes. - game/game.h: what the game gives the host and the renderer: game_init (the start's read of HOS_OOT_PROTECT_HEARTS, out of hos_main.c), the frame's and input's hooks, the control bridge's and the input recordings' game commands, the Mods and Cheats pages, the performance summary, the files mods replace, the Debug tab's inventory items. The host's files and vk_menu.cpp include it in place of the game's headers and their own prototypes. - game/options.h: the game's option ids (Field of view, Damage taken, the cheats, the HUD's layout...), out of gpu/vk/vk_api.h, which includes it; every value as it was (longshot_options.ini and the recordings hold them). The names the host used that were the game's become generic: hos_oot_{state,current_map,destination,teleport_*, age_ask,sample*,watch,poll,live_action,flight_shortcut_ready,autoload_input} are game_*, HosControlGame's oot_* fields game_*, HosControlOotWatch HosControlGameWatch. No behaviour changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>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_016o1k1PPtvLKUijhrMa4pueTested in game: CachyOS Linux 7.3, this PC (Ryzen 7900X, NVIDIA), headless: kokiri-start booted to play in Kokiri Forest (run 3, c52a3fa3's tree less the Discord test-run switch): all 14 native system mods and the Discord script mod started, sandbox confined, settings from the profile's options file, one save commit (66 ms, no retries), ~60 s in play with stick moves, clean quit, no errors. Runs 1-2 hung at the save load (the sandbox refused syncing the user folder's parent), fixed with a game-free test. Not yet: the comparison against #2411, Windows (cross-linked only), Phase 5 in game.
Possibly related, for context:
New head
57469dd5:HOS_START_SLOT=<n>starts a run on a chosen save slot through the Skip title mod (unset: as before; a missing or empty slot leaves the file list to the player, never a new game or another slot), andlongshot_version.txtgainsfeatures=start_slotso the launcher can tell which games take it. Game-free tests and clippy pass; the save list's order is not yet confirmed in the game.New head
8aa8522b:HOS_SAVE_DIR=<folder>keeps a run's saves (save/<uid>/,save-work/) in a launcher profile's folder; everything that finds saves follows it (nn_fs, the commit's syncs, the bridge's save root, Skip title's newest save andHOS_START_SLOT), the sandbox grants only that folder's save trees, and an unusable folder stops the start (exit 3,save_dir_unusable) rather than falling back to the shared saves. Advertised assave_dirinlongshot_version.txt'sfeatures=. Game-free tests pass (cargo 1627; the sandbox, fs and bridge checks); not yet run in the game.New head
56ace9f0: withHOS_SAVE_DIRset, mods' per-save data lives in<HOS_SAVE_DIR>/modstore/save/<uid>/slot_NN(two profiles never share it; granted by both sandboxes), and an unusable save folder is a plain refused start (exit 3,start refused: save_dir_unusable, a message box unless headless) with no crash record or crash window. cargo 1629 passed; the crash and sandbox checks pass; Windows cross-links.Two follow-ups to HOS_SAVE_DIR: - The mods' per-save data (modstore/save/<uid>/slot_NN) stayed in the user folder, so two profiles sharing it shared a mod's data for their slot 0. With HOS_SAVE_DIR it goes to <HOS_SAVE_DIR>/modstore/save/<uid>/slot_NN (api's storage save_root, longshot-game's runtime save_storage_root); the global and profile stores stay in the user folder. The folder's modstore/ is made with save/ and save-work/, and both sandboxes grant it as they do those. Unset, as before. - An unusable HOS_SAVE_DIR went through hos_fatal, whose crash record made the crash window say "Longshot closed unexpectedly" and offer a crash report. It is now refused as a start set up wrong (hos_main.c refuse_start): a log line ("start refused: save_dir_unusable: ..."), the reason on stderr, a plain message unless headless, then the clean end and exit code 3, with no crash record; the window says nothing. Tests: api's storage (the per-save stores under the profile's folder, never shared, unset as before), longshot-game's runtime, test_sandbox_linux, test_sandbox_windows and test_sandbox_save_folders (modstore/ granted), test_fs_save_commit (made), test_crash_dialog (a refused start is no crash; refuse_start writes no record and ends clean), test_crash_record's exit inventory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue56ace9f092231d650dedNew head
231d650d, rebased onto #2411's59a7b1f8(on #2286's02386f32). It takes in the full self-review of the earlier head (11 blocking, 25 should-fix, 43 nits), each blocking fix with a game-free test shown failing first, plus an overflow sweep of every parser of mod input. Spec gaps closed since: has() honest; the 27 unplaced mod-API sites placed (19 rule sites through new lift rules in builder/crates/edits); the content stage and typed patches run in the game (romfs_merge port, plan cache, content.sound via BWAV); texture packs and render-target recipes; save profiles, pad gyro and device kind, camera rigs; mods_api= in longshot_version.txt; the sandbox closes the session bus on kernels below Landlock ABI 9 with a private mount namespace (player scripts held only where user namespaces are blocked). Checks: fmt clean; clippy -D warnings clean on Linux and Windows; cargo test passes; Python 665 passed, 14 failed (13 fail identically on59a7b1f8, the 14th fixed since); the Linux game build and the Windows cross-build (longshot.exe, longshot_vk.dll) link. Not yet run in the game; the Mods tab's per-mod page and the unsafe tier's code modules land next.New head
54e28eb5(541 commits on #2411's59a7b1f8): the Mods tab's per-mod page (the permission prompt, settings, permissions, the debug page and frame times, , and a click on a mod window no longer reaches the game); the content stage's follow-up (archives of several mods made one, skins and model checks, the AINB schema, the modcache sweep, hot reload rebuilding the layers); and the unsafe tier's build side (mods' own sites, a manifest's exefs/, data switches without a build, vslot thunks, code modules built in). Checks: fmt clean; clippy -D warnings clean on Linux and Windows; cargo test passes; schema outputs current; Python 666 passed, 13 failed exactly as on59a7b1f8; Linux and Windows builds link. Still not run in the game. Next: the mods' world layer and shader effects, the registries' engine side, and longshot/capture.231d650ded54e28eb5aelongshotCheckout 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_016o1k1PPtvLKUijhrMa4pueNew head
f2c624a2(559 commits on #2411's59a7b1f8). Added: the mods' screen effects and world layer drawn by the renderer (MKWVK_API_VERSION 55; has() says yes to gfx.effect and gfx.world); the engine side of the registries with the Mods tab's Keybinds, Commands and HUD layout pages; ; longshot/capture; the mod-tools node tests fixed and run by tests/, and dev.py game-tests ported (game runs through the queue); the mods stamp (game/crates/mods-stamp, the build record's "mods" key, the game's stamp equal to the builder's) and Restart to apply (exit 122 when LONGSHOT_STARTED_BY=builder). Checks: fmt; clippy -D warnings on Linux and Windows; schema-gen --check; cargo test; Python 672 passed, 13 failed exactly as on59a7b1f8; the Linux build (renderer linked) and the Windows cross-build link. Still not run in the game.f2c624a216563ca4e55bMoved onto #2411's new head
a8e25cdbon #2286 konvtvqs: new head563ca4e5. Sincef2c624a2: the leftovers (Mods tab, code-mod switching with only a restart, camera extras, glTF, automatic undo), settings stage 1, and the adaptation to #2286: profile-only start, one mod format (the builder reads the profile's manifest mods throughread::manifest_mods), Restart to apply over the builder channel (no exit 122), no launcher identity, the broker's dead crash code removed. Checks: fmt; clippy -D warnings Linux and Windows; schema --check; cargo test; Python fails only test_display_startup_failure, as on the base; the Linux and Windows game builds link.f2c624a2was smoke-tested in the game on Linux (boots in three places with the sandbox, menus, an example script mod, save and reload; fps 133.0 vs 133.3 on the base).@HumanBean, about the name list
game.flagsrelies on: its schema says Longshot ships a list of the game's flag names that the community extends (spec 9.2), and I could not find the list itself in this PR (oot::flagshashes the name, so the API is ready for any list).I have one ready, if it helps: 9,623 of the 11,926 fields of
progress.savnamed, each one checked by hashing it back to its field in the game's GameDataList (MurmurHash3, seed 0; struct members checked twice, asParent.Memberand on their own, which is how collisions get caught). It is names only, strings: no addresses, no values, nothing from the game's files, which fits the schema's note. It coversPlayerStatus.*,PouchData.*,HavePlayedEvent.*,IsTreasureBoxOpen.<actor>,IsGoldSkullDead.*,DungeonRoomStep.<dungeon>.DungeonRoom<NNN>.*and so on. It is the same list I offered @mooki for the save editor in #1401, so one file could serve both.If you want it, tell me the shape and the place (one name per line, a TOML table, with or without the kind of each flag) and I'll open a PR against this branch or
main, whichever suits you. Nothing is started.Posted by an AI agent (Claude Code) for neotoxic.
The 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_016o1k1PPtvLKUijhrMa4pue7bb1387a7a1092fc1b57Rebased onto main (with #2286 and #2411 merged) and the mod tooling folded in, so this is now the one PR for all the mod API work: new head
1092fc1b, 660 commits on main. Added since563ca4e5: the dispose fix; headless Restart now/Quit; safe start from the builder (LONGSHOT_SAFE_START); the game's mods only from its profile; one per-slot store for mods' data; the docs pass (camera, world and nine reference pages); settings stage 2 so far (BINDING with Swap/Cancel, rows declaring their places, the Mods tab on mod UI, the menu hosted behind a Debug row); main's #2452 heap fix and #1841 title-card frame ported to Rust; and the mod tooling:Longshot.exe mod(init, types, check, pack, vendor, sources and repos, install/update/remove into a content-addressed store, test on the real script engine, run, data, publish), the game side over the builder channel, request_trust with permissions, LONGSHOT_MOD_STORE and LONGSHOT_DEV_MODS. Checks: fmt; schema --check; clippy -D warnings on Linux and Windows (workspace, and modtool on its own); cargo test; Python fails only test_display_startup_failure, as on main; the Linux and Windows game builds. Still to come: removing the old JS mod-tools and its docs pass, the remaining modtool commands, the TS Settings UI and Mods tab, self-contained system-mod folders, game runs, a cold review.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_017vw8dyKi9X9AgqbaPS28uY92d6d059dd3509a8a9b6request_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_017vw8dyKi9X9AgqbaPS28uYSqueezyLemonade referenced this pull request2026-11-26 04:20:30 +00:00
l4u2-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_017vw8dyKi9X9AgqbaPS28uYView 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.