aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-07-18 11:46:00 +0300
committerValentin Popov <valentin@popov.link>2026-07-18 11:46:00 +0300
commita3b19b434903c98d66976d1663bc21f23600a123 (patch)
treed2b736cb7b9ebedf8ad6f706cebdfd58dd04897c
parentb744a9d880a853c5509f624b0e357416ba382b1d (diff)
downloadfparkan-a3b19b434903c98d66976d1663bc21f23600a123.tar.xz
fparkan-a3b19b434903c98d66976d1663bc21f23600a123.zip
feat(game): retain load progress milestones
-rw-r--r--apps/fparkan-game/src/main.rs25
-rw-r--r--docs/tomes/05-render.md6
2 files changed, 30 insertions, 1 deletions
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(
@@ -1050,6 +1056,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> {
let mut merged = VulkanStaticMesh {
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