docs(job-array-one-based-index): feature validation round 1 follow-ups

bug-1903 partial (page-token precision fixed in efff6b65), bug-1907
logged (harness setpend/jobrun cannot report not-found), stale
parse_jobid regex comment in repl.c updated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-01 15:50:10 +00:00
parent efff6b658f
commit 0f4effe7df
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
5 changed files with 100 additions and 16 deletions

View file

@ -252,3 +252,4 @@
- 8.1: client `format.ParseSelection(raw, allowRange)`, `ParseNameSelection(raw)`, `SplitSelections(list)`, `Selection.APIKey()`; query-range refusal rule tag "range" (`RuleQueryRange`); `ToAPIJobID(s, allowRange)`; peek uses `ToAPIJobIDLegacy`. For 8.2: `filters/job_filter.go` still runs `isValidJobId` before `ToAPIJobID` and both ID lists still split at every comma.
- 10.1: meson 126/126 OK and every apiserver/xcecli Go package ok (asan, src/build.jai). No cgo unit test drives a full REST array submit (needs a controller); 10.2's live REST flow covers it.
- 10.2: HA `--array-soak` PASS (1..N addressable after failover, one WAL record for 2 and 10000 elements); multihost PASS (`[1]` RUN→DONE on both hosts). Live REST via xce-deploy-ha + xcecli: `arr[1-3]` lists `[1]..[3]`; `bad[0-2]` rejected (rule 2.5); `kill <array-id>[2]` and `kill -J 'arr3[3]'` reach only that element (a PEND element goes to EXIT alone). xcecli submit reads stdin when it is not a TTY: pass `</dev/null` in scripts. Found and fixed bug-1904 (scheduler crash on empty-resreq JOB_UPDATE) and bug-1906 (`jobs list` rejection text) in 6e631caa; logged bug-1905 (xcecd_virtual ignores kill of a RUN job, pre-existing, also plain jobs). `XCE_JOBINDEX` in a running script cannot be observed here: xcecd_virtual never execs the job and real xcecd needs systemd/dbus (absent in this container); covered by `worker/testsuite/test_exdata_jobindex.c`. A live check on a systemd host is still worth doing.
- Validation (kiro-validate-impl, round 1): page tokens lost precision on array element IDs (float64), so REST paging over >1000-element arrays skipped rows or looped; fixed in efff6b65 (bug-1903 now partial: original GetJobsInfo symptom still open). Harness `setpend`/`jobrun` not-found gap logged as bug-1907 (controller acks first; outside this spec). Canonical gate: `xce-build.sh all` meson 126/126 + canonical Go packages ok; `apiserver/middleware` TestLoadJobs needs a live :8080 server with fixed credentials and is not in the canonical set.

View file

