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>
72 lines
1.8 KiB
C
72 lines
1.8 KiB
C
#ifndef DISPATCH_H
|
|
#define DISPATCH_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#define LANE_COUNT 4
|
|
#define QUEUE_CAPACITY 8
|
|
#define COMMAND_ARGS 5
|
|
#define DIGEST_MOD UINT64_C(1000000007)
|
|
typedef struct {
|
|
int id;
|
|
int value;
|
|
int lease;
|
|
} Message;
|
|
typedef struct {
|
|
Message slots[QUEUE_CAPACITY];
|
|
unsigned head;
|
|
unsigned count;
|
|
} Queue;
|
|
typedef struct {
|
|
int period;
|
|
uint64_t attempts;
|
|
uint64_t accepted;
|
|
uint64_t rejected;
|
|
int64_t sum;
|
|
uint64_t digest;
|
|
int last_id;
|
|
int last_value;
|
|
} Receiver;
|
|
typedef struct {
|
|
int enabled;
|
|
int credit;
|
|
Queue queue;
|
|
uint64_t pulses;
|
|
uint64_t expired;
|
|
uint64_t delivered;
|
|
uint64_t refused;
|
|
uint64_t cancelled;
|
|
uint64_t moved_in;
|
|
uint64_t moved_out;
|
|
} Lane;
|
|
typedef struct {
|
|
int mode;
|
|
unsigned cursor;
|
|
uint64_t ticks;
|
|
uint64_t published;
|
|
uint64_t blocked;
|
|
uint64_t invalid;
|
|
Lane lanes[LANE_COUNT];
|
|
Receiver receivers[LANE_COUNT];
|
|
} Service;
|
|
typedef struct {
|
|
char op;
|
|
unsigned argc;
|
|
int arg[COMMAND_ARGS];
|
|
} Command;
|
|
void queue_init(Queue *queue);
|
|
int queue_push(Queue *queue, Message message);
|
|
const Message *queue_front(const Queue *queue);
|
|
const Message *queue_at(const Queue *queue, unsigned ordinal);
|
|
int queue_pop(Queue *queue);
|
|
unsigned queue_age(Queue *queue);
|
|
unsigned queue_clear(Queue *queue);
|
|
unsigned queue_remove_id(Queue *queue, int id);
|
|
int queue_transfer(Queue *source, Queue *target, unsigned count);
|
|
void port_reset(Receiver *receiver);
|
|
void port_configure(Receiver *receiver, int period);
|
|
int port_offer(Receiver *receiver, const Message *message);
|
|
void service_init(Service *service);
|
|
int service_command(Service *service, const Command *command);
|
|
int command_parse(const char *line, Command *command);
|
|
#endif
|