Make workspace contract verification unambiguous

This commit is contained in:
ms2k 2026-07-15 01:22:32 +09:00
commit 7a1b4dc447

View file

@ -38,6 +38,9 @@
"clock": "CLOCK_MONOTONIC_RAW elapsed nanoseconds",
"statistic": "median",
"relative_statistic": "median of paired routed/direct elapsed-time ratios",
"median_definition": "sort numeric values ascending and select value at zero-based index floor(count/2); every measured count is odd",
"within_run_relative_mad_formula": "median(abs(sample - median(samples))) / median(samples), evaluated separately for direct elapsed times, routed elapsed times, and paired routed/direct ratios in each workload, preparation state, and independent run",
"between_run_median_spread_formula": "(max(run_medians) - min(run_medians)) / median(run_medians), evaluated across the three independent-run medians separately for direct elapsed time, routed elapsed time, and paired routed/direct ratio in each workload and preparation state",
"outlier_policy": "retain every completed measured sample",
"sample_timeout": "four times the workload absolute budget",
"within_run_relative_mad_limit": 0.10,
@ -49,12 +52,40 @@
"primed": "fresh materialization followed by one untimed complete workload invocation before measured samples"
},
"normalization": {
"fixture_identity": "SHA-256 of canonical byte-path, kind, mode, size, and regular-file content records",
"result_identity": "workload-specific canonical output plus post-workload fixture identity",
"environment": "reject a run that differs from any reference environment field",
"background_load": "reject a sample when another process consumes more than five percent of one reference core or benchmark memory pressure causes reclaim",
"pass_rule": "every independent run and preparation state meets both the absolute median and paired median-ratio budget and both variance limits"
},
"identity_encoding": {
"integer_encoding": "unsigned integers are fixed-width big-endian; the command exit status is signed two's-complement i32 big-endian",
"fixture": {
"context_hex": "6c617a617265742d69676e6f7265642d776f726b73706163652d666978747572652d763100",
"root_entry": "omitted",
"path": "raw relative pathname bytes with slash separators, no leading or trailing slash, and no NUL",
"ordering": "ascending lexicographic order of complete raw path byte strings",
"kind_tags": {
"directory": 1,
"regular": 2,
"symlink": 3
},
"mode": "u32 of st_mode masked with octal 7777",
"size": "u64 payload length for regular files and symlinks; zero for directories",
"payload": "regular file bytes, raw symlink target bytes, or empty bytes for a directory",
"record": "u32(path length) || path || u8(kind tag) || u32(mode) || u64(size) || SHA-256(payload)",
"stream": "context bytes || u32(record count) || records in declared ordering",
"identity": "SHA-256(stream)",
"unsupported_entry": "reject identity construction for any other file kind"
},
"result": {
"context_hex": "6c617a617265742d69676e6f7265642d776f726b73706163652d726573756c742d763100",
"workload": "u32(UTF-8 workload ID length) || UTF-8 workload ID",
"command_record": "i32(exit status) || u64(stdout length) || exact stdout bytes || u64(stderr length) || exact stderr bytes",
"ordering": "command records remain in command_sequence order",
"stream": "context bytes || framed workload || initial fixture identity || u32(command record count) || ordered command records || post-workload fixture identity",
"identity": "SHA-256(stream)",
"successful_sample": "every command exit status is zero and both fixture identities and every output byte are retained"
}
},
"workloads": [
{
"id": "metadata-10000",