From the 101 lk/man/pth code-gen sources: 63 tasks (C11 36, C++17 27, 11 canonical families), 38 skipped for scope or duplication. Each task has at least one independent contract-edge defect, boundary types rotate, and public docs state trap clauses as plain contract prose. Claude reviewed 63/63 USABLE against current digests. Difficulty is unmeasured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
1.8 KiB
C
72 lines
1.8 KiB
C
#ifndef VECTOR_H
|
|
#define VECTOR_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <sys/types.h>
|
|
|
|
#define VT_SEGMENTS 12
|
|
#define VT_SEGMENT_BYTES 256
|
|
#define VT_TOTAL_BYTES 3072
|
|
#define VT_WINDOW 4
|
|
#define VT_SCRIPT 64
|
|
#define VT_LOG_BYTES 65536
|
|
|
|
struct vt_span {
|
|
const unsigned char *data;
|
|
size_t length;
|
|
};
|
|
|
|
struct vt_cursor {
|
|
size_t index;
|
|
size_t offset;
|
|
size_t done;
|
|
size_t total;
|
|
};
|
|
|
|
struct vt_job {
|
|
struct vt_span spans[VT_SEGMENTS];
|
|
size_t count;
|
|
struct vt_cursor cursor;
|
|
uint64_t calls;
|
|
int last_error;
|
|
int ready;
|
|
};
|
|
|
|
struct vt_book {
|
|
uint64_t bytes;
|
|
uint64_t requests;
|
|
uint64_t completed;
|
|
uint64_t failures;
|
|
uint64_t pauses;
|
|
};
|
|
|
|
typedef ssize_t (*vt_sender)(void *, const struct vt_span *, size_t);
|
|
|
|
struct vt_device {
|
|
long script[VT_SCRIPT];
|
|
size_t script_count;
|
|
size_t script_position;
|
|
unsigned char bytes[VT_LOG_BYTES];
|
|
size_t length;
|
|
uint64_t calls;
|
|
FILE *observations;
|
|
};
|
|
|
|
void vt_cursor_reset(struct vt_cursor *, const struct vt_span *, size_t);
|
|
size_t vt_cursor_window(const struct vt_job *, size_t, size_t, struct vt_span *);
|
|
void vt_cursor_advance(struct vt_job *, size_t);
|
|
int vt_job_open(struct vt_job *, const struct vt_span *, size_t);
|
|
void vt_book_reset(struct vt_book *);
|
|
ssize_t vt_book_finish(struct vt_book *, size_t, int, int, int);
|
|
ssize_t vt_submit(struct vt_job *, struct vt_book *, size_t, size_t, vt_sender, void *);
|
|
void vt_device_reset(struct vt_device *, FILE *);
|
|
int vt_device_script(struct vt_device *, const long *, size_t);
|
|
ssize_t vt_device_send(void *, const struct vt_span *, size_t);
|
|
void vt_print_state(FILE *, const struct vt_job *, const struct vt_book *, const struct vt_device *);
|
|
void vt_print_hex(FILE *, const unsigned char *, size_t);
|
|
int vt_console(FILE *, FILE *);
|
|
|
|
#endif
|