From 2969a41bf5a6145922c165550eb684c5c5784090 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 18 Jul 2026 11:02:46 +0400 Subject: [PATCH] feat(runtime): split visual graph load phase --- crates/fparkan-runtime/src/lib.rs | 7 +++++-- docs/tomes/05-render.md | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index 79a81c7..76c681e 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -116,6 +116,8 @@ pub enum MissionLoadPhase { Map, /// Expand object roots into a prototype graph. Graph, + /// Expand model-backed visual dependencies of the prototype graph. + GraphVisuals, /// Prepare all reachable visual/resource dependencies. Assets, /// Construct all object drafts before registration. @@ -682,6 +684,7 @@ fn load_mission_with_options_and_progress( }; let (mut prototype_graph, resolved_prototypes, mut prototype_report) = build_prototype_graph_report(&repository, vfs.as_ref(), scoped_graph_roots); + record_load_phase(&mut trace, &mut on_phase, MissionLoadPhase::GraphVisuals); extend_graph_report_with_visual_dependencies( &repository, &mut prototype_report, @@ -693,6 +696,7 @@ fn load_mission_with_options_and_progress( failures: prototype_report.failures.clone(), }); } + record_load_phase(&mut trace, &mut on_phase, MissionLoadPhase::Assets); let asset_manager = AssetManager::new(repository); let mission_assets = match options.asset_scope { MissionAssetScope::Full => asset_manager.prepare_mission_assets( @@ -738,8 +742,6 @@ fn load_mission_with_options_and_progress( .collect(), }) .collect(); - record_load_phase(&mut trace, &mut on_phase, MissionLoadPhase::Assets); - let mut new_runtime_world = new_world(WorldConfig); let mut handles = Vec::with_capacity(mission.objects.len()); record_load_phase(&mut trace, &mut on_phase, MissionLoadPhase::Construct); @@ -1176,6 +1178,7 @@ mod tests { MissionLoadPhase::Map, MissionLoadPhase::Tma, MissionLoadPhase::Graph, + MissionLoadPhase::GraphVisuals, MissionLoadPhase::Assets, MissionLoadPhase::Construct, MissionLoadPhase::Register, diff --git a/docs/tomes/05-render.md b/docs/tomes/05-render.md index 1c8c4ec..98b1965 100644 --- a/docs/tomes/05-render.md +++ b/docs/tomes/05-render.md @@ -1038,6 +1038,15 @@ to 120 seconds but remained at the existing `Graph` loading checkpoint and were terminated without a native frame/report; therefore no new readback hash or GPU acceptance result is claimed for the corrected projection yet. +The load trace now splits base root expansion (`Graph`) from MSH/WEAR/MAT0/TEXM +visual-dependency expansion (`GraphVisuals`) and enters `Assets` immediately +before actual asset preparation. A controlled 60-second GOG first-root run of +the XY build stopped at `GraphVisuals`; the process was terminated by the probe +and produced no frame. The startup bottleneck is therefore narrowed to visual +graph expansion, rather than the base prototype graph, asset decoding, window +creation or Vulkan submission. This is a diagnostic boundary, not a claim that +the visual expansion is semantically optional or may be skipped. + The same source-axis proof now applies to `TerrainWorld`: its `Land.msh` surface height query and `Land.map` areal/grid lookup use XY ground coordinates, return source Z height, and leave raycasts as full 3D intersections. The Part 1 and