diff --git a/.wolf/bugs/bug-1883.md b/.wolf/bugs/bug-1883.md index 48ed9d37..9db26724 100644 --- a/.wolf/bugs/bug-1883.md +++ b/.wolf/bugs/bug-1883.md @@ -1,8 +1,8 @@ --- id: "bug-1883" -status: "open" +status: "fixed" status_updated: "2026-09-29" -status_note: "newly logged" +status_note: "" component: "scheduler" severity: "wrong-result" timestamp: "2026-09-29T04:07:19Z" @@ -11,6 +11,7 @@ occurrences: 1 files: ["src/scheduler/src/plugins/seqjob_allocator.c", "src/scheduler/src/plugin.c", "src/scheduler/src/schedobj.c", "src/scheduler/src/host_iter.c"] tags: ["scheduler", "allocation", "compound", "seqjob"] related: ["bug-1768", "bug-1766"] +fix_commits: ["c10f32cc"] gitea_issue: 334 gitea_synced_status: "open" gitea_synced_hash: "12cdc1100496" @@ -75,21 +76,31 @@ fix here, separately, with its own test. `maxTasks=1`, and run seqjob against host-2 with exactly 1 free slot. 3. Expected RED: host-2 is pre-filtered out (stale `slots:4`) and B pends. Expected GREEN after a fix: B is placed on host-2. -- Frequency: deterministic by code reading (not yet executed) +- Frequency: deterministic (1/1 runs of the test before the fix) - Evidence: not kept (no run yet). Code-reading trace in the research summary for spec `.kiro/specs/scheduler-allocator-runner/` (requirements Requirement 3 AC 6). ## Root cause -TODO: required for fixed/partial +`plugin_prepare_allocation()` (src/scheduler/src/plugin.c) reset only +`ctx->alloc_req.shared` in its job-level pass (`ctx->worker == NULL`), while +seqjob's and parjob's prepare hooks append this primary's job-level slots +want into `ctx->alloc_req.host` with the append-only `xvec_idval_store()`. +A COMPOUND/ALTER job's primaries share one ctx (`sched_ctx_set_primary()` +runs the job-level pass per primary), so `.host` still held the previous +primary's last per-host want. The host iterator pre-filtered on it +(`host_iter.c`), and a global limit on slots read its first `slots` entry. ## Fix -TODO: required for fixed/partial +`plugin_prepare_allocation()`'s job-level pass now resets `.host` as well +as `.shared`, so each primary's pass starts from its own want only +(`c10f32cc`). The per-host pass already reset `.host`; parjob's per-bucket +reset is unchanged. ## Verification -- Test: TODO: name + file; RED before the fix, GREEN after -- Suites: TODO: suite results and build profile -- Live: TODO: soak/deploy run, or n/a and why +- Test: test_compound_later_seqjob_primary_ignores_previous_want in src/scheduler/testsuite/test_parjob_e2e_multislot.c (hosts A=4 slots, B=1 slot; COMPOUND `4*{..} + 1*{..}` through the real scheduler dispatch): RED before the fix (PEND, "Expected 1 Was 2"), GREEN after (DISPATCH, 4 slots on A + 1 on B) +- Suites: ASAN debug build (src/xce.build.discrete), `meson test --no-suite xceadmin`: 117/117 OK, 0 Unity :FAIL lines, 0 sanitizer reports (2026-09-29) +- Live: n/a -- no soak or deploy script submits COMPOUND/ALTER jobs; the test drives the real picker/allocator dispatch path end to end ## References - Related: bug-1768 (per-primary sizing), bug-1766 (COMPOUND publish-only-if-all-succeed)