Index string provenance with metered image and session tables

This commit is contained in:
2026-10-14 13:55:16 +01:00
parent bb6f212779
commit 3f9d235546
16 changed files with 848 additions and 15 deletions
@@ -97,3 +97,40 @@ fn warmed_instruction_regions_do_not_allocate() {
assert_eq!(counts, (0, 0), "{name}");
}
}
#[cfg(feature = "resource-diagnostics")]
#[allow(dead_code)]
#[path = "support/callables.rs"]
mod provenance_callables;
#[cfg(feature = "resource-diagnostics")]
#[test]
fn provenance_queries_allocate_nothing_at_all_qualification_sizes() {
use prometeu_bytecode::model::ConstantPoolEntry;
use prometeu_vm::string_provenance_qualification::Fixture;
for count in [1024_usize, 16384, 65536] {
let constants = vec![ConstantPoolEntry::String("same".into()); count];
let image = provenance_callables::image_constants(
&[("RET", provenance_callables::sig(&[], &[]), vec![])],
vec![],
&constants,
)
.unwrap();
let mut fixture = Fixture::new(image, count);
let work = fixture.work();
let bound = count.ilog2() as usize + 1;
assert!(work[0] <= bound && work[1] <= bound);
for workload in ["image_hit", "image_miss", "session_hit", "session_miss", "import_hit"] {
COUNTS.with(|c| c.set(Some((0, 0))));
for _ in 0..100 {
fixture.run(workload);
}
let counts = COUNTS.with(|c| c.replace(None)).unwrap();
assert_eq!(counts, (0, 0), "{workload}, owners={count}");
}
COUNTS.with(|c| c.set(Some((0, 0))));
fixture.run("snapshot_mixed");
let counts = COUNTS.with(|c| c.replace(None)).unwrap();
assert_eq!(counts, (1, 1), "only snapshot Value storage allocates");
}
}