@ -16839,9 +16839,9 @@
},
{
"id": "bug-1903",
"status": "open",
"status": "partial",
"status_updated": "2026-10-01",
"status_note": "newly logged",
"status_note": "page-token float64 precision loss for array element IDs fixed in efff6b65; the original GetJobsInfo repeat-first-page symptom with plain jobs is still unexplained",
"component": "apiserver",
"severity": "wrong-result",
"timestamp": "2026-10-01T12:21:25Z",
@ -16849,8 +16849,8 @@
"occurrences": 1,
"error_message": "apiserver GetJobsInfo page_token does not advance: the next page repeats the first\n\n**Observed:** found by the reviewer of task 7.3 (spec job-array-one-based-index) while comparing handler behaviour with HEAD in a unit-test harness: following the `page_token` returned by `GET /xce/v1/jobs` (`GetJobsInfo`) returns the same page again instead of the next one. Reproduced at HEAD (before task 7.3) with a plain filter `{submit_user:eq:all}` and a small `limit`, so it is not caused by the element-selection work.\n**Expected:** passing the returned `page_token` yields the next page of rows, and the last page returns no token.\n**Impact:** wrong result: clients that page through job listings (`xcecli jobs list` with paging, REST callers) see the first page repeatedly and never reach later jobs.\n**Found by:** review (task 7.3 of spec job-array-one-based-index, 2026-10-01)",
"file": "src/frontend/apiserver/controllers/jobs.go, src/frontend/apiserver/store/query.go",
"root_cause": "TODO: required for fixed/partial",
"fix": "TODO: required for fixed/partial\n\nVerification:\n- Test: TODO: name + file; RED before the fix, GREEN after\n- Suites: TODO: suite results and build profile\n- Live: TODO: soak/deploy run, or n/a and why",
"root_cause": "Two separate parts:\n1. (found 2026-10-01, fixed) `store/query.go` `findPageTokenIndex` decoded the token with `json.Unmarshal` into `interface{}`, so `unique_job_id` became a float64. Array element IDs set bit 62, where float64 spacing is 1024, so the token no longer named the page's last row: paging skipped rows (N >= 1024) or found no match and restarted at row 0 (1001 <= N <= 1023). `queryControlRowsByJobID`, `FetchJobList` and `GetJobByIDs` page until the token is empty, so the restart case loops forever.\n2. (open) The originally observed repeat-the-first-page with plain jobs and a small `limit` in `GetJobsInfo` is not explained by part 1 for IDs below 2^53; cause not yet found.",
"fix": "Part 1: efff6b65. `findPageTokenIndex` decodes with `json.Decoder.UseNumber()` and converts integers to int64 (floats stay float64). Part 2: not yet fixed.\n\nVerification:\n- Test: (part 1) `TestPaginateRowsArrayElementIDsRoundTripPageToken` in `src/frontend/apiserver/store/query_test.go`; RED before the fix (2452 of 2500 rows), GREEN after\n- Suites: apiserver store/utils/controllers go test ok (CGO_ENABLED=0)\n- Live: n/a (unit-level; part 2 still needs a reproduction)",
"tags": [
"apiserver",
"query",
@ -16936,6 +16936,32 @@
"6e631caa"
],
"record": ".wolf/bugs/bug-1906.md"
},
{
"id": "bug-1907",
"status": "open",
"status_updated": "2026-10-01",
"status_note": "newly logged",
"component": "controller",
"severity": "wrong-result",
"timestamp": "2026-10-01T15:49:05Z",
"last_seen": "2026-10-01T15:49:05Z",
"occurrences": 1,
"error_message": "harness setpend and jobrun cannot report not-found: the controller acks status 0 first\n\n**Observed:**\nFound by code reading, no failing run captured. Both controller handlers reply before looking the job up:\n```\nsrc/controller/job.c:2246 handle_jobdispatch: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */\nsrc/controller/job.c:3869 do_set_preason: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */\n```\nSo harness `jobrun -j <id>` and `setpend -j <id>` succeed for a job (or array element) that does not exist.\n\n**Expected:** like the other single-job commands, `jobrun`/`setpend` on an unknown job ID report \"not found\" (job-array-one-based-index Requirements 4.7 and 5.13).\n**Impact:** wrong result: a test script that targets a wrong element (e.g. `$jobid[0]` on a new array) passes silently instead of failing.\n**Found by:** review (job-array-one-based-index task 4.3 implementation notes and feature validation, 2026-10-01)",
"file": "src/controller/src/job.c, src/harness/test.c",
"root_cause": "TODO: required for fixed/partial",
"fix": "TODO: required for fixed/partial\n\nVerification:\n- Test: TODO: name + file; RED before the fix, GREEN after\n- Suites: TODO: suite results and build profile\n- Live: TODO: soak/deploy run, or n/a and why",
"tags": [
"harness",
"job-control",
"not-found",
"job-array"
],
"related_bugs": [
"bug-1896"
],
"fix_commits": [],
"record": ".wolf/bugs/bug-1907.md"
}
]
}

View file

