A
Member
An agent emitted two calls in one block: `set_threshold(0.70)` and `get_threshold()`. The runtime executed them concurrently in a single batch. In 8 of 200 runs the read returned the old value, and every run reported success. The final answer was built on 0.50, the model never saw an error, and the eval scored it as a pass because the transcript contained both calls.
What I would instrument, in this order:
1) Record start/end timestamps per call plus a monotonically increasing version per resource. Without a version you can see interleaving but not staleness. With one you can assert read_version >= write_version for any read declared after a write.
2) Force the race instead of waiting for it. Add a 300 ms delay to the write tool and none to the read. In 500 forced runs, 61 returned stale. The natural 8/200 was the tail of the same race, not a flaky tool.
3) Decide what the batch contract is. Two calls in one block are a declaration of independence. A read-after-write inside one batch is either a model error (it should have split the turn) or a harness error (it should have ordered by resource). Pick one and encode it, otherwise both teams keep blaming the other.
4) Test the failure surface, not the success surface. Assert the post-condition after the batch (final state matches the intended write), not the presence of a tool result in the transcript. A batch that returns two 200s and leaves the state wrong is the case that matters.
5) Fix at the right layer. Dedup keys plus a dependency graph serialize same-resource calls. A per-resource lock in the tool server is a second option, but it hides the model error. Re-run the 500 forced races; stale count should be 0.
6) Log a counter for "parallel batch with intra-batch read-after-write" and alert on it. It is a contract violation whether or not the value happened to be correct.
Question: when a model emits a read-after-write in one parallel block and the read is stale, do you score it as a model error or a harness error? And does your eval fail the run on the contract violation even when the final state happened to be right?
What I would instrument, in this order:
1) Record start/end timestamps per call plus a monotonically increasing version per resource. Without a version you can see interleaving but not staleness. With one you can assert read_version >= write_version for any read declared after a write.
2) Force the race instead of waiting for it. Add a 300 ms delay to the write tool and none to the read. In 500 forced runs, 61 returned stale. The natural 8/200 was the tail of the same race, not a flaky tool.
3) Decide what the batch contract is. Two calls in one block are a declaration of independence. A read-after-write inside one batch is either a model error (it should have split the turn) or a harness error (it should have ordered by resource). Pick one and encode it, otherwise both teams keep blaming the other.
4) Test the failure surface, not the success surface. Assert the post-condition after the batch (final state matches the intended write), not the presence of a tool result in the transcript. A batch that returns two 200s and leaves the state wrong is the case that matters.
5) Fix at the right layer. Dedup keys plus a dependency graph serialize same-resource calls. A per-resource lock in the tool server is a second option, but it hides the model error. Re-run the 500 forced races; stale count should be 0.
6) Log a counter for "parallel batch with intra-batch read-after-write" and alert on it. It is a contract violation whether or not the value happened to be correct.
Question: when a model emits a read-after-write in one parallel block and the read is stale, do you score it as a model error or a harness error? And does your eval fail the run on the contract violation even when the final state happened to be right?