Refactoring: units in progress #61
Copy link
Copy link
Open
Labels
refactorStructural change without behavior changeStructural change without behavior changetrackingParent or tracking issueParent or tracking issue
Description
This issue tracks which parts of the code are being refactored right now, so refactoring can run alongside the parity and triage work without blocking anyone. The plan is in docs/MACRO_REFACTOR_DRAFT.md.
Rules
- Refactoring gives way. If a bug-fix PR is open on a file, the refactoring unit that contains it waits or leaves that file out. A fix never waits for a refactor.
- Short, move-only PRs. A refactoring PR moves or renames code without changing behaviour, touches one unit, and stays open for at most one working day.
- Reserve before you start. Add the unit, its files and the PR to the table below before opening the branch, and remove the row when the PR is merged. Before editing a file listed here, check the row and talk to whoever reserved it.
- Whoever moves code ports open branches. After a move PR is merged, its author merges
maininto the open branches that touched the moved files and resolves the conflicts. - Branches use
feat/<name>, as in CONTRIBUTING.
A unit is a whole crate for the rarely changed crates, and a group of modules inside omsi-app (frame loop, gameplay, launcher, world, input, settings, LAN, HUD and menus).
Reserved now
| Unit | Files | Branch | PR |
|---|---|---|---|
AP6 step b2, the bus preview (the showroom, its helper process and its kept pictures) out of launcher/ into the game's showroom/, so the "Add vehicle" window no longer imports the launcher |
omsi-app/src/showroom/, omsi-app/src/launcher/{preview,showroom,prerender,mod,ai_traffic,diagnostics}.rs, ui/implementation/add.rs, lib.rs, testing.rs, their tests |
feat/app-launcher-preview |
#597 |
Tracks 0 and 1
- T0.1 Software graphics adapter (lavapipe) in CI; golden test runs on every PR
- T0.2 Offscreen state trace (B0) and its CI job
- T0.3
settings.cfground trip between game and launcher - T1.1 rustfmt, per crate: format crates
- T1.2 rustfmt, per crate:
omsi-audio,omsi-ui,omsi-geometry,omsi-check - T1.3 Clippy cleanup in the format crates (CI stays informational)
- T1.4
omsi-render/src/lib.rssplit into modules (several PRs) - T1.5
omsi-htmlextracted fromomsi-sim/src/htmlengine(several PRs) - T1.6
omsi-renderorganised into domains and layers, as incrates/omsi-render/ARCHITECTURE.md(step 1, the facade and the architecture document, merged in refactor(render): name the public API in lib.rs and document the crate's domains (R1) #79; step 2, shaders, merged in refactor(render): move the WGSL sources into shaders/, one folder per domain (R2) #81; step 3,gpu/, merged in refactor(render): gather the device code in gpu/ (R3) #83; step 4,assets/, merged in refactor(render): gather meshes, textures and materials in assets/ (R4) #85; step 5,lighting/andsky/, merged in refactor(render): gather light and sky in lighting/ and sky/ (R5) #86; step 6,scene/, merged in refactor(render): gather the scene in scene/ (R6) #89; steps 7 to 9,passes/,targets/,effects/,output/andrenderer/, merged in refactor(render): passes, targets, effects, outputs and renderer folders (R7-R9) #90; step 10,api/, merged in omsi-render: entry package api/ (R10) #98; steps 11 to 13, sub-structs, build steps andFrameContext, merged in refactor(render): Renderer in sub-structs, build by constructors, the frame in stages (T1.6, R11–R13) #100; step 14, the imports out of layer cleared in refactor(render): the imports below Renderer point down (T1.6, R14 step 1) #106, refactor(render): no impl Renderer in assets, lighting, sky or scene (T1.6, R14 step 2) #109 and refactor(render): no impl Renderer below renderer; the layers hold (T1.6, R14 step 3) #111, and the layer check blocking in CI, merged in ci(render): the layer check blocks (T1.6, R14) #103)
Track 2 (warm omsi-app groups)
- A1 Multiplayer, server and plugins out of the game build (step 1, live helpers out of
omsi-net, merged in refactor(content): move the remote content path checks out of omsi-net (T2, A1 step 1) #82; step 2, thepluginsfeature, merged in refactor(app): plugins behind an off-by-defaultpluginsfeature (T2, A1 step 2) #87; step 3a,is_lan_client/is_lan_host, merged in refactor(app): is_lan_client/is_lan_host instead of Role comparisons (T2, A1 step 3a) #88; step 3b, theOnlinesub-struct, merged in refactor(app): LAN fields of App into an Online sub-struct (T2, A1 step 3b) #97; step 3c-1, live helpers out oflan.rs/admin.rs, merged in refactor(app): live helpers out of the LAN modules (T2, A1 step 3c-1) #99; step 3c-2, thelanfeature ofomsi-launcher-core, merged in refactor(launcher-core): omsi-net behind alanfeature (T2, A1 step 3c-2) #101; step 3c-3a, thelan/serverfeatures and the launcher's server browser, merged in refactor(app): lan/server features; launcher's server browser behind lan (T2, A1 step 3c-3a) #102; step 3c-3b, the game's frame and menus, merged in refactor(app): game frame and menus behind lan (T2, A1 step 3c-3b) #104; step 3c-3c, the offscreen run and start-up behindlanand the server code behindserver, merged in refactor(app): offscreen loop and start-up behind lan, server code behind server (T2, A1 step 3c-3c) #107; steps 3c-3d and 4,lanoff by default and the CI tests with every feature, merged in refactor(app): lan off by default; CI tests every feature (T2, A1 steps 3c-3d and 4) #110) - C3
input_script.rssplit by subject (merged in refactor(app): split input_script.rs by subject (T2, C3) #84) - D2 Registry of
OMSI_*variables (step 1, the register inomsi_cfg::flagsand the crates outsideomsi-appandomsi-render, merged in refactor(cfg): register of OMSI_* variables, small crates read through it (T2, D2 step 1) #112; step 2a, the world modules ofomsi-app, merged in refactor(app): world modules read OMSI_* through the register (T2, D2 step 2a) #113; step 2b, traffic and people, merged in refactor(app): traffic, people and driver modules read OMSI_* through the register (T2, D2 step 2b) #115; step 2c, offscreen, events and settings, merged in refactor(app): offscreen, window, start-up and settings read OMSI_* through the register (T2, D2 step 2c) #117; step 2d, LAN and launcher, withenv.txtanddocs/ENVIRONMENT.mdfrom the register, merged in refactor(app): LAN and launcher read OMSI_* through the register; env.txt and ENVIRONMENT.md from it (T2, D2 step 2d) #118; step 3,omsi-render, merged in refactor(render): omsi-render reads OMSI_* through the register (T2, D2 step 3) #119) - Explicit imports instead of globs (step 1, ten modules of
omsi-app, merged in refactor(app): explicit imports in ten modules instead of use super::* (T2, explicit imports step 1) #122; step 2, nine more, merged in refactor(app): explicit imports in nine more modules instead of use super::* (T2, explicit imports step 2) #124; step 3, the large modules, merged in refactor(app): explicit imports in actions, app, player and humans_pax (T2, explicit imports step 3) #125; step 4,app_events,offscreen,startup,androidandinput/, merged in refactor(app): explicit imports in app_events, offscreen, startup, android and input (T2, explicit imports step 4) #126; step 5, the crate root's remaining globs, merged in refactor(app): the crate root without globs (T2, explicit imports step 5) #127.omsi-apphas nouse super::*outside tests;humans'use pax::*,launcher/mod.rs'use theme::*andinput/mod.rs' re-exports stay on purpose) - The rest of
omsi-sim/src/vehicle.rssplit (merged in refactor(sim): split vehicle.rs by subject into vehicle/ submodules (T2) #128: 13 new submodules plusvehicle/tests.rs,vehicle.rsdown to 581 lines,articulationandphysics_bridgewithoutuse super::*)
Track F (vehicle physics, second round, AI included)
- F0 AI characterization traces (
ai_traces.rs) andoffscreen-tracesblocking (merged in F0: AI traffic traces and offscreen-traces blocking #144) - F1 Structural:
PhysicsSpec, named constants, solver scratch buffers,teleport, AI modules,ground_queryout ofscene.rs(merged in F1: vehicle physics structure (spec.rs, named constants, SolverScratch, accessors, ai/, ground_query) #146) - F1 follow-up:
RigidBody/RigidWheelfields closed and theai_motionalias dropped (step 1, accessors and test setters, merged in F1 follow-up, step 1: the rest of the rigid body's accessors, and setters for the tests #148; step 2, the harnesses moved over and the fields closed, merged in F1 follow-up, step 2: rigid body fields closed, ai_motion alias removed #150) - F2 Player model compensations and invented defaults removed,
[momentofintertia]in the SDK's order (merged in F2: the player's vehicle reads its .bus as OMSI does, no invented values #168; the unused defaults behindmodel-fallbacksgo once the physics is validated in game) - F2.5 Structural:
rigid/andphysics.rsas one packagephysics/withdomain/,interface.rsandimplementation/(merged in Physics package in domain, interface and implementation #177) - F3 Fixed 1/240 s substep with an accumulator, collision inside each 0.05 s slice, shown pose interpolated between substeps (
physics-delta,offscreen-delta); the trace harnesses moved tophysics::and therigidalias went (merged in F3: fixed 1/240 s substeps, collision inside the step, shown pose interpolated #178)
Track 3 (cold and warm items from the audit)
- C6 step 1: one widget kit in
omsi-ui, used by the game's menu too (step 1a, the launcher's kit moved toomsi-ui, merged in omsi-ui: the launcher's widget kit moved in as widgets.rs (C6 step 1a) #181; step 1b onwards waits for keyboard focus in the kit, with the new UI foundations of Docs: design draft for the new UI foundations #167) - C6 step 3:
navigator.rssplit intonav/, its shortest path inomsi-sim(step 3a, the split, merged in nav: navigator.rs split by subject into nav/ (C6 step 3a) #182; step 3b,Network::lanes_nearandNetwork::shortest_path_to_any, merged in omsi-sim: the navigator's path search as Network::shortest_path_to_any (C6 step 3b) #183) - D5
omsi-cfgutilities, one PR each (step 1, the crate organised into domains and subdomains, merged in refactor(omsi-cfg): organise the crate into domains and subdomains (D5 step 1) #184; step 2,omsi_cfg::paths, merged in feat(omsi-cfg): omsi_cfg::paths for the user's data folder (D5 step 2) #185, with theomsi-checkfix in fix(omsi-check): read the remembered OMSI 2 folder from ~/.depot-root #186; step 3,omsi_cfg::write_atomic, merged in feat(omsi-cfg): write_atomic for files written through a temporary (D5 step 3) #193; step 4,omsi_cfg::encode_utf16_bomanddecode_textfor every reader, merged in omsi-cfg: encode_utf16_bom and decode_text for every text file (D5 step 4) #201; step 5,omsi_cfg::bytes, merged in omsi-cfg: bytes::{le16, le32, le64} for the binary readers (D5 step 5) #202; step 6a,omsi_geometry::utilwithsmoothstepand xorshift, merged in omsi-geometry: util with smoothstep and the xorshift64 sequence (D5 step 6a) #203; step 6b,omsi_texture::srgb, merged in omsi-texture: srgb::{to_linear, from_linear} for the CPU copies of the curve (D5 step 6b) #204; step 6c,omsi_content::weather::psychro, merged in omsi-content: weather::psychro for the humidity formulas (D5 step 6c) #205, with the fix to OMSI 2's Magnus constants merged in fix: one Magnus curve for the humidity, OMSI 2's own #206; step 6d,omsi_geometry::util::wrap_deg, merged in omsi-geometry: util::angle::wrap_deg for the heading differences (D5 step 6d) #207) - D6 format reading only in the format crates (step 1, tests for the
.o3dreader, merged in omsi-o3d: characterization tests for the .o3d reader (D6 step 1) #208; step 2,.o3dnames by code page, merged in omsi-o3d: read texture and bone names in their code page (D6 step 2) #251; step 3,gamectrler.cfgonly inomsi-content, merged in omsi-content: gamectrler.cfg read and written only in input::gamectrler (D6 step 3) #287; step 4,clouds.cfgthroughEnvir, merged in omsi-content: clouds.cfg read through Envir (D6 step 4) #296; step 5,.oftfonts in the LAN mod package throughFont::load_all, merged in omsi-app: LAN mod package reads .oft fonts with Font::load_all (D6 step 5) #299; step 6, the launcher's.dscand situation names inomsi-contentwithdecode_text, merged in omsi-content: the launcher's .dsc and situation names decoded by code page (D6 step 6) #300; step 7, the object editor's tile codec inomsi_cfg::text, merged in omsi-cfg: the object editor's tiles read and written in their code page (D6 step 7) #301; step 8,Model::handle_keywordsplit by family, merged in omsi-model: Model::handle_keyword split by family (D6 step 8) #302; step 9,DdsHeader, image extensions andCP437_HIGH, merged in omsi-texture: one DdsHeader::parse, image extensions as constants (D6 step 9) #303) - C5 renderer and shader leftovers (the MSAA and ray tracing fallback, B1, was fixed beforehand; step 1, grouped imports in the layer check, merged in scripts: the omsi-render layer check also reads grouped imports (C5 step 1) #304; step 2a,
prepareintorenderer/upload.rs, merged in omsi-render: prepare's body out of api/ into renderer/upload.rs (C5 step 2a) #306; step 2b, the triple screen intooutput/triple.rsandrenderer/output.rs, merged in omsi-render: the triple screen out of api/ (C5 step 2b) #309; step 2c, the headset menu intooutput/xr.rs, merged in omsi-render: the headset menu out of api/ into output/xr.rs (C5 step 2c) #310; step 2d, opening the renderer intorenderer/open.rs, merged in omsi-render: opening the renderer out of api/ into renderer/open.rs (C5 step 2d) #312; step 2e,drop_top_levelsandupload_speed_mb_sintoassets/texture.rs, merged in Move drop_top_levels and upload_speed_mb_s out of api/ into assets/texture.rs (C5 step 2e) #313; step 3a,gpu/util.rswithtarget_2dandmip_levels, merged in Add gpu/util.rs with target_2d and mip_levels (C5 step 3a) #315; step 3b,fullscreen_pipeline, merged in Add fullscreen_pipeline to gpu/util.rs (C5 step 3b) #316; step 3c, bind group layout entry helpers, merged in Add bind group layout entry helpers to gpu/util.rs (C5 step 3c) #317; step 3d,Vertex::LAYOUT, merged in render: share the scene vertex layout as Vertex::LAYOUT (C5 step 3d) #319; step 3e, thePostPassbuilder, merged in render: turn post_pass into the PostPass builder (C5 step 3e) #381; step 4a,shaders/common/camera.wgsl, merged in render: share the Camera WGSL in shaders/common/camera.wgsl (C5 step 4a) #383; step 4b,shaders/common/fullscreen.wgsl, merged in render: share the full-screen triangle in shaders/common/fullscreen.wgsl (C5 step 4b) #385; step 4c,shaders/common/math.wgsland the post shader's sRGB, merged in render: shared shader maths in shaders/common/math.wgsl (C5 step 4c) #387; frame step 1,FrameFeatures, merged in render: FrameFeatures groups what a picture draws (C5 frame step 1) #388; frame step 2,draw_listssplit, merged in render: draw_lists split into shadow, main and prepass parts (C5 frame step 2) #389; frame step 3,begin_frametest hooks into helpers, merged in refactor(render): begin_frame test hooks into helpers #390; frame step 4,FrameScratchfor the draw list, merged in refactor(render): reuse the draw list buffer across frames #392; frame step 5, the draw item buffers inFrameScratch, merged in refactor(render): reuse the draw item buffers across frames #393; step 6,MaterialDescand the shared named constants (cloud tile, shadow pipeline indices), merged in refactor(render): MaterialDesc and shared named constants #395) - fix-25
SAFETYcomments,bytemuckand tests (omsi-rendercomments merged in Add SAFETY comments to the unsafe blocks in omsi-render #398;omsi-plugincomments merged in Add SAFETY comments to the unsafe blocks in omsi-plugin #426;omsi-appLinux-buildable files (export.rs,evdev_ff.rs,lan_mods.rs) merged in Add SAFETY comments to the unsafe blocks in omsi-app's Linux files #427;omsi-apphead tracking merged in Add SAFETY comments to the unsafe blocks in headtrack.rs #433;omsi-launcher-core(whole crate, comments only) merged in Add SAFETY comments to the unsafe blocks in omsi-launcher-core #434;omsi-render-d3d9checked with no change needed, its unsafe blocks already carry SAFETY comments and its threeunsafe fns carry# Safetydocs; the rest ofomsi-app(its remaining sites need a per-site review, the first pass is noisy),bytemuckand the.o3dtests still open)
Track S (omsi-sim by domain, docs/OMSI_SIM_REFACTOR.md, in parallel with Track 3)
- S1 rustfmt, the four unused functions removed, shared
angle_diff/xorshift/smoothstep (merged in omsi-sim: rustfmt, unused functions removed, shared helpers (Trilha S, S1) #311) - S2 every test out of
src/intotests/,omsi_sim::testingbehindtest-support, traffic and people traces (merged in omsi-sim: every test out of src/, test-support, traffic and people traces (Trilha S, S2) #314) - S3
traffic/by domain (lane, geometry, lights,network/,driver/) andAiState::drivein steps (merged in omsi-sim: traffic.rs split into traffic/ by domain, AiState::drive in steps (Trilha S, S3) #318) - S4
people/by domain (rig, pose, skin, OMSI animation, crowd),Pose::advanceandPose::bonesin steps (merged in omsi-sim: S4, people/ by domain and Pose::advance/bones in steps #382) - S5
host/,automation/,collision/,textures/,vehicle/coupled/, with the long functions in steps andARCHITECTURE.md(merged in omsi-sim: S5, separação por domínio (host, automação, colisão, texturas, veículo) #386;people/omsi_anim.rs::advance, 206 lines, is left over from S4 and not in this unit)
Track App (omsi-app by domain, docs/OMSI_APP_REFACTOR.md, plan in #401)
Phase 1; phase 2 is Track 4. Every domain folder is a package with domain/, interface/ (input and output) and implementation/, and tests live in tests/.
- AP1 rustfmt of
omsi-appblocking, withscripts/fmt-merge.shand.git-blame-ignore-revs;omsi-render-d3d9,omsi-launcher-coreandomsi-launcher-uiblocking too (merged in rustfmt: omsi-app and the new crates block (Trilha App AP1) #403;settings/round_trip.rsrows that came in with Launcher: read render_scale as the game does #275 and Launcher: keep the fraction of vr_head_smoothing_ms #277 formatted in rustfmt: settings/round_trip.rs (main vermelho no fmt) #406; the twelve openfix/launcher-*branches ported withscripts/fmt-merge.sh) - AP2 tests out of
src/intotests/,omsi_app::testingbehindtest-support(step 1, the gameplay modules, withopenomsi_game::testingandtests/app, merged in omsi-app: gameplay tests out of src/ (Track App, AP2 step 1) #506; step 2, world and scene, merged in omsi-app: world and scene tests out of src/ (Track App, AP2 step 2) #507; step 3, the new UI, HUD, lists, nav and menus, with the menu pages' drawing test split per page, merged in omsi-app: UI, HUD and menu tests out of src/ (Track App, AP2 step 3) #509; step 4, input, network, weather, cameras and VR, plugins and the rest, merged in omsi-app: input, network and remaining tests out of src/ (Track App, AP2 step 4) #521; step 5,settings,app,app_events,api_limitsand the crate root, merged in omsi-app: settings, app and crate root tests out of src/ (Track App, AP2 step 5) #524; step 6, the launcher, merged in omsi-app: the launcher's tests out of src/ (Track App, AP2 step 6) #527, with the crate root's tests renamed totests/app/crate_root.rs; no test is left insrc/) - AP3 the new interface in
ui/(folder name changed frominterface/in docs: nova UI do omsi-app em ui/ #405), the HUD's data and hit rectangles inhud/frame.rs(step 1, thehud/package with the frame types inhud/domain/and the old drawing inhud/implementation/legacy/, merged in refactor(omsi-app): AP3 step 1, the hud/ package (frame types in domain, old drawing in legacy) #547; step 2, the hit rectangles out ofUiintohud::Hitsinhud/domain/hits.rs, merged in refactor(omsi-app): AP3 step 2, the hit rectangles out of Ui into hud::Hits #551; step 3a, theui/package with the loading screen and the end-of-trip report, merged in refactor(omsi-app): AP3 step 3a, the ui/ package with the loading screen and the trip report #552; step 3b, the Alt bar and its windows, merged in refactor(omsi-app): AP3 step 3b, the Alt bar and its windows into ui/ #559; step 3c, the "Add vehicle" window, merged in refactor(omsi-app): AP3 step 3c, the "Add vehicle" window into ui/ #560; step 3d, the Esc menu's pages, merged in refactor(omsi-app): AP3 step 3d, the menu pages into ui/ #565; step 3e, the Esc menu and the overlay, merged in refactor(omsi-app): AP3 step 3e, the Esc menu and the overlay into ui/ #569; nonew_ui*.rsis left at the root andui/does not importhud::legacy) - A5 the multiplayer, the dedicated server and the plugins removed from the repository (decided 2026-10-29, planned in docs: plan the removal of the disabled crates (A5) #567, done in one PR at the maintainer's request, merged in refactor: A5, remove the multiplayer, the dedicated server and the plugins #571; the leftovers that change behaviour or the interface are listed in
docs/removed/MULTIPLAYER_REMOVED.md) - AP4 the graphics output in
output/, the backend chosen in one place (step 1, theoutput/package with the Direct3D 9Ex output, the VR session and navigator, the mirror panels and the cameras, merged in refactor: AP4 step 1, the graphics output as the output/ package #572; step 2,Backend { Wgpu, D3d9 }chosen only byBackend::ofand the window'sOutputin place of the scattered#[cfg(windows)]checks, merged in refactor: AP4 step 2, the graphics backend chosen in one place #573) - AP5 the HUD and the menu lists by subject in
hud/(step 1,game_lists.rssplit by subject intohud/domain/lists.rsandhud/implementation/lists/, merged in refactor: AP5 step 1, the menu's lists by subject in hud/lists/ #590; step 2, the old HUD drawing split by part inhud/implementation/legacy/(text, paint, notices, info, style, menu, settings), merged in refactor: AP5 step 2, the old HUD drawing by part in hud/legacy/ #591; step 3,nav/insidehud/withcity.rsandminimap.rssplit, merged in refactor: AP5 step 3, the navigator inside hud/ #592) - AP6 the launcher to
omsi-launcher-uiandomsi-launcher-core(step a1, the next start's choices inomsi-launcher-corestart/, merged in refactor: AP6 step a1, the next start's choices in omsi-launcher-core #593; step a2, the timetable editor's saving, reset, times and tour numbers inomsi-launcher-coretimetable/, merged in refactor: AP6 step a2, the timetable editor's saving in omsi-launcher-core #595; step b1, the window sizes and the DirectX9 check inomsi-launcher-coresettings/, the map picture inomsi-launcher-uipicture, merged in refactor: AP6 step b1, the game stops reading the launcher's pages #596) - AP7 the other domain folders (
core/,input/,world/,weather/,gameplay/) (core/with App, the command line, the start-up,make_app, the threads, the log, the memory budget, the platform and Android, merged in refactor: AP7, the game's core as the core/ package #581)
Generated by Claude Code
Metadata
Metadata
Assignees
Labels
refactorStructural change without behavior changeStructural change without behavior changetrackingParent or tracking issueParent or tracking issue
Activity
docs: fecha o plano das trilhas 0 e 1
lmonteirotech commentedon Oct 19, 2026
FYI for the C5 step 3e work: draft PR #322 adds an overlay hook to
omsi-render(Renderer::set_overlay_hook). It touches onlyrenderer/encode.rs,frame.rs,state.rs,build.rsandapi/renderer.rs, none of the files reserved for C5 3e. When it merges, please rebase on it. Leo approved doing it in the renderer ("Zane adjusts it afterwards on top of ours").Generated by Claude Code