mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-20 09:05:51 +00:00
The Layer Cache, Footage Frame Cache and Preview (RAM) Cache settings are gone. The big caches (layers, footage frames, OpenEXR planes, preview frames, the disk write queue) share one budget: 80 % of the installed RAM left after the reserve (5 GB while RAM is unknown, 3.5 GB in the browser, at least 192 MB). No cache has a share of its own; the memory accountant frees the least valuable item first across all of them: cost to make again per byte, decayed by time unused, a copy worth nothing, a thrashing cache protected. Host sessions (CLI, MCP) apply the budget from the start. Low-memory halving holds until twice the threshold is available again, with one toast per episode. Saved settings lose the three old keys and keep the reserve.
15 lines
573 B
Rust
15 lines
573 B
Rust
//! #3298: every host session (the desktop app, the CLI, the MCP server) starts with the caches'
|
|
//! common budget: the caches have no limits of their own below it, so an unset budget would let
|
|
//! them grow until memory runs out.
|
|
|
|
use effectcraft_engine::render::memory::Accountant;
|
|
|
|
#[test]
|
|
fn a_host_session_bounds_the_caches() {
|
|
let s = effectcraft_host::session();
|
|
let budget = Accountant::global().budget();
|
|
assert!(budget < usize::MAX, "a finite budget");
|
|
assert_eq!(budget, s.memory_budget().bytes);
|
|
assert!(s.layer_cache.budget() <= budget);
|
|
}
|