amos 4f17b2afe5 Batch 20 (20261027-C-family-20): map batch 15's ad-hoc families to canonical ones
210 batch-15 tasks used 119 ad-hoc family names. Each now carries one of the
canonical root-cause families (11 of the 19 are used), with version + 1 and a
spec.md note, and was recalibrated through both gates. Claude checked that only
family, version and spec.md changed, that every family is canonical, and the
new trace6 Docker receipts against current digests (210/210 USABLE).
Squashed from the 36-local branch batch20-family.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 05:58:17 +08:00

15 KiB
Raw Permalink Blame History

timer-negative-phase specification

1. Identity, source and admission

Task timer-negative-phase v1; family timer-periodic-phase; language C11; source hwe/dbg-gdb-modulo-negative; route C original; split/root group dbg-gdb-modulo-negative. Current state CALIBRATED, difficulty UNMEASURED. Author is the single assigned batch15 subagent; independent reviewer is root (pending). Source prompt and reference provide only the negative-remainder direction. The original reference computes -7 modulo 3 and does not access an array; this task does not claim a real field incident or memory fault. User authorized the project material and runtime. No user conversations, credentials, personal data or external downloads are included.

Software-substitute admission: explicit signed tick coordinates replace any board clock. The C remainder and periodic phase reliability issue remains unchanged under this deterministic substitute; no hardware, real-time race, network, kernel configuration, electrical behavior or timing claim is made. Inputs are bounded to +/-1e9, period positive <=1e6, arithmetic is int64_t. Negative input is arithmetic only, never an array index; IDs are range checked before array use. No INT_MIN/-1 division, overflow request or undefined behavior is introduced. This is a distinct original multi-channel service, not the seed's fixed printf.

2. Initial state, environment and assets

The initial service is an empty bank at time zero. Full source, immutable main.c harness, Makefile, contract and two replay transcripts are in template (13 files). Candidate files are phase.h, phase_math.c, timer_bank.c, wire.c, cli.c. Runtime support main.c is frozen verbatim in check.py; no candidate-visible tests or reference solutions are needed at acceptance. Formal checker independently rebuilds a unique scratch executable and reads raw protocol output; expectations stay in the Python parent. No source script was executed.

C/Python runtime fixed image: ccr-29eug8s3-pub.cnc.bj.baidubce.com/algo/bench-runtime@sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1. Actual inspected image ID sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1. Read-only tool check observed /usr/bin/gcc and /usr/bin/make, gcc Debian 14.2.0-19. Public make does not require missing CMake or any install. Compiler timeout 30s, each candidate run 5s, finally cleanup 10s, formal total 120s (wrapper total 100s); measured checks are far below limits. Grading uses independent fixed-image no-network containers and UID/GID65534 children; host gate is trusted samples only.

Unique source count is 674 lines: {"phase.h": 75, "phase_math.c": 62, "timer_bank.c": 198, "wire.c": 275, "cli.c": 46, "main.c": 5, "Makefile": 13}. Count template C/header and necessary build lines once, excluding blank/comment lines, docs, pure data and fixture copies. Removing every brace-only line still yields 512 lines; per-file reproducible counts are in the subagent code-line-count.json. All implementation is new for this task and no other batch15 new-task code was read.

3. Public question and interface

prompt.md is a symptom report: historic-coordinate playback and a policy switch disagree with the maintenance transcript. It gives make, both public replay commands, make check, the five deliverables and requires docs/timer-contract.md in full. It does not identify a root-cause file/function/category. README directs users to the complete contract. make builds timer-demo; stdin holds ASCII request lines and stdout the specified raw observations; valid and rejected requests continue until EOF, exit 0. stderr diagnostics are allowed. No absolute workspace path occurs in the prompt.

D1: timer_residue retains signed C remainder. A negative phase or elapsed coordinate leads to negative canonical phase and/or a deadline more than one period away. In public-count, expected STATE phase=2 next=-7 but template reports phase=-1 next=-4. D2: consume_channel's LATEST branch overwrites latest with earliest, retaining the first backlog coordinate. Public default demo.in uses COUNT, so D2 occurs only under another documented mode (latest.in). Public latest expects EVT 4 3 15 15 2 20, while only_fix_phase reports 5 5. The two defects have separate fixes and neither fix alone passes.

4. Acceptance evidence mapping

Every row maps an actual checker behavior to exact frozen public lines. Hidden combinations add inputs, never new semantics. The Python model computes lattice coordinates with integer floor division, independently of the C gold's remainder/remaining-distance implementation. Fixed RNG seed 0x74696D6572 creates 18 mixed-operation cases; 9 directed cases give 27 total, 6527 observation lines for a correct implementation.

