amos ac3d3db9e0 Add 13 more Qwen-measured tasks from batches 26 and 27 (8 HARD, 5 MEDIUM)
Route D (real fixes in embedded open-source projects) keeps producing the
hard tasks: of 64 measured so far, 15 are HARD and 4 MEDIUM, mostly because
Qwen exhausts its context in the larger real workspaces. This adds
CANopen SRDO and ASCII timing, FreeRTOS DHCP, lwIP MQTT fragments, printf
extremal exponents, Zephyr packet buffers and heatshrink (HARD), plus
lwjson, RFM9x, SFUD and nanopb proto3 (MEDIUM).

From batch 27 (spec-dense implementation tasks) come one HARD and one
MEDIUM; that batch is winding down after 30 tasks gave 1 HARD and 3 MEDIUM.

Each task comes from the commit Qwen measured, its digest matches, and it
is still present at the batch branch head. Agent timeouts stay excluded:
a pyserial attempt timed out on Qwen's own blocking read yet graded PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:29:21 +08:00

24 lines
3.0 KiB
Markdown

# Packet buffer behavior
The interface and packet layout follow the supplied MPSC packet-buffer headers. The host kernel supplies the single-thread execution primitives used by this reproduction.
R01. A packet occupies consecutive 32-bit words. The application supplies its length through `get_wlen`. Packet lengths in this workspace are positive and do not exceed 64 words. The first two bits of the first word belong to the buffer; the application may populate the remaining bits and the payload after allocation.
R02. Successful allocation reserves space without making a packet readable. Commit publishes the allocated packet. Several allocations may be outstanding; this workspace commits them in reservation order. The consumer receives committed packets in order, with unchanged application data.
R03. Claim returns the first pending packet, or null when none is available. A claimed packet remains owned by the consumer until free. The producer may omit that packet while finding space but may neither drop it nor change its application data.
R04. Without overwrite mode, an allocation with `K_NO_WAIT` returns null when there is insufficient consecutive space. A request larger than the buffer returns null. Existing packets remain readable after a failed allocation.
R05. In overwrite mode, the oldest unclaimed packets may be dropped to obtain consecutive space; the drop callback receives each dropped packet in order with its application data. A claimed packet cannot be used as free storage. An allocation that cannot obtain enough space returns null and lets the consumer continue.
R06. Packets do not cross the end of the backing array. Any unused tail is skipped when the next packet is placed at the beginning. Skipped storage is not delivered as an application packet. This applies to power-of-two and other buffer sizes.
R07. Free releases a claimed packet for reuse. After all committed packets are consumed and freed, subsequent producers and consumers can continue using the buffer. A failed allocation must not prevent later recovery.
R08. Thread-context allocation with a nonzero timeout can wait for space. A consumer action which releases storage permits the waiting producer to retry; allocation succeeds if enough consecutive storage becomes available within that wait. Consuming only skipped storage may leave no packet to return.
R09. In the host port, `K_NO_WAIT` does not dispatch another action. A semaphore take consumes an existing token if present. With no token and a nonzero timeout it dispatches the next application-scheduled action, then consumes an available token or returns `-EAGAIN` at the virtual deadline. Give adds one token up to the semaphore limit. Applications may schedule one claim, or one claim followed by free. No rule requires a particular number of lock or semaphore calls.
R10. `mpsc_pbuf_is_pending` reports whether messages remain pending. Empty checks in this workspace are made after all skip storage has been consumed by claim. No genuine parallel threads, wall-clock timing, interrupt devices, or external services are required.