Files
dev c2c238d9b1 M checkpoints recorded; harness statuses; memory test split; P6A-12
- results note docs/evaluation/results/2026-10-06-m-checkpoints.md:
  both checkpoints, owner's assessment (IR-tax closed at the engineering
  level, layer 7 GO; cost hypothesis open); plan status and order
- P6A-12: source type-check completeness (E1001 reached the verifier
  from a source run); not a layer 7 blocker
- harness: metrics.agent_status (max_tokens for a reply cut at its
  length limit, provider_rate_limited for 429/usage limits) and
  metrics.evaluation_status (accepted/rejected/evaluator_error/
  infrastructure_failure/not_evaluated), kept apart; termination records
  max_tokens; checkpoint rows show both; evaluator contract: an
  infrastructure failure sets "infrastructure": true
- interpreter memory test: fast form (20k-320k iterations, 256 KiB
  threshold via Options.collect_threshold) in zig build test; full form
  (100k/1M/4M) in zig build test-extended; CI job 'extended' also runs
  conformance with --collect-every-step
2026-10-05 17:43:55 +03:00

26 lines
1.3 KiB
Zig

//! Extended test (`zig build test-extended`): the interpreter's execution
//! memory is bounded by live state, not by the iteration count, at full
//! scale with the default collection threshold. The fast form runs in
//! `zig build test` (src/interp/machine.zig).
const std = @import("std");
const aji = @import("aji");
const mt = aji.interp.memory_test;
test "execution memory at 100k / 1M / 4M iterations" {
inline for (mt.loop_shapes, 0..) |shape, k| {
const small = try mt.memoryOf(shape, 100_000, null);
const mid = try mt.memoryOf(shape, 1_000_000, null);
const large = try mt.memoryOf(shape, 4_000_000, null);
errdefer std.debug.print("shape {d}: live {d}/{d}/{d} heap {d}/{d}/{d} collections {d}/{d}/{d}\n", .{
k, small.peak_live, mid.peak_live, large.peak_live, small.peak_heap, mid.peak_heap, large.peak_heap,
small.collections, mid.collections, large.collections,
});
try std.testing.expect(large.collections > 0);
// Steady state: the live state of 4M iterations is the live state of 1M.
try std.testing.expect(large.peak_live <= mid.peak_live + 64 * 1024);
// The heap is bounded by a constant (collection threshold plus one growth step).
try std.testing.expect(large.peak_heap <= 3 * mt.min_threshold);
}
}