Enhance civilization flow mechanics and adaptive quality control

- Implemented runtime-only adaptive quality controller to optimize simulation performance based on CPU time.
- Added adaptive quality thresholds and recovery cycles to dynamically adjust simulation fidelity.
- Introduced single-step solving method for civilization transitions to improve performance under high loads.
- Updated benchmark scripts to include speed parameter for testing various simulation speeds.
- Added tests for adaptive quality adjustments and their effects on civilization flow calculations.
- Documented results of optimization attempts and their impact on performance metrics.
This commit is contained in:
Kirill
2026-10-08 22:05:08 +03:00
parent 459fbb2a4d
commit 02c9843e1b
11 changed files with 891 additions and 14 deletions
+11 -5
View File
@@ -117,13 +117,19 @@ func run():
behind.evolute_frame(0.0, self)
check(behind.frame_commits == 1 and not behind.frame_busy, "Consumed interval cannot be processed twice")
behind.evolute_frame(0.23, self)
behind.evolute_frame(0.53, self)
var remained_busy: bool = behind.frame_busy
if remained_busy: behind.evolute_frame(0.53, self)
var pending_clock: Dictionary = behind.frame_clock.duplicate()
if remained_busy:
check(E.eq(behind.frame_active_clock.datetime, 123000), "Busy transaction reserves its original target")
while behind.frame_busy: await process_frame
check(E.eq(behind.state.time.datetime, 123000), "Busy transaction keeps its original target")
behind.evolute_frame(0.0, self)
while behind.frame_busy: await process_frame
check(E.eq(behind.state.time, pending_clock), "Next cycle consumes all time accumulated during computation")
if remained_busy:
check(E.eq(behind.state.time.datetime, 123000), "Busy transaction keeps its original target")
behind.evolute_frame(0.0, self)
while behind.frame_busy: await process_frame
check(E.eq(behind.state.time, pending_clock), "Next cycle consumes all time accumulated during computation")
else:
check(E.eq(behind.state.time, pending_clock), "Completed transaction publishes the full requested interval")
dispose(behind)
print("Frame evolution: %d checks, %d failures" % [checks, failures])
quit(1 if failures else 0)