Checked behavior Exact public basis Scenarios Observation
Initial empty bank at time 0 without mandatory INIT template/docs/timer-contract.md:4; :26 empty-and-errors initial LIST/STATS exact state and counters
Decimal syntax, whitespace, empty lines, command arity/case and unknown command template/docs/timer-contract.md:21; :22; :23; :24; :25 whitespace-line-limits, invalid-atomicity exact response or no line
255-byte line bound and continuing after a rejected long line template/docs/timer-contract.md:21; :25; :57 whitespace-line-limits 256-byte line then PEEK ERR syntax and unchanged state
IDs 0..15, independent channels and ascending order template/docs/timer-contract.md:8; :17 all-ids-large-gap, invalid-atomicity LIST and EVT order
Signed time/phase/epoch/shift bounds and periods 1..1000000 template/docs/timer-contract.md:8; :9; :10; :11 strict-boundary, invalid-atomicity, generated integer fields and ERR range
Canonical residue phase for negative values, multiple periods and exact multiples template/docs/timer-contract.md:12; :13; :14 public-count, all-ids-large-gap, generated STATE phase
Two-sided infinite periodic lattice and next strictly after current time template/docs/timer-contract.md:15; :16; :17 public-count, strict-boundary, generated STATE next; due endpoints
INIT resets all channel state and permits backward reset template/docs/timer-contract.md:28 empty-and-errors and per-case INIT OK INIT, empty bank
PUT creates/replaces, enables and zeros channel counters template/docs/timer-contract.md:29; :30 rearm-and-replace, generated STATE and STATS reset
Mode validation and PUT response template/docs/timer-contract.md:29; :30 invalid-atomicity and all PUT scenarios ERR syntax or OK PUT
PEEK and missing channel behavior template/docs/timer-contract.md:31; :54 empty-and-errors, generated STATE or ERR missing
ENABLE flag validation, disabled next=0 and rearm including duplicate enable template/docs/timer-contract.md:32; :33; :34 rearm-and-replace, invalid-atomicity preserved counters and recomputed next
SHIFT canonical phase, preservation and enabled/disabled rearm template/docs/timer-contract.md:35; :36; :37 rearm-and-replace, generated STATE fields and later EVT
DROP removes existing channel or returns missing template/docs/timer-contract.md:38 empty-and-errors, rearm-and-replace, generated OK DROP / ERR missing, LIST and STATS
TICK rejects backward target atomically and allows equal time template/docs/timer-contract.md:25; :39 invalid-atomicity, independent-latest, strict-boundary ERR backward or BEGIN/END without replay
TICK consumes only enabled due coordinates in exclusive/inclusive interval template/docs/timer-contract.md:39; :40; :41 all-ids-large-gap, rearm-and-replace, generated event count, due and no spurious events
COUNT earliest/latest endpoints, due cardinality and next deadline template/docs/timer-contract.md:42; :43; :44 public-count, strict-boundary, all-ids-large-gap EVT integer arithmetic
LATEST latest effective coordinate, skipped due-1 template/docs/timer-contract.md:44; :45 public-latest, independent-latest, generated both EVT endpoints latest, skipped
Counters increase by due and skipped, including large gaps template/docs/timer-contract.md:46; :51; :52 strict-boundary with 2000000000 due; all-ids-large-gap PEEK and STATS counters
BEGIN/EVT/END structure and time advancement even without events template/docs/timer-contract.md:47; :48 empty-and-errors, equal-time TICK, generated exact transcript
LIST count, ordered states, disabled channels, no END line template/docs/timer-contract.md:49; :50; :54 all-ids-large-gap, generated exact transcript
STATS sums only currently configured channels template/docs/timer-contract.md:51; :52 rearm-and-replace, generated aggregate counters after DROP/replacement
Every rejected request preserves state and service continues template/docs/timer-contract.md:25; :57 invalid-atomicity with trailing PEEK/STATS/TICK unchanged STATE and later proper execution
Output field order, decimal scalar format, spaces, terminal newline; stderr permitted template/docs/timer-contract.md:54; :55; :56 every scenario exact stdout bytes as text; stderr ignored on rc=0
Normal EOF exits 0 and thousands of commands remain supported template/docs/timer-contract.md:57; :62; :63 all 27 scenarios totaling >2000 commands candidate_rc=0 and all observations
Clean C11 rebuild through immutable main.c support template/docs/timer-contract.md:61; :65; :66; template/Makefile:2; :3; :6 gcc argv in checker compile_rc=0; harness contains no assertion or expected result

Evidence rows: 26. API structs and numeric error codes are public in phase.h:12, :17, :25, :38, :43, :52 and declarations at :60 through :81. The acceptance harness is the frozen public main.c, which only invokes timer_cli(stdin, stdout); it has no hidden tests, expected values or assertions. Pure valid alternative code may change algorithms/control/data layout while preserving public behavior.

5. Fixtures and directed mechanisms

