100 tasks from the HWE arm-linux code-gen pool (outside the lk/man/pth range given to batch 22), each with at least one independent contract-edge defect and plain public docs. Claude reviewed 100/100 USABLE against current digests; no ID or source overlap with main or batch 22. Difficulty is unmeasured. progress.md records the wrap-up: all Codex sessions and Qwen schedulers stopped for the user's rollout, Qwen results so far (57 HARD of 373), and what is left on each batch branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7.6 KiB
Durable delivery model
R01. This is a deterministic, single-threaded C++17 software model. A Domain owns all its state, starts empty with next sequence 1, and does not share state with other Domain objects. It uses no wall clock, network, DDS runtime or hardware. Methods and the observer write no diagnostics to stderr and no unsolicited stdout.
R02. Identifiers for writers and readers are independent integer namespaces 1 through 32. Topics are integers 1 through 8. Durability is 0 (VOLATILE) or 1 (TRANSIENT_LOCAL). Writer depth is 1 through 16; reader capacity is 1 through 64. Payloads are signed integers -1000000 through 1000000. Creation arguments and the non-identifier arguments of an existing-object operation return -22 when outside their stated ranges. Operations requiring an existing writer or reader return -2 when that identifier has no live object, including identifiers outside 1 through 32. An already occupied identifier returns -17. A successful operation returns 0 unless a different return is stated below.
R03. The supported callable API consists of the Domain methods in durable.hpp and the Sample, WriterInfo, ReaderInfo and Totals value types; Histories and other helper types are implementation details. Each method first checks whether its writer or reader exists when it takes an existing identifier, then validates its other arguments in declaration order. Creation validates identifier, topic, durability, then depth or capacity before checking occupancy. On a negative result, all domain state and all caller-provided output arguments remain unchanged. Input vectors are never modified. Valid calls may allocate ordinary C++ containers; allocation failure is outside this model.
R04. open_writer(id, topic, durability, depth) creates a writer. The generation for that writer identifier is one greater than the last successful creation in this domain, starting at 1. Failed creations do not advance it. A new writer has zero published count and empty history. close_writer(id) removes the writer and its retained history. Reader queues keep samples already delivered to them. A later writer with the same identifier is a new generation.
R05. publish(id, payload, sequence) assigns the current domain sequence to a Sample, increases the next sequence by one, increases that writer's published count, and returns the assigned sequence through the output argument. The sample records the writer identifier, writer generation, topic and payload. Sequence numbers are shared by all writers in a domain. Sample.replayed is 0 for a live delivery and 1 for a history delivery.
R06. A TRANSIENT_LOCAL writer retains its most recent depth samples in increasing sequence order. A VOLATILE writer retains no history. set_depth(id, depth) changes the depth and removes the oldest excess retained samples immediately; growing a depth does not recover removed samples. It does not publish or change counters. history(id, out) replaces out with a copy of that writer's retained samples, whose replayed fields are 0.
R07. open_reader(id, topic, durability, capacity) creates a reader with zero taken, lost and received counters. A TRANSIENT_LOCAL reader receives a copy of the histories of existing TRANSIENT_LOCAL writers on that topic, merged in increasing domain sequence order, with replayed=1. A VOLATILE reader starts empty. After opening, every reader receives all new publications on its topic regardless of either durability. A reader is independent of other readers and of later changes to writer histories.
R08. Each delivered sample increments received. When a delivery would exceed capacity, the oldest queued sample is discarded and lost increments. The queue retains the most recent capacity samples in sequence order. set_capacity(id, capacity) changes capacity and removes oldest excess queued samples, adding the number removed to lost. It neither creates deliveries nor changes taken or received.
R09. peek(id, out) replaces out with a copy of the entire queue and leaves the queue and counters unchanged. take(id, count, out) accepts count 0 through 64, replaces out with the first min(count, queued) samples, removes those samples and adds their number to taken. clear(id) discards the current queue, adds its size to lost and leaves received and taken unchanged. close_reader(id) removes that reader; reopening its identifier starts a new reader with counters and history delivery as described for open_reader.
R10. publish_many(id, payloads, sequences) accepts a vector of 0 through 16 payloads. It validates the size and then every payload before publishing any sample. On success it replaces sequences with all assigned sequences in vector order and has the same state effect as publishing each payload consecutively. An empty batch succeeds without advancing the sequence or changing counters.
R11. WriterInfo fields are id, generation, topic, durability, depth, published, retained. writer_info(id, out) returns those fields for a live writer. ReaderInfo fields are id, topic, durability, capacity, received, taken, lost, queued; reader_info(id, out) returns those fields for a live reader. No query consumes samples. writer_ids(out) and reader_ids(out) replace out with the respective live identifiers in ascending order.
R12. totals() returns writers, readers, retained, queued, next_sequence, counting live objects and their samples. reset() removes all writers, readers, retained histories, generations and counters and restores next sequence 1. Repeating reset on an empty domain has the same result. Destruction has no observable output.
R13. The supplied observer accepts one command per line using whitespace-separated decimal integers. Empty lines are ignored. Inputs consist of commands in observer.cpp with the shown arities, representable as their declared C++ types; the tested method parameters may be outside their valid domain. U selects domain 0 or 1 and prints U followed by the selection. All other commands operate on the selected domain. Each output line ends with one LF byte. EOF, including empty stdin, exits 0 with no extra output. Command syntax outside this grammar is outside the supported inputs. The observer only reports raw return values, output arguments and input vectors, without deciding correctness.
R14. W id topic dur depth, X id, D id depth, P id payload nonce and B id nonce count payload... call open_writer, close_writer, set_depth, publish and publish_many. O id topic dur cap, C id, L id cap and Z id call open_reader, close_reader, set_capacity and clear. These operations print R result, except P prints P result sequence and B prints B result length sequences... input_length input_payloads.... B count is a nonnegative number of following payload tokens; counts above 16 are passed to publish_many for its size check. The nonce initializes publish output; publish_many output starts as [nonce, nonce].
R15. H id nonce, K id nonce and T id count nonce call history, peek and take. Their output vector starts with Sample{nonce, nonce, nonce, nonce, nonce, nonce}; they print their command letter, result, vector length, then six decimal fields per sample in order sequence, writer, generation, topic, payload, replayed. I id nonce and J id nonce call writer_info and reader_info with every field initialized to nonce and print their letter, result and the fields in R11 order. A and E call writer_ids and reader_ids with initial vector [91,92], printing letter, length and identifiers. Q calls totals, printing Q and its five fields in R12 order. N calls reset and prints R 0. Observer source is public and is compiled unchanged during evaluation. Only declared candidate files are submitted; conform to all clauses of this document.