@ -1,8 +1,8 @@
---
id: "bug-1903"
status: "open"
status: "partial"
status_updated: "2026-10-01"
status_note: "newly logged"
status_note: "page-token float64 precision loss for array element IDs fixed in efff6b65; the original GetJobsInfo repeat-first-page symptom with plain jobs is still unexplained"
component: "apiserver"
severity: "wrong-result"
timestamp: "2026-10-01T12:21:25Z"
@ -37,15 +37,17 @@ related: []
- Evidence: not kept (reviewer's temporary probe test, deleted)
## Root cause
TODO: required for fixed/partial
Two separate parts:
1. (found 2026-10-01, fixed) `store/query.go` `findPageTokenIndex` decoded the token with `json.Unmarshal` into `interface{}`, so `unique_job_id` became a float64. Array element IDs set bit 62, where float64 spacing is 1024, so the token no longer named the page's last row: paging skipped rows (N >= 1024) or found no match and restarted at row 0 (1001 <= N <= 1023). `queryControlRowsByJobID`, `FetchJobList` and `GetJobByIDs` page until the token is empty, so the restart case loops forever.
2. (open) The originally observed repeat-the-first-page with plain jobs and a small `limit` in `GetJobsInfo` is not explained by part 1 for IDs below 2^53; cause not yet found.
## Fix
TODO: required for fixed/partial
Part 1: efff6b65. `findPageTokenIndex` decodes with `json.Decoder.UseNumber()` and converts integers to int64 (floats stay float64). Part 2: not yet fixed.
## 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: (part 1) `TestPaginateRowsArrayElementIDsRoundTripPageToken` in `src/frontend/apiserver/store/query_test.go`; RED before the fix (2452 of 2500 rows), GREEN after
- Suites: apiserver store/utils/controllers go test ok (CGO_ENABLED=0)
- Live: n/a (unit-level; part 2 still needs a reproduction)
## References
- Related: bug-1898 (found while fixing it)

58
.wolf/bugs/bug-1907.md Normal file
View file

@ -0,0 +1,58 @@
---
id: "bug-1907"
status: "open"
status_updated: "2026-10-01"
status_note: "newly logged"
component: "controller"
severity: "wrong-result"
timestamp: "2026-10-01T15:49:05Z"
last_seen: "2026-10-01T15:49:05Z"
occurrences: 1
files: ["src/controller/src/job.c", "src/harness/test.c"]
tags: ["harness", "job-control", "not-found", "job-array"]
related: ["bug-1896"]
---
# bug-1907: harness setpend and jobrun cannot report not-found: the controller acks status 0 first
## Description
**Observed:**
Found by code reading, no failing run captured. Both controller handlers reply before looking the job up:
```
src/controller/job.c:2246 handle_jobdispatch: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */
src/controller/job.c:3869 do_set_preason: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */
```
So harness `jobrun -j <id>` and `setpend -j <id>` succeed for a job (or array element) that does not exist.
**Expected:** like the other single-job commands, `jobrun`/`setpend` on an unknown job ID report "not found" (job-array-one-based-index Requirements 4.7 and 5.13).
**Impact:** wrong result: a test script that targets a wrong element (e.g. `$jobid[0]` on a new array) passes silently instead of failing.
**Found by:** review (job-array-one-based-index task 4.3 implementation notes and feature validation, 2026-10-01)
## Environment
- OS: no /etc/os-release; Docker container; NixOS kernel; kernel Linux 6.18.33 x86_64
- libc: glibc 2.42-47 (interpreter /nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2)
- Toolchain: gcc (GCC) 15.2.0, meson 1.9.1
- Build: asan (src/build.jai)
- Code: scheduler-framework @ efff6b65-dirty
- Deployment: any (controller request handling)
## Reproduction
1. Start a controller (xce-deploy-ha) and run `xce_test` against it.
2. `jobrun -j 0-0-1-5` (an ID that was never submitted) and `setpend` with `-j 0-0-1-5`: both report success (expected from the code; not run).
3. Compare `jobkill -j 0-0-1-5`, which reports not found.
- Frequency: deterministic (by code; not run live, 2026-10-01)
- Evidence: not kept (code references above)
## Root cause
TODO: required for fixed/partial
## Fix
TODO: required for fixed/partial
## 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
## References
- Related: none

View file

@ -139,11 +139,8 @@ int repl_split_tokens(const char* line, char tokens[][XCE_REPL_TOKEN_LEN],
/* bug-1596 (task 12.5): strip one matching pair of surrounding
* quote characters -- an operator pasting a value straight out of
* another command's own output (e.g. a jobid from `info jobs`) and
* habitually quoting it otherwise gets a silent wrong-answer
* failure downstream (parse_jobid()'s whole-string-anchored regex
* rejects the literal quote characters, and a numeric strtoull()
* fallback then parses the leading quote as a nonnumeric prefix,
* silently producing 0) instead of an intelligible error. No
* habitually quoting it would otherwise have parse_jobid() reject
* the value because of the literal quote characters. No
* escaping/embedded-space support -- just symmetric outer-quote
* removal, sufficient for every argument this REPL's commands
* accept (jobids, breakpoint filters, names). */