Repository navigation
Conversation
This was referenced Nov 3, 2026
psiha
force-pushed
the
feat/resource-recording
branch
from
November 3, 2026 23:34
1450e3c to
2c741aa
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request due to rate limiting. Please try again later. See Usage limits for GitHub Copilot for details.
Adds runner/proc.mjs, which reads /proc for the runner and the processes it started, and records per test: an upper bound of the peak resident memory (the VmHWM of each process, added up) with its anon, file and shared split, the resting resident memory, CPU time, threads, involuntary context switches, storage IO and the size of the entry's folder in --work. The result file also gets an env block: kernel, CPU governor, load, steal time, the type of file system of --work and the scheduling class of the runner. The runner scans /proc before a test, after its setup, after its first and its last run and at its end, never in the timer and never between two runs in the middle. Not measured on a quiet machine. FPABENCH_RESOURCES=0 turns the readings off. The snapshot is now also keyed on the system version and the RAMA binary (path, size and modification time). Additive: no existing field changes. Closes #25 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
psiha
force-pushed
the
feat/resource-recording
branch
from
November 5, 2026 10:10
2c741aa to
f5af631
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #25
What
The method says each result records peak memory, CPU time and thread count, but the runner recorded none of them. This records them, per test, for the runner and the processes it started, so a system that runs in the runner (RAMA, DuckDB) and a server it starts (PostgreSQL, ClickHouse) are measured the same way. New
runner/proc.mjsreads/proc. Nodb.mjschanges.Per test, an additive
resources:peakRssUpperBoundMBandpeakSource: an upper bound, not a peak at one moment. Each process'sVmHWM, reset at the start of the test throughclear_refs, added up, although the processes peaked at different times. If the reset is not allowed, the largest resident memory at a scan, andpeakSourcesays so.rssSplitMB:anon,fileandshmem(RssAnon,RssFile,RssShmem) at the scan where the resident memory was largest. A mapped file counts asfile, so compare systems onanon.rssMB:afterSetup,afterFirstRun,afterLastRuncpuMs(user,sys),involuntaryCtxSwitches,threadsio:read_bytesandwrite_bytesof/proc/<pid>/io, with its source named. Reads the page cache served are not counted, andwriteBytesis bytes dirtied, not bytes that reached the device.diskMB:apparentandallocatedsize of the entry's folder in--workafter the testAnd a top-level
env: kernel, CPU governor, load average at the start and end, steal time, the type of file system of--work, and the scheduling class of the runner (so a run that was not SCHED_FIFO shows it).The snapshot's hash now also covers the system version and the RAMA binary named by
RAMA_NODE_ADDON_BINARY(its path, size and modification time, not its contents: a rebuild changes the time, and hashing hundreds of MB at every start gains nothing), so a snapshot another build made is rebuilt instead of reused. This makes existing work folders rebuild their snapshot once.tests/method.mdgets the sentence that was not true replaced by what is recorded.runner/README.mdexplains each field and what it does not cover.Noise and blind spots it removes
Wall time alone cannot tell a busy machine from a real change.
involuntaryCtxSwitches, load, steal time and the scheduling class now say it, and memory, disk and IO are in the results at all.Schema
Additive:
tests.<id>.resourcesandenv. The website, the scores and the expected answers read neither. Off Linux, or withFPABENCH_RESOURCES=0, they are left out (env.sourceisunavailablewithout/proc).Limits, written in the README too
/procbefore a test, after its setup, after the first and the last run and at its end. It does not scan between the runs in the middle, so no scan lands between two timed reads (a scan takes 0.1 to 0.6 ms). The peak in between is held by each process's ownVmHWM.diskMBcounts a reflinked copy of the snapshot in full, so on such a file system it is larger than the space used.cpuMsandiocover the whole test (setup, runs, teardown), not the timed part.How it was checked
On a Linux box, 10m,
--quick:okand every test hasresources. A test that starts from the snapshot shows memory after setup, after the first run and after the last.ok. The peak (about 1.6 GB, 240 to 390 threads) is far above the runner's own, so the server is counted. R8'safterSetupis the stopped system, far below itsafterFirstRun.FPABENCH_RESOURCESwould say nothing. What is checked instead is that the per-run hook reads/proconly after the first and the last run (a unit test). The scans are outside the timer.node --test runner/proc.test.mjschecks the parsers on fixed/proctext, including a process name with spaces and brackets, a mount point with an escaped space, and the first-and-last-run rule.availableis false, andenv.sourceisunavailable. A full run there was not made.Not checked: PostgreSQL, 100m and 1b (memory sampling cost with a very large process, the size of
diskMBwalks), macOS, a quiet machine.🤖 Generated with Claude Code