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

11 KiB

runtime-zephyr-packet-buffer-progress

Identity and provenance

Route D, C, state-machine-timing; upstream https://github.com/zephyrproject-rtos/zephyr, split group zephyrproject-rtos/zephyr. Frozen base 398d9e3d49dabbcdddb4bda84e38cec824b5da6b. First upstream production fix 3e52109590cc6d3e226d30587bfabe120a4a4db8, second 8af60c6239da7334bd41f5668d93188a81f65b40. Apache-2.0, complete upstream LICENSE and original source copyright/SPDX retained. No root NOTICE exists in the frozen tree. No personal input or external service is involved.

Two independent defects are present in the same frozen implementation. A producer repeatedly revisits a consumer-owned packet and cannot return if the requested contiguous packet does not fit in the rest of the buffer. Separately, a consumer which consumes only tail padding can make storage reusable without waking an allocator. The first patch changes drop_item_locked; the second changes mpsc_pbuf_claim. The latter function in the frozen base is byte-for-byte identical to the same function in the second fix's parent. Gold applies the complete first production diff (six additions, one deletion) and all six added lines of the second; no intervening production changes are imported. The first-only source is byte-for-byte the first upstream fixed file. Both original patch texts and extraction evidence are retained in the author's key directory.

Public API reproduction is established before admission. For a 16-word overwrite buffer: allocate/commit a 12-word packet, claim it, then request 8 words without waiting. Base loops; first fix returns null with the held payload intact and recovers after free. For a normal 16-word buffer: produce/consume/free 12 words, arm an empty claim at the next blocking semaphore take, then request 13 words with a nonzero timeout. The second fix permits retry and success; base and first-only return null. Only public init/alloc/commit/claim/free and the public kernel semaphore boundary are used; the observer never writes internal indices, internal flags or internal packet header bits. Reproduction used a unique trace6 container, no network, UID 65534, and did not require threads or elapsed-time ordering. Raw proof: runs/20261102-D-oss-fix-26/zephyr-3e52109/public-api-proof.json.

Frozen and supplied files

Upstream frozen, byte-identical: template/lib/os/mpsc_pbuf.c, template/include/zephyr/sys/mpsc_pbuf.h, template/include/zephyr/sys/mpsc_packet.h, template/LICENSE.

Supplied host support: template/include/zephyr/kernel.h defines single-thread kernel types, locks and utility macros; template/host_port.c implements semaphore tokens and a bounded virtual wait callback. Neither implements packet allocation, skip, drop or reclamation. template/smoke.c is an ordinary three-word produce/consume path; template/Makefile builds it; template/README.md explains the scope; template/docs/packet-buffer.md restates public header behavior and defines the host scheduler. No build, history, issue identifier, fix comment or upstream regression test is supplied. The two upstream packet headers and entire 639-line algorithm are retained, including the put APIs, usage tracking, callbacks, allocation, dropping, skips, claim and free. The three upstream C/header files have 571 nonblank noncomment lines; all six public C/header files have 653 before later documentation-only changes. The template contains 10 files, each below 1 MiB.

Only lib/os/mpsc_pbuf.c is a candidate. Private check.py and harness.c are never public task material. The four support/ C/header files are byte-identical copies of the public headers and host port, because grading mounts only the declared candidate C file, not the rest of the public workspace. verify.py is copied unchanged from rollout/bos_verify.py.

Public contract and independent oracle

The oracle models a FIFO of application packets, outstanding reservations, and the consumer's lease, not buffer indices or internal bits. It derives expected packet contents from generated identifiers and word numbers. Whole-packet drop observations may reclaim only the oldest queued packets in overwrite mode during allocation, never a consumer lease. Those observations update the independent FIFO; the oracle then derives allocation success from remaining logical capacity and verifies every subsequent consume. No fixed number of drops is required. The tested consecutive layouts permit the requested packet after reclaiming enough capacity. No expected value comes from gold output, implementation hashes, lock counts or semaphore call counts.

The C observer reads operation inputs, calls the public APIs, and prints raw allocation returns, packet lengths/identifiers/payloads, free/commit availability, pending state and drop callback data. The parent checks its complete output. Scheduled empty claims are optional, allowing implementations that reclaim empty padding without a wait; scheduled actual claim/free actions update the same independent queue oracle. One alternative positive fixture signals after each skip release, rather than emitting exactly the upstream signal pattern. Another starts even-sized empty rings at their halfway point, allowing a legal different placement and drop strategy: in the 16-word 3/5/4/6-word scenario gold drops two oldest packets while this alternative drops one; both subsequent FIFOs pass the same oracle. Raw observations are in runs/20261102-D-oss-fix-26/zephyr-3e52109/different-drop-policy.json.

