100 tasks from the HWE arm-linux code-gen pool (outside the lk/man/pth range given to batch 22), each with at least one independent contract-edge defect and plain public docs. Claude reviewed 100/100 USABLE against current digests; no ID or source overlap with main or batch 22. Difficulty is unmeasured. progress.md records the wrap-up: all Codex sessions and Qwen schedulers stopped for the user's rollout, Qwen results so far (57 HARD of 373), and what is left on each batch branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 KiB
Task specification: resource-percpu-reference-fold
Identity and provenance
- ID/version: resource-percpu-reference-fold / 1; family resource-lifecycle; C++17.
- Source route C, original authored software-only adaptation of hwe/ldd3-percpu-refcount, public/hard base ID ldd3-percpu-refcount. This is not a historical field defect or a kernel implementation.
- Read-only source: factory/20261026-C-hwe-codegen-18/hwe/arm-linux/code-gen/ldd3-percpu-refcount/{metadata.yaml,prompt.md,reference/ldd3-percpu-refcount.c}; only read, no source checks/scripts run.
- Authorization: project and batch BRIEF; split/source grouping key ldd3-percpu-refcount. No private user content or credentials.
- Model keeps per-CPU accounting, owner release, kill/drain and release callbacks as ordered software events. Kernel scheduling, real allocation, affinity, concurrency, ARM and hardware are outside verification. Difficulty UNMEASURED; no Qwen, other real Agent or hardware execution.
- Scope differs from named registry/lookup lease tasks: explicitly addressed numeric objects, signed per-CPU folded balances and lifecycle, without names, namespaces or lookup-acquired leases.
Assets, interface and environment
Public workspace: three candidate files, reference_console.cpp (raw stdin/API observer), Makefile, README.md, docs/contract.md and smoke.txt. Only reference_ledger.hpp, reference_ledger.cpp and reference_batch.cpp are frozen and scored. Non-template fixture directories contain exactly those three candidate files. Private assets are check.py, verify.py and all reference fixtures. verify.py is the unchanged rollout/bos_verify.py.
Build argv: g++ -std=c++17 -O1 -Wall -Wextra -pedantic reference_ledger.cpp reference_batch.cpp reference_console.cpp -o observer (all paths supplied separately). Public make uses O2. Normal well-formed protocol exits 0, exact one observation record per command, empty stderr. Console syntax is intentionally restricted to well-formed ASCII and representable signed integers; semantic errors are API cases. B nonce excludes INT64_MAX so nonce+1 is representable. No malformed parsing promises exist. The checker uses subprocess text=True: stdout comparison is exact over the complete text after universal-newline normalization, so it does not claim to reject CRLF. Whitespace, records and integer formatting remain exact.
The console contains no cases, expected values, assertions, failure classification or hidden test generation. check.py uses an independent canonical global balance model and per-CPU local/watermark projections. Candidate methods are called only in the compiled subprocess. All trusted source reads and scratch writes happen before the compiler and runtime execute; afterward only subprocess results in memory are read. Scratch uses tempfile.mkdtemp(dir=Path.cwd()) inside the wrapper's exclusive directory, reclaimed by wrapper exit. Compile timeout 35 s, runtime 20 s, wrapper 100 s, task 120 s; runtime image resources are platform 512 MiB/1 CPU. No downloads/services/hardware required.
Fixed Docker runtime: ccr-29eug8s3-pub.cnc.bj.baidubce.com/algo/bench-runtime@sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1. Actual image ID and final task/verifier digests are in gate receipts/report.json. Local mode is trusted fixtures only, not an isolation claim.
Independent defects and witnesses
- Fold watermark: fold_one credits the pending contribution but does not advance its folded watermark. First/repeated maintenance raises total. Public smoke uses C17/G17/F17/T17 only, and the raw console's reported symptom must be traced to ledger accounting. fix_fold fixes only this defect.
- Precise non-smoke boundary: put wrongly requires this CPU's pending balance to be at least the returned amount. The public contract explicitly permits negative local/pending deltas from cross-CPU returns of globally borrowed references. Witness C99/G99(cpu3,12)/P99(cpu0,4) has legal global total 9; fix_negative fixes only this defect. The independent witness requires no fold and uses no invalid global balance. This exact boundary type was assigned by root: signed per-CPU local delta may be negative. Public smoke never returns references.
The two defects are independent: fixing the watermark leaves the legal cross-CPU put rejection; fixing negative-delta handling leaves the fold witness. mask_symptom turns explicit fold_cpu into a no-op: smoke total appears stable while the documented base/watermark and later lifecycle remain wrong. At least one symptom requires reproducing and tracing from dashboard/console to a different candidate module; no root-cause function/file is named in prompt.
Check-to-public-evidence matrix
All paths below are relative to task root. Every row is checked by raw compiled API observation with exact integer equality; inputs/expectations stay in protected check.py. One full run includes named deterministic witnesses and fixed-seed (0xC01DF01D) varied histories. The labels in checker rejection reasons and private stderr identify the row without weakening any condition.
| # | Required checks and witness family | Actual public evidence | Observation |
|---|---|---|---|
| 1 | Default four CPUs, reset endpoints 1/8, invalid 0/9/negative/extreme reset atomic, clearing all sequences/events | template/docs/contract.md:5 | N/S/L/H/Q before/after reset |
| 2 | IDs 1/1000000 valid, 0/-1/1000001 invalid, CPU 0 and last valid, -1/count invalid | template/docs/contract.md:6 | direct C/G/P/F/Q/D/T/I |
| 3 | Eight resident capacity, tombstones included, freed slots, duplicate before capacity | template/docs/contract.md:11; template/docs/contract.md:16 | C/K/E and N/Q |
| 4 | Signed payload min/max unchanged; creation incarnation starts 1, reuse advances, failed creation does not advance | template/docs/contract.md:11 | Q/L/H after reuse and failed creates |
| 5 | Local signed cumulative delta and total formula; globally valid put with zero/negative local; folded negative watermark | template/docs/contract.md:12 | cross-CPU witness, direct D/T/Q/S |
| 6 | Amount 1/LIMIT accepted domain, 0/-1/LIMIT+1/int64 extremes invalid; total exact max, owner floor, overflow by one | template/docs/contract.md:6; template/docs/contract.md:13 | direct G/P rc and Q/D/T |
| 7 | Error precedence ID/existence/CPU/amount/state/balance, output and ledger atomicity | template/docs/contract.md:7; template/docs/contract.md:13 | deterministic cross product plus subsequent complete observation |
| 8 | Fold_cpu and fold_all consume pending exactly once; idempotence, all CPU signed contributions, tombstone permitted | template/docs/contract.md:14 | direct F/A followed by D/Q/T and events |
| 9 | Kill drops owner once, folds every CPU, rejects reacquisition/repeated kill, keeps borrowed references drainable on any CPU | template/docs/contract.md:15 | K/G/P/Q/D/T, partial killed and complete drain |
| 10 | Exactly one release event, owner-only immediate release, final put release, callback sequence/order/identity/payload | template/docs/contract.md:16 | multi-object drain order 8,1,7,2,6,3,5,4; L/H/Q |
| 11 | Erase only released, absent and invalid precedence, retained events and capacity reuse | template/docs/contract.md:16 | E/C/N/I/Q/L/H |
| 12 | All independent query/query_cpu/total methods, nonce output preservation, min/max nonce, observation nonmutation | template/docs/contract.md:20; template/docs/contract.md:29 | Q/D/T individually with success/error and repeated observations |
| 13 | resident_count/cpu_count/events read separately; two instances independent; history retained until reset | template/docs/contract.md:5; template/docs/contract.md:21; template/docs/contract.md:29 | U/N/L, default second ledger and retained first state |
| 14 | Batch empty/64/65, each six kinds, unused fields ignored, invalid kind and first failure, atomic ledger/events/output, commit order | template/docs/contract.md:22 | B and complete direct observations before/after abort/commit |
| 15 | contains invalid/absent/all states, stats every lifecycle, signed negative pending aggregate | template/docs/contract.md:24 | direct I/S in each lifecycle; negative pending deterministic witness |
| 16 | event zero-based -1/0/last/past-end and int64 extremes, preserving all four output fields | template/docs/contract.md:24 | direct H at all endpoints, repeated L/H |
| 17 | select empty/8/9, duplicate order, first error, size priority, atomic vector output and extreme nonce | template/docs/contract.md:24 | direct V ordered requests and partial-valid rejection |
| 18 | Exact complete stdout text after universal-newline normalization, empty stderr, execution rc=0 for well-formed supported protocol | template/docs/contract.md:7; template/docs/contract.md:28; template/docs/contract.md:29 | complete text comparison after universal-newline normalization (whitespace, records and integer formatting remain exact), plus dedicated stderr/stdout cheats; no CRLF-rejection claim |
| 19 | Public smoke stable total across repeated explicit maintenance | prompt.md:1; template/README.md:3; template/docs/contract.md:14 | same C17/G17/F17/T17 sequence |
| 20 | Candidate-only collection, alternative algorithms accepted, no grader access dependency | template/docs/contract.md:30 | valid_journal acceptance and protected read probe rejection |
The exact C++ field order/types and method signatures are public in template/reference_ledger.hpp:12 through :74. Each declared method is invoked directly by the observer; query does not substitute for total, CPU detail, events, counts, stats, event, select or contains.
Fixtures
| Fixture | Expected | Behavioral meaning |
|---|---|---|
| gold | PASS | Fold-base plus unmerged signed CPU deltas |
| valid_journal | PASS | Authoritative immutable per-object action journals: recompute total as net journal deltas and replay lifecycle/fold projection on observation; no mutable folded-balance authority |
| template | FAIL | Both independent defects |
| noop | FAIL | Create returns 0 without storing an object; complete API remains linkable and runnable |
| cheat | FAIL | Always credit 3 on get; matches public smoke but fails other amounts |
| fix_fold | FAIL | Only watermark repaired; cross-CPU witness still fails |
| fix_negative | FAIL | Only local sign restriction removed; fold witness still fails |
| mask_symptom | FAIL | Explicit fold_cpu does nothing, hides public total symptom but violates watermark/base |
| cheat_stderr | FAIL | Correct semantics with extra stderr; dedicated R3/R13 rejection |
| cheat_stdout | FAIL | Correct semantics with extra stdout; complete normalized transcript rejection |
| cheat_read_grader | FAIL | Gold behavior only if parent check.py is readable; otherwise stderr then exit 73. Host unisolated read/PASS is permitted calibration exception, recorded unchanged |
Ordinary negative fixtures are required to compile/link with build=0 and run the entire raw observer with run=0, then fail comparison or output policy. Only cheat_read_grader may proactively exit 73 after denied read. Docker wrapper enforces separate UID, protected grader, no network and process-only candidate execution. No mutation of expected verdicts or receipts.
Gates, review and limitations
Gate 1 trusted-local and gate 2 fixed-image Docker each run every class five times into unique task-owned run directories. Final gate receipts, exact outcomes, cleanup, build/run proof and same-current-digest checks are recorded in author report.json. Historical runs remain unchanged. No full-repository unittest is run by this author; root coordinates it. No kernel/hardware/real-Agent/trajectory/difficulty claim follows from calibration. Status before parent review: authored and self-reviewed; actual gate facts appended by report generator, not inferred.
Final gate facts
Final task digest 2ccc11860958e570b5f7a037a4e8bf7a44e3d2878acc5676f7ce878fc251b50e. Trusted-local receipt runs/20261026-C-hwe-codegen-18/ldd3-percpu-refcount/local-20261026T215552879976Z/calibration-1b6e530f2ed84130a46b18e2f50b0da1/receipt.json: FAIL/exit 1, 55 trials, cleanup confirmed, solely the documented unisolated reader PASS 5/5 exception. Docker receipt runs/20261026-C-hwe-codegen-18/ldd3-percpu-refcount/docker-20261026T215552879976Z/calibration-585dc7e99d2f4ca1ad4a63c7098719b7/receipt.json: PASS/exit 0, all 55 trials conform, cleanup confirmed, matching digest; image ID sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1. All ordinary negatives build0/run0 then behavior/output rejection; Docker reader build0/run73. Author report and all repeat-level facts: factory/20261026-C-hwe-codegen-18/subagents/ldd3-percpu-refcount/report.json. Public make reproduction: template totals 4,7,10; gold totals 4,4,4; both build0/run0/empty stderr. Root review and full regression remain pending.