diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 86891d7..cd27cda 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -473,7 +473,13 @@ fn prepare_load_progress_path(path: &std::path::Path) -> Result<(), String> { } fn write_load_progress(path: &std::path::Path, phase: MissionLoadPhase) -> Result<(), String> { - std::fs::write(path, format!("{phase:?}\n")).map_err(|err| format!("{}: {err}", path.display())) + use std::io::Write; + + let mut file = std::fs::OpenOptions::new() + .append(true) + .open(path) + .map_err(|err| format!("{}: {err}", path.display()))?; + writeln!(file, "{phase:?}").map_err(|err| format!("{}: {err}", path.display())) } fn run_static_vulkan_mode( @@ -1049,6 +1055,23 @@ mod tests { ); } + #[test] + fn load_progress_retains_prior_milestones() -> Result<(), String> { + let path = + std::env::temp_dir().join(format!("fparkan-game-progress-{}.txt", std::process::id())); + prepare_load_progress_path(&path)?; + write_load_progress(&path, MissionLoadPhase::GraphVisualMaterials)?; + write_load_progress(&path, MissionLoadPhase::GraphVisualMaterialRequests(64))?; + let progress = std::fs::read_to_string(&path).map_err(|err| err.to_string())?; + std::fs::remove_file(&path).map_err(|err| err.to_string())?; + + assert_eq!( + progress, + "Starting\nGraphVisualMaterials\nGraphVisualMaterialRequests(64)\n" + ); + Ok(()) + } + #[test] fn static_preview_component_merge_offsets_indices_and_remaps_local_selectors( ) -> Result<(), String> { diff --git a/docs/tomes/05-render.md b/docs/tomes/05-render.md index c49ca66..faf85d2 100644 --- a/docs/tomes/05-render.md +++ b/docs/tomes/05-render.md @@ -1126,6 +1126,12 @@ termination. It does not preserve the simultaneous TEXM count, so it neither identifies a slow individual material nor attributes time to MAT0 parsing; the next profiler revision needs one cumulative snapshot of all classes. +`fparkan-game --load-progress` now initializes its file with `Starting` and +appends each later mission-load event instead of replacing the prior line. A +bounded probe can therefore retain both MAT0 and TEXM request milestones even +when a later event is last. The behavior is diagnostic persistence only: it +does not alter graph traversal, resource validation, or rendering. + Mission loading now raises the decoded-payload cache entry budget from 64 to 256 while retaining its 64 MiB byte budget. This avoids premature entry-count eviction during resource-rich loads without making memory unbounded. The same