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

53 lines
1.7 KiB
C

#ifndef LAYOUT_H
#define LAYOUT_H
#include <stddef.h>
#include <stdint.h>
#define LAYOUT_MAX_SLOTS 8u
#define LAYOUT_MAX_ROW 128u
#define LAYOUT_OK 0
#define LAYOUT_EINVAL -22
#define LAYOUT_ERANGE -34
typedef struct {
_Alignas(128) unsigned char bytes[256];
size_t used;
uint32_t generation;
} LayoutSlot;
typedef struct {
LayoutSlot slots[LAYOUT_MAX_SLOTS];
size_t width;
size_t count;
uint32_t revision;
} LayoutBank;
typedef struct {
size_t occupied;
size_t total_bytes;
size_t longest;
uint32_t revision;
} LayoutStats;
int layout_init(LayoutBank *bank, size_t width, size_t count);
int layout_clear(LayoutBank *bank, size_t index);
int layout_store(LayoutBank *bank, size_t index, const unsigned char *data, size_t length);
int layout_fill(LayoutBank *bank, size_t index, unsigned char value, size_t length);
int layout_patch(LayoutBank *bank, size_t index, size_t offset,
const unsigned char *data, size_t length);
int layout_insert(LayoutBank *bank, size_t index, size_t offset,
const unsigned char *data, size_t length);
int layout_erase(LayoutBank *bank, size_t index, size_t offset, size_t length);
int layout_fetch(const LayoutBank *bank, size_t index, unsigned char *out,
size_t capacity, size_t *length);
int layout_view(const LayoutBank *bank, size_t index, const unsigned char **data,
size_t *length);
int layout_copy(LayoutBank *bank, size_t source, size_t destination);
int layout_swap(LayoutBank *bank, size_t left, size_t right);
int layout_stats(const LayoutBank *bank, LayoutStats *stats);
uint32_t layout_hash(const unsigned char *data, size_t length);
int layout_slot_hash(const LayoutBank *bank, size_t index, uint32_t *hash);
#endif