amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
One user-space repair task per eligible HWE debug-diag / compile-deploy base
ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content
filter. Each ships a public spec with a check-to-basis table, at least two
defects with single-fix fixtures, a symptom-masking fixture and an alternative
correct implementation. Claude re-checked all 320: structure, the HWE quality
items and trace6 Docker calibration receipts against current digests
(320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120
ad-hoc family names; the next batch maps them to the canonical list.
The batch's 1,256-line progress log stays in its factory report and the
36-local branch batch15-hwe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:55:56 +08:00

6.1 KiB

Qualification contract

  1. Plans and validation. validate returns the first applicable code: 1 for lanes outside 1..4; 2 for modulus outside 2..65536; 3 for more than 64 jobs; 4 for an active initial value at least modulus; then inspect jobs in order, returning 5 for lane outside the active range, 6 for units above 32, 7 for stride outside 1..31, 8 for seed above 65535, 9 for operation above 2. Otherwise return 0. No device access occurs for invalid plans. Fixed main prints INPUT_ERROR for lexical/structural input failures, or PLAN_ERROR code for validation failures, and exits 2. Valid execution returns report.status=0 and process exit 0. Empty job lists and zero-unit jobs are valid. Once all three header integers are read, lanes above 4 or job_count above 64 are rejected by validate in its stated precedence before reading the body; no body is needed for such invalid headers. The fixed parser uses a bounded 65-job sentinel for an excessive count. Other plans must have a complete body and no trailing tokens before validation. These parser rules are distinct from the validate API's domain checks.

  2. Work order. Execute jobs in input order, units in increasing order from 0. Call begin(job_index, descriptor) once before each job and end once after it. For every unit, compute its word, update job/lane/total statistics, read that lane's current progress register once, write (observed + stride) % modulus once, then call checkpoint(job, unit, lane, word, job_digest) once. Then transmit one certificate frame using device.certificate. There are no extra register reads or writes. A zero-unit job has begin/end only. Accesses cannot be collapsed across units, even when modulo arithmetic gives the same final value. Later jobs on a lane continue its actual register value.

  3. Device semantics. port(lane) returns a volatile-qualified register view. Its read/write members represent observable bus transactions, not ordinary cached storage. The fixed device immediately logs each transaction and changes its audit state. Each checkpoint actually latches the current register value, word and digest, refreshing its per-lane latch sequence and audit register. The bus and latch side effects are required even when the final numerical counter would be identical without them. This volatile interface is about observable accesses; it provides no atomicity or inter-thread synchronization. All arithmetic is bounded; use sufficient width before reducing modulo.

  4. Words. Let b=(seed + unit109 + lane13) % 65536. For operation 0 the word is ((b&255)*257 + (b>>8)) % 65536. For operation 1 it is the 16-bit left rotation of b XOR 42405 by unit%16 bits. For operation 2 it is (((b&255)<<8) | (b>>8)) XOR ((unit*17)&65535).

  5. Statistics. Independently accumulate each job and each lane in unit order. Empty statistics have all fields 0 except crc=65535. On each word, update units; digest=(digest131+word)%1000000007; minimum; maximum; parity XOR; population (number of set bits); runs (maximal runs of set bits in the 16-bit word); leading/trailing zero counts (16 for zero); byte_sum (sum of its two bytes); CRC16-CCITT (polynomial 0x1021, initial 0xffff, no reflection/xorout, feed low byte then high byte); changes (popcount of previous XOR current, except first); rises/falls/repeats relative to previous; first/last; weighted sum=(weighted + unitsword)%1000000007 using the new units; even/odd counts; and quartiles[word/16384]. span is maximum-minimum, or 0 for empty. Dominant quartile is the lowest bucket index tied for the largest count, including 0 for empty. Report jobs preserve input order and original lane. Unused array tails are unspecified. Total units counts every word; total digest starts 0 and updates (digest*137+word+lane)%1000000007 in global execution order.

  6. Raw stdout. The fixed public observer prints the actual bus/latch facts; its source defines record field order. Every observer record starts with kind and a global sequence number starting at 0. CONFIG carries lanes,modulus; BEGIN carries job,lane,units; READ carries lane,value,read_count,audit; WRITE carries lane,old,new,write_count,audit; CHECKPOINT carries job,unit,lane,value,word,job_digest,latch_count,audit; END carries job,lane,units,job_digest; BUS carries lane,value,reads,writes,latches,audit; IDLE carries 1 when no job is active. BUS is in lane order, followed by IDLE. Each lane's audit starts 0; READ updates (audit17+value+1)%1000000007; WRITE updates (audit19+new+3)%1000000007; CHECKPOINT updates (audit*23+value+word+job_digest)%1000000007. Counters start at 0. After the device records fixed main prints RESULT status; JOB index lane and its statistics; LANE lane and statistics; TOTAL units digest. Statistics field order is span,dominant_quartile,units,digest,minimum,maximum,parity, population,runs,leading,trailing,byte_sum,crc,changes,rises,falls,repeats, first,last,weighted,even,odd,quartiles[0..3]. Decimal tokens allow optional leading + and arbitrary leading zeros; separators are classic ASCII stream whitespace. Exactly the documented records in order are required. Arbitrary stderr bytes are permitted, and no stderr content or size defines success.

  7. Every completed unit transmits its checkpoint certificate after checkpoint and before the next unit/end. Payload bytes are version=1,lane,job_index,unit, word little-endian uint16,digest little-endian uint32,CRC little-endian uint16. CRC uses the same CCITT algorithm from clause 5 over the first ten bytes. Frame boundaries are 126; payload bytes equal to 125 or 126 are escaped as 125 followed by byte XOR 32. There are no other bytes. The fixed receiver consumes every byte and computes audit=(audit*29+byte)%1000000007 starting 0. It reconstructs bounded 12-byte payloads, checks version/position/domain/CRC, and counts accepted/rejected frames and total bytes. A successful certificate really changes this receive state; printing a certificate does not transmit it. The CERTIFICATE observer record has sequence,frame_size,all raw frame bytes, decoded job,unit,lane,word,digest,total_received_bytes,accepted,rejected,audit. Its position in the stream is immediately after the corresponding CHECKPOINT.