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

61 lines
2.4 KiB
C

#ifndef FLUSH_STORE_H
#define FLUSH_STORE_H
#include <stddef.h>
#include <stdint.h>
#define FS_BANKS 4u
#define FS_CAPACITY 256u
#define FS_CHUNK 17u
typedef struct {
void *context;
void (*write)(void *context, unsigned bank, size_t offset,
const uint8_t *bytes, size_t count);
void (*barrier)(void *context);
void (*announce)(void *context, unsigned bank, uint32_t revision,
size_t length, uint32_t checksum);
} FsPort;
typedef struct {
uint8_t data[FS_CAPACITY];
size_t length;
uint32_t revision;
uint32_t published_revision;
unsigned active;
unsigned dirty;
} FsBank;
typedef struct {
FsBank banks[FS_BANKS];
FsPort port;
uint32_t publishes;
uint32_t replacements;
uint32_t rejected;
} FlushStore;
enum { FS_OK = 0, FS_RANGE = -1, FS_STATE = -2, FS_PORT = -3 };
void fs_init(FlushStore *store, FsPort port);
int fs_open(FlushStore *store, unsigned bank, uint32_t revision);
int fs_close(FlushStore *store, unsigned bank);
int fs_clear(FlushStore *store, unsigned bank);
int fs_append(FlushStore *store, unsigned bank, const uint8_t *bytes, size_t count);
int fs_insert(FlushStore *store, unsigned bank, size_t at, const uint8_t *bytes, size_t count);
int fs_erase(FlushStore *store, unsigned bank, size_t at, size_t count);
int fs_patch(FlushStore *store, unsigned bank, size_t at, const uint8_t *bytes, size_t count);
int fs_fill(FlushStore *store, unsigned bank, size_t at, size_t count, uint8_t value);
int fs_xor(FlushStore *store, unsigned bank, size_t at, size_t count, uint8_t mask);
int fs_reverse(FlushStore *store, unsigned bank, size_t at, size_t count);
int fs_rotate(FlushStore *store, unsigned bank, size_t at, size_t count, size_t shift);
int fs_truncate(FlushStore *store, unsigned bank, size_t length);
int fs_clone(FlushStore *store, unsigned source, unsigned target, uint32_t revision);
int fs_copy(FlushStore *store, unsigned source, size_t from,
unsigned target, size_t to, size_t count);
int fs_publish(FlushStore *store, unsigned bank);
int fs_replace_publish(FlushStore *store, unsigned bank, uint32_t revision,
const uint8_t *bytes, size_t count);
int fs_read(const FlushStore *store, unsigned bank, size_t at, uint8_t *value);
size_t fs_length(const FlushStore *store, unsigned bank);
uint32_t fs_checksum(const uint8_t *bytes, size_t count);
#endif