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

68 lines
1.5 KiB
C

#include "linkbuf.h"
const char *lb_status_name(lb_status status)
{
switch (status) {
case LB_OK:
return "OK";
case LB_TRUNCATED:
return "TRUNCATED";
case LB_MISSING:
return "MISSING";
case LB_NOTLINK:
return "NOTLINK";
case LB_NOMEM:
return "NOMEM";
default:
return "UNKNOWN";
}
}
unsigned long lb_target_checksum(const unsigned char *data, size_t length)
{
unsigned long state = 0;
for (size_t i = 0; i < length; i++) {
state = (state * 33 + data[i]) % 65521;
}
return state;
}
static void account_status(lb_report *report, lb_status status)
{
switch (status) {
case LB_OK:
report->ok_count++;
break;
case LB_TRUNCATED:
report->truncated_count++;
break;
case LB_MISSING:
report->missing_count++;
break;
case LB_NOTLINK:
report->notlink_count++;
break;
case LB_NOMEM:
report->nomem_count++;
break;
}
}
void lb_summarize(lb_report *report)
{
report->total_length = 0;
report->ok_count = 0;
report->truncated_count = 0;
report->missing_count = 0;
report->notlink_count = 0;
report->nomem_count = 0;
report->checksum = 0;
for (size_t i = 0; i < report->row_count; i++) {
const lb_row *row = &report->rows[i];
account_status(report, row->status);
report->total_length += row->length;
report->checksum = (report->checksum +
lb_target_checksum(row->target, row->length)) % 65521;
}
}