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>
65 lines
2.0 KiB
C
65 lines
2.0 KiB
C
#ifndef CODE_WINDOW_H
|
|
#define CODE_WINDOW_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#define CW_SLOTS 4u
|
|
#define CW_CAPACITY 12u
|
|
#define CW_OK 0
|
|
#define CW_CONFLICT (-1)
|
|
#define CW_INACTIVE (-2)
|
|
#define CW_PROGRAM (-3)
|
|
#define CW_SYNTAX (-4)
|
|
#define CW_EXECUTION (-5)
|
|
#define CW_ADAPTER (-6)
|
|
typedef struct {
|
|
uint16_t data[CW_CAPACITY];
|
|
uint16_t execution[CW_CAPACITY];
|
|
unsigned active;
|
|
unsigned length;
|
|
uint64_t generation;
|
|
} CodeSlot;
|
|
typedef struct {
|
|
uint64_t serial;
|
|
uint64_t installs;
|
|
uint64_t patches;
|
|
uint64_t drops;
|
|
uint64_t executions;
|
|
uint64_t writes;
|
|
uint64_t sync_calls;
|
|
uint64_t sync_words;
|
|
uint64_t rejected;
|
|
} CodeCounters;
|
|
typedef struct {
|
|
CodeSlot slots[CW_SLOTS];
|
|
CodeCounters counts;
|
|
} CodeWorkbench;
|
|
typedef struct {
|
|
int rc;
|
|
uint32_t value;
|
|
unsigned retired;
|
|
} CodeResult;
|
|
typedef enum {
|
|
CW_INSTALL = 0,
|
|
CW_PATCH = 1,
|
|
CW_DROP = 2
|
|
} Publication;
|
|
void store_reset(CodeWorkbench *work);
|
|
int store_write(CodeWorkbench *work, unsigned slot, unsigned first,
|
|
const uint16_t *words, unsigned count);
|
|
int store_sync(CodeWorkbench *work, unsigned slot, unsigned first,
|
|
unsigned end);
|
|
int store_publish(CodeWorkbench *work, unsigned slot, unsigned length,
|
|
Publication kind);
|
|
int instruction_valid(uint16_t word, int last);
|
|
int program_valid(const uint16_t *words, unsigned count);
|
|
CodeResult interpret(const uint16_t *words, unsigned count, uint32_t input);
|
|
CodeResult window_install(CodeWorkbench *work, unsigned slot,
|
|
const uint16_t *words, unsigned count);
|
|
CodeResult window_patch(CodeWorkbench *work, unsigned slot, uint64_t expected,
|
|
unsigned first, const uint16_t *words, unsigned count);
|
|
CodeResult window_drop(CodeWorkbench *work, unsigned slot, uint64_t expected);
|
|
CodeResult window_execute(CodeWorkbench *work, unsigned slot, uint32_t input);
|
|
void observe_result(uint64_t sequence, CodeResult result);
|
|
void observe_state(uint64_t sequence, const CodeWorkbench *work);
|
|
#endif
|