Repository navigation
Make service-request scheduler tests deterministic - #1170
Draft
thehobbit85 wants to merge 1 commit into
Draft
thehobbit85 wants to merge 1 commit into
thehobbit85 wants to merge 1 commit into
Conversation
thehobbit85
force-pushed
the
codex/deterministic-service-request-test
branch
from
November 4, 2026 06:26
5e7e409 to
3b4fcab
Compare
4 tasks done
thehobbit85
force-pushed
the
codex/deterministic-service-request-test
branch
from
November 4, 2026 17:48
3b4fcab to
7229bff
Compare
Model only the fixture clock and request completion while preserving real scheduler handoff assertions and a separate bounded-deadline case. Production scheduling and deadlines remain unchanged.
thehobbit85
force-pushed
the
codex/deterministic-service-request-test
branch
from
November 5, 2026 06:12
7229bff to
9424e5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main still uses wall-clock dispatch to assert flag ordering in the service-request fixture. This patch models fixture time/completion while retaining real scheduler handoff/native-wait assertions and the separate bounded-deadline exception. Production timing and retries remain unchanged.
Current rebase — 2026-11-05
Rebased
7229bff97db66ebc4dbb2bc16cc153932769cba8onto fixed current mainf8a5618d5f505a4c0a0bcac7c413872d3a53c009, producing9424e5bbabcb3ee37c1556a92ee0d386e006de1aon the same existing canonical and PR branches. Main is an ancestor. This replays the existing feature commit; no new squash or unrelated prerequisite is included.Rebase was clean and patch-equivalent. The fixture and production scheduler source blobs match the prior tested feature. This PR remains a draft.
Fresh validation and limits
Fresh normal and TSan preemption targets passed both scheduler modes, including delayed starters and the separate deadline case. All 21 documentation/current-ABI tests passed. Scoped LLVM 23.1.4 C lint matches the current baseline with zero new or stale file/check pairs. No assertions, deadlines or timeouts were weakened.
The workflow-pinned Python ratchet (Ruff 0.17.2 / Pyright 1.1.414) passes: 389 findings against 389 recorded, zero new or stale findings. The former shared-main B023 issue is fixed on this base; references to it below are historical. No baseline was loosened. Generated documentation and
git diff --checkwere reviewed. New remote CI is pending publication and is not claimed green.This is synthetic fixture/reference coverage only; no production scheduler behavior, gameplay, devices or performance claim is made. Historical negative-control and repeated-run evidence below retains its original tested revisions.
Historical proposal, validation and original commit context
The description below predates this rebase. Its commit identities, timing tables, tool environments and validation limits remain historical; they are not a current all-pass or fresh gameplay claim.
Main still asserts flag ordering using wall-clock dispatch in the service-request fixture, although production’s bounded deadline explicitly permits the opposite ordering after a long host deschedule. This PR models only fixture time/request completion, retains the real scheduler and handoff/native-wait assertions, checks 20 ms delayed starters in both modes, and separately tests the 5 ms deadline. No production timing, timeout or retry policy changes.
Current refresh — 2026-11-04
Candidate
7229bff97db66ebc4dbb2bc16cc153932769cba8is exactly one commit directly atop fresh main975bb4c14456d145eb3d969814534eecdd996ce9. The canonical branch and existing PR destination are unchanged. The published head was3b4fcabb29a610ffc14cc9ea8ebb1626a2cc9433; preserved local pre-pass candidate was3b4fcabb29a610ffc14cc9ea8ebb1626a2cc9433. Rebase range-diff is patch-equivalent, and the pre-squash treec4caf023c29a59fc0a30bc5f5dfbbceaaf427dccequals final treec4caf023c29a59fc0a30bc5f5dfbbceaaf427dcc. No unrelated prerequisite or feature was dropped. Original author credit is preserved.Validation and limits
Fresh native and ThreadSanitizer
preempttargets pass both modes on this exact candidate, including delayed starters and the separate deadline case. 21 documentation/current-ABI tests pass. LLVM 23.1.4 focused clang-tidy matches the fixture baseline with zero new or stale file/check pairs. This is not a full current lint pass. The first sandbox test attempt stopped on ignored-header generation; the completed run used normal authorized worktree access.This remains a draft. The remaining diff changes only the scheduler fixture and its reference entry. Gameplay, devices and production scheduler behavior are outside this test-only change. Historical four negative controls and prior full lint results below retain their original tested revisions; they are not newly repeated.
Shared Python lint is blocked by unchanged main
dm/games/settings.py:115Ruff B023 (390 findings versus 389 baseline), confirmed on the pinned base. No unrelated repair or baseline alteration is included. Generated documentation, final main diff andgit diff --checkwere reviewed for PR #895 placement/artifact rules; no planning journals or run-specific evidence were added to repository documentation. Remote CI for this new unpublished SHA has not run; previous CI results are historical.Historical context and evidence
The description below predates this refresh. Its revision names, validation runs, measurements and limitations are retained as historical evidence rather than current all-pass claims.
The sanitizer job on #1155 failed in
t_preempt's service-request case, outside that PR's NARC changes. The fixture required the starter to publish a flag before a real service timing window expired. Production explicitly allows the worker to finish first after a sufficiently long host deschedule, so the test was asserting a scheduling guarantee the host does not make.Drive the service clock and request completion explicitly inside the fixture while retaining the real thread SVCs, handoff/native-wait state and existing flag-order assertions. Cover 20 ms starter delays in both preemption modes, and separately advance the clock to the 5 ms start deadline to verify the bounded exception. Production scheduler code and timing constants are unchanged.
Current head
3b4fcabb29a610ffc14cc9ea8ebb1626a2cc9433contains only the test and its existing reference documentation, on maina41b80545c82c5fff3dfeaba41bd5e2e6dcb4290. Main'sa27d684bsupplies the shared allocation/filesystem lint repair, so the earlier carried #1164 prerequisite has been removed. The scheduler patch is unchanged by the rebase. This also resolves the old head's lint failure when its 261-finding baseline was compared against main's newly tightened 241-finding baseline.Validation on Apple Silicon, macOS 26.6 (25G5028f), Xcode 27.2 (27B52), Apple clang 21.0.0 from the Swift 6.4.1 toolchain:
make -C dm/host/tests GAME=010015100B514000 preemptruns pass both modes, including delayed starters and the explicit deadline case. TSan usesSAN='-g -fsanitize=thread -fno-inline'and a separate build directory.git diff --checkpasses.The final diff changes only a synthetic scheduler fixture and its reference entry. No production scheduler, game-profile or renderer change remains, so gameplay is outside this change's validation scope. No agent plans or execution journals are included. Fresh remote CI is pending.
Historical original commit context and preserved corrective messages
These are the original published and preserved local messages before this squash. They explain historical intent and limitations; any validation named in them belongs to the original commit, not the new candidate. Repeated equivalent messages are shown once with their original identities.
seedds seedds@gmail.com —
3b4fcabb29a610ffc14cc9ea8ebb1626a2cc9433(published),3b4fcabb29a610ffc14cc9ea8ebb1626a2cc9433(preserved unpublished/local)Published commit context before this rebase
Historical message from
7229bff97db66ebc4dbb2bc16cc153932769cba8; any validation statements belong to that revision.