16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 12:49:18 +02:00

Add headless parallel eu7v2 scenario bake with streaming and PLCE placements

Enable --eu7v2-bake from the main binary: parallel module pool, bounded-RAM
spool flush, streaming terrain triangles, flat include/model parsing, and
eu7v2 emit/load with optional verify. Large placement .scm files emit lean
PLCE records and bake referenced .inc modules separately for reuse.

- CLI: --eu7v2-bake, --eu7v2-verify, --eu7v2-mem-limit-gb, --eu7v2-threads,
  --eu7v2-max-parse; wire max_threads through to the bake parser
- eu7v2 v2 records: PLCE placements, runtime emitter/loader, batch verify
- Parallel bake pool with session cache; drop heavy-serial parse gate in spool
  mode; parse concurrency matches thread count
- Streaming terrain: batched parallel parse+bake, scan/bake pipeline, shape
  spool with persistent buffered I/O and flush-before-read
- Parallel flat-file streaming for models/includes; pack/model spool for
  low-memory incremental flush
- Optional 50 GB private-bytes guard during headless bake

Braniewo_szeroki: 160 modules, verify PASS, ~34s bake (nmt100 ~17s vs ~190s
serial baseline).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
maj00r
2026-06-17 21:15:36 +02:00
parent 9574d2051b
commit beacc00932
40 changed files with 9327 additions and 193 deletions

View File

@@ -161,6 +161,8 @@ set(SOURCES
"scene/eu7/eu7_emit.cpp"
"scene/eu7/eu7_apply.cpp"
"scene/eu7/eu7_bake.cpp"
"scene/eu7/v2/eu7v2_bake.cpp"
"scene/eu7/v2/eu7v2_load.cpp"
"scene/eu7/eu7_parameters.cpp"
"scene/scenenode.cpp"
"simulation/simulation.cpp"
@@ -415,11 +417,14 @@ if(WITH_EU7_PARSER)
message(FATAL_ERROR "EU07 parser headers missing at ${EU07_PARSER_INCLUDE}. Sync eu07-parser/include from the parser repo.")
endif()
add_library(eu07_bake STATIC "scene/eu7/eu7_bake_parser.cpp")
add_library(eu07_bake STATIC "scene/eu7/eu7_bake_parser.cpp" "scene/eu7/v2/eu7v2_emit_runtime.cpp")
target_compile_features(eu07_bake PUBLIC cxx_std_23)
set_target_properties(eu07_bake PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON)
target_include_directories(eu07_bake PRIVATE "${EU07_PARSER_INCLUDE}")
target_include_directories(eu07_bake PRIVATE "${EU07_PARSER_INCLUDE}" "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(eu07_bake PUBLIC Threads::Threads)
if(WIN32)
target_link_libraries(eu07_bake PUBLIC psapi)
endif()
if(MSVC)
target_compile_options(eu07_bake PRIVATE /utf-8 /Zc:__cplusplus /EHsc /wd4834)
endif()