test(conformance): hold each program to an allocation budget #297
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/60-allocation-budget"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #60
What
allocated_blocks, that only rises. Each block made bytorb_allocate/torb_raw_allocate(and their zeroed forms) counts once; re-classing a block as immortal or mortal makes none. Worker heaps fold it like the live count, the VM keeps its own count.TORB_REPORT_LEAKS=1prints a third line,allocated blocks at exit: N, andtorb_allocated_block_count()reads it.<program>.allocations. The rule follows PERFORMANCE section 6:unbudgeted: <reason>for a program whose count is not stable;TORB_ALLOCATION_BUDGET=enforce|reportoverrides;unbudgeted:because their count depends on timing or scheduling: the loopback socket reads (http, https, dns-over-tls, tls-top-level-task, sandbox-crossing), a cancellation landing mid-loop (task-cancel-cascade, task-workers), the child-process programs that read pipes in as many chunks as arrive (process-pipes, process-start, process-run-input, process-standard-error, confined-child, print-reaches-a-pipe), the clock readers (wall-clock, time, task-sleep, task-within). Tier B on7638ea35caught process-pipes, process-start and wall-clock varying between runs, so the whole class went unbudgeted.sh tools/conformance.sh --update-budgets [--filter X]writes.allocationsfrom three native runs with one worker and refuses to write when they differ.Test
runtime/tests/memory_test.c: two new tests (every block counted once, a free does not lower it; immortal blocks counted once)..allocationsfiles follow in the second commit.Overlaps #291 in
tools/conformance.sh(usage block) andcompiler/CONTRIBUTING.md(different paragraph); whichever lands second rebases.23b6b508755266b098855266b098852c8a7deef72c8a7deef799e223057299e223057222a0599c9922a0599c997638ea358f7638ea358f5681f1b7db5681f1b7db78871c9ca278871c9ca2a55dae636fa55dae636f0a17a5a05fWIP: test(conformance): hold each program to an allocation budgetto test(conformance): hold each program to an allocation budgetChecklist (head
0a17a5a):memory_test.c(each block counted once, a free does not lower it; immortal/re-classed blocks counted once). The 216 budgets are exercised by tier B (linux-x64), green on this head, so every budget matches a real run; tier A, bootstrap, pdisc and gates are green too.torb_count_allocatedis called once pertorb_allocate/torb_raw_allocate, not on re-classing; worker heaps are summed/folded like the live count, including the machine variants.conformance.sh: exact compare, under-budget note,unbudgeted:bypass, stale.allocationswithout a leak run is flagged,--update-budgetswrites only when three runs agree, VM legs read nothing, non-Linux-x86_64 reports only.Non-blocking:
unbudgeted:files. History cannot be changed after merge; the PR body is the accurate record.