All nine fixtures contain only the five candidate files and compile successfully. gold PASS fixes both defects; template FAIL retains both; noop FAIL consumes no behavior and emits no output; cheat FAIL hardcodes only the public COUNT transcript; cheat_read_grader FAIL requires reading private check.py, using a public absolute /grader path or actual parent argv path, then runs correct logic (trusted-local can read and PASS as allowed exception); only_fix_phase FAIL fixes residue but retains LATEST failure; only_fix_latest FAIL fixes backlog reporting but retains bad residue; mask_symptom FAIL fixes residue and special-cases only public latest ID4/period5, rejected by independent-latest ID12/period7; valid_quotient PASS uses quotient-derived lattice boundaries plus two-pass pending-count collection then mutation/reporting, unlike gold's remainder-distance plus one-pass per-channel consumption. It is not a renamed patch.

The checker populates all source/support before its first child. After that it does not read/write/traverse candidate-controlled scratch; raw outputs arrive over pipes. All compiler, candidate and cleanup execution uses subprocess argv, and the wrapper forces every child to UID/GID65534 with no supplementary groups in formal mode. Scratch root is never chmod'd after the mkdtemp hook transfers ownership. finally always invokes exact-path shutil.rmtree in a child under that same identity and checks rc; cleanup failure cannot PASS. Compiler rc, candidate timeout/nonzero rc, and normal-exit first raw observation difference are reported separately, including exact scratch path and cleanup UID/GID/rc. Formal isolation also probes verify.py unreadability in the byte-identical rollout/bos_verify.py. No isolation-blocked marker, dynamic import of candidate, hidden child assertion or root traversal after child is used.

6. Gates and evidence

Single draft checks: gold and valid_quotient PASS with 6527 observations; all negative behavior mechanisms FAIL except local cheat_read_grader PASS (no host isolation). Those preliminary logs are in the subagent directory, not formal gate receipts. All cleanup rc=0. Exact-byte stdout comparison was then tightened before final digest freezing to include terminal newline. Gate commands are the two BRIEF formal calibrate commands, each fixture five times (45 each); their unique attempts, digest and cleanup results will be recorded in report.json after execution. Whole-repository unit tests belong to root; none run here. No Qwen/Pi or other sampling, no git commit or shared ledger edit.

7. Review, limits and next step

Author review: public semantics cover every acceptance row; all samples build; no unintended array indexing or signed-overflow path in allowed coordinates; independent valid implementation passes; two partial fixes and public-only symptom masking fail. All candidate numeric observations compare defined fields only, never unused array tails, and stderr is not rejected. Frozen source files have no trailing spaces or extra EOF blank lines. Complete draft must pass core.load_task before atomic publication; tasks is not used for an incomplete directory. Author self-review is not independent root approval.

Completed: trusted-local and fixed-image Docker gates each executed 45 trials with the current digest. Local status FAIL has exactly the five allowed cheat_read_grader PASS observations; Docker status PASS has every expected result. Root independent review remains pending. State CALIBRATED/UNMEASURED, never ADMITTED. Real Agent trajectory, empirical medium difficulty, hardware behavior, archival upload and full-repository regression remain unverified/owned by root. Successful calibration alone is not a real rollout or proof of hardware correctness.

Final gate record

Current task digest 4ff1db0beefeb6320739705deb39468817e491bc463b7aeef26e29bb99a0418d.

  • Trusted-local receipt: runs/20261023-C-hwe-scale-15/dbg-gdb-modulo-negative/local/calibration-fa3bf990d1184e3d937bfb517703cadd/receipt.json. Actual status FAIL, cleanup confirmed; gold and valid_quotient each 5 PASS, six ordinary negative fixtures each 5 FAIL, cheat_read_grader 5 PASS as the allowed nonisolated exception. No other mismatch.
  • Docker receipt: runs/20261023-C-hwe-scale-15/dbg-gdb-modulo-negative/docker/calibration-01c2964413724ed58e64b3d2a36f69fb/receipt.json. Actual status PASS, cleanup confirmed; gold and valid_quotient each 5 PASS, all seven negative fixtures each 5 FAIL. Image ID matches the fixed digest above.
  • Every one of 90 compile logs records rc=0; every one of 90 scratch cleanup children records rc=0. All 45 formal cleanup children attest UID=GID=65534. The private grader-read fixture is an explicitly controlled candidate rc=9 rejection in Docker, not a compiler failure or normal-exit observation difference. All other negative fixtures exit 0 and carry first-raw-difference evidence.
  • All 45 Docker trial names from this attempt's events were separately inspected after completion and are absent. No network was created for this task. Detailed per-trial stderr hashes, exact scratch paths, candidate/compile/cleanup categories and container inspection return codes are in the single-task calibration-audit.json. No historical attempt was overwritten. 族名规范化:timer-periodic-phase → numeric-reliability(2026-10-27)