Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Issue 1122 Wall-Readback Concurrency Addendum

Date: 2026-08-12

Issue: #1122. Requirement: DSL-437. Related: #861.

## Gap And Existing Surface

The DSL-437 wall-driver regression assumed that a real-time clock remained at
absolute tick zero after `RuntimeManager.apply()` started its driver. Under
contention, the driver may validly advance before a reader acquires the shared
participant-execution lock. The incumbent lock, time-runtime readback, snapshot,
and wall-driver surfaces are sufficient; this is a test-oracle defect, not a
new runtime semantic or public contract.

## Decision

A blocked-read concurrency check binds its result to the full predecessor
`TimeCoordinateModel` captured for that critical section. The test holds the
runtime read inside the shared lock, captures the predecessor snapshot, waits
longer than one wall tick, and proves that the manager snapshot remains
unchanged. After release, the returned segment, tick, and microstep must equal
the captured predecessor coordinate.

This evidence does not assert absolute tick zero. A valid wall advance before
the blocked read is outside the critical section being tested and cannot make
the result fail. An advance during the read still changes the snapshot or
returned coordinate and fails deterministically.

## Alternatives And Verification

Retaining `tick == 0` was rejected because scheduler contention can invalidate
that unrelated timing assumption. Sleeping less or increasing the tick period
only changes the race probability. Injecting a private test clock was rejected
because the existing predecessor snapshot is the canonical shared-time state
cut and no runtime hook is required.

Verification runs the focused blocked-read test repeatedly under CPython 3.14
free-threaded contention, the surrounding DSL-437 wall-driver tests, Ruff, and
the DSL-437 requirement and repository policy gates.
5 changes: 4 additions & 1 deletion docs/requirements/DSL-437/requirement.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: FUNCTIONAL
priority: MUST
wave: 1
created_at: 2026-07-24T04:32:00.397864Z
updated_at: 2026-07-24T14:02:11.974014Z
updated_at: 2026-08-12T00:00:00.000000Z
---

# DSL-437 — Benign participant activity and runtime execution semantics
Expand All @@ -22,6 +22,9 @@ Ordinary user and automation activity improves range realism, but benign simulat
## Traceability

- DOCUMENTS → GITHUB_ISSUE `861` (DSL-437 — Deterministic live activity policy and target bindings)
- DOCUMENTS → GITHUB_ISSUE `1122` (Predecessor-bound wall-readback concurrency regression)
- DOCUMENTS → DOCUMENTATION `docs/decisions/issue-1122-dsl-437-wall-readback-concurrency-addendum.md` (Predecessor-bound wall-readback concurrency evidence)
- TESTS → TEST `implementations/python/tests/test_dsl_437_benign_participant_execution.py` (Native participant scheduling, wall-paced advancement, and predecessor-bound readback)
- CONSTRAINS → GITHUB_ISSUE `117` (Joint time semantics and language/runtime surfaces)
- CONSTRAINS → GITHUB_ISSUE `118` (Time model contracts, conformance, and provenance)
- CONSTRAINS → ADR `ADR-022` (Participant Behavior and Interaction Semantics)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,8 @@ def read_state() -> None:
reader.start()
assert time_runtime.read_entered.wait(timeout=1.0)
predecessor = manager.snapshot
assert predecessor.time_model_state is not None
predecessor_coordinate = predecessor.time_model_state.clocks[policy.clock_address].coordinate
time.sleep(0.1)

assert manager.snapshot == predecessor
Expand All @@ -2010,7 +2012,7 @@ def read_state() -> None:
assert not isinstance(outcome[0], Exception)
state = outcome[0]
assert isinstance(state, TimeRuntimeStateModel)
assert state.clocks[policy.clock_address].coordinate.tick == 0
assert state.clocks[policy.clock_address].coordinate == predecessor_coordinate
assert manager.destroy().success


Expand Down