Check Public basis Scenarios and independent expectation
Word lengths and application payload template/docs/packet-buffer.md:5, mpsc_packet.h header ownership contract 1 through 64-word payloads, generated per-word data, all returned/drop/held payloads compared
Reservation and FIFO publication template/docs/packet-buffer.md:7 Two reservations, empty claim before commit, ordered commits and claims
Empty and ordinary claim template/docs/packet-buffer.md:9 Normal consume, repeated empty claim, claim/free before next produce
Held packet ownership template/docs/packet-buffer.md:9 Busy overwrite and overwrite-drop layouts preserve all held payload words
No-wait and oversized requests template/docs/packet-buffer.md:11 Full array plus failed one-word request; request exceeding size; old queue remains intact
Overwrite progress when held packet cannot be reclaimed template/docs/packet-buffer.md:13 Seven capacities; requested five words with only three words outside the lease returns null without a hang
Drop callback contents and FIFO order template/docs/packet-buffer.md:13 Exact-size full replacement, lease/wrap replacement, different legal drop counts, queue order and drop payloads
Tail skip and contiguous storage template/docs/packet-buffer.md:15 Normal wrap at seven capacities, long repeated variable-size use, no padding returned as a packet
Free and failed-operation recovery template/docs/packet-buffer.md:17 Failed busy allocation, free lease, empty claim then successful reuse
Storage released by empty consumer permits producer retry template/docs/packet-buffer.md:19 Seven capacities, producer's request exceeds unused tail and old head prefix, scheduled consumer returns null while release makes whole allocation possible
Storage released by actual consumer permits producer retry template/docs/packet-buffer.md:19 Full queue, one scheduled claim/free, producer allocates then remaining FIFO is consumed
Scheduler boundary and nonzero timeout template/docs/packet-buffer.md:21 Public semaphore wait chooses one consumer action; no fixed lock or semaphore count is asserted
Pending state and deterministic execution template/docs/packet-buffer.md:23 Pending after committed queue; false after final empty claim; virtual waits and fixed generated input

The 47 scenario processes cover seven capacities (including 63/64), non-power-of-two wrapping, both overwrite policies, pending reservations, consumer leases and two 96-packet streams. Per-process timeout is 3 seconds (enforced by a same-UID timeout subprocess, with a 6-second parent allowance, so capability-restricted root need not signal a different-UID child) for hang containment, not a behavioral real-time deadline. Build timeout is 20 seconds (same-UID timeout supervisor, 25-second parent allowance), full grading limit 90 seconds. No actual wall-clock scheduling, network or memory-corruption input is used.

Fixtures

Ten classes, five fresh Docker grades each: gold PASS; template FAIL (allocation loops); noop FAIL (all allocations return null); cheat FAIL (only ordinary smoke length supported); cheat_read_grader FAIL (boundary probe); only_alloc_progress FAIL (missing wake); only_claim_wake FAIL (loop remains); symptom_mask FAIL (rejects all overwrite allocations); valid_release_each_skip PASS; valid_rotated_origin PASS. The release variant is a different correct implementation: directly returns whether the claimed packet was revisited and signals whenever skip storage is released outside the critical section.

Isolation and evidence

check.py reads its harness and the frozen public support before executing any child, creates one mkdtemp, writes every scratch input and prepares every case/input/argv before its first compiler, and subsequently uses only subprocess stdin/stdout plus parent-memory expectations. It never reads, writes, stats, chmods or recursively deletes scratch after the compiler starts. Scratch belongs to the container and is reclaimed when that unique container is removed. The unchanged wrapper runs check as root but forces every child, including compiler, to UID/GID 65534 with no extra groups; its private-grader read probe is required. Candidate execution never occurs in the oracle process.

Environment is fixed offline Docker trace6: ccr-29eug8s3-pub.cnc.bj.baidubce.com/algo/bench-runtime@sha256:1519f8daa403998e5401eeb70b973e8aac8346e25a937033bc502dc5de1641a1.

This task has software fixture evidence only. No real Agent/model runs, difficulty estimate, hardware validation, actual multi-thread preemption, model training or production isolation claim is made. Whole-repository unittest is the root agent's checkpoint, not this author's test scope. Final calibration identities and receipt paths are recorded in the author's report.json and the batch review.

Final fixture calibration: runs/20261102-D-oss-fix-26/zephyr-3e52109/calibration-b4488744bb094e469010be430f9a5b73/receipt.json, all 50 trials matched expectations, status/task_verdict PASS, cleanup confirmed, current task digest 95f902ca59381d6c48f25509f73dd5c2e93dc4a509305f4cc42cdc7322bdc092. Gold and both legal variants passed five times each; all seven negative classes failed five times each. Earlier assembly and interrupted old-identity attempts are retained and explicitly excluded in the author report.