Repository navigation
fix(job-manager): keep scheduling state in caller memory - #10231
Conversation
Progress report (cf528e7 → 8ab6829)➖ System libraries: 48.8% (+0.0%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
|
Exports introduced here that are already present in
|
|
@Felipebmaitan This combined head carries the publish-then-wait progress hole: |
|
@oneandonlydean Addressed your combined-head progress request in 4e1e36d. This adapts the #10166 scheduler repair (dca749a) to this PR's caller-owned intrusive queues. The existing prerequisite order (CPU, compute storage, lifecycle, registration, owned state) is unchanged. Added the same bounded two-worker Final composition rerun after the scheduler fix: 27/27 CPU/lifecycle/registration/compute-progress cases plus the compute CTest pass on each platform. This includes the existing spin/scale/wake controls, caller-memory ownership, shutdown, failure recovery and registration coverage. The compute runs used |
|
@Felipebmaitan #10166 is merged now (924b18f), so the scheduler layer underneath this stack is settled on This PR and the ones stacked on it (#10244, #10254, #10264, #10272) now conflict with Could you merge |
|
@Felipebmaitan, this PR and the four stacked on it (#10244, #10254, #10264, #10272) now conflict with
We usually refresh simple conflicts ourselves, but these are real code merges across a five-PR stack, so you're better placed to resolve them once at the bottom. Could you merge current |
|
@oneandonlydean Addressed your bottom-up stack refresh request, including the earlier guidance to keep the landed scheduler parts canonical. Merged current main
The shared The later refreshes retain profiler registration/ID handling, GPU lookahead encoding/completion, compute-shutdown behavior, and the Linux reference adapter/parity selection. Debt text carries main's clock/reference limitations without reintroducing resolved host-heap, registration or profiler gaps. #10213 was left untouched for your side as requested. Validation on every new head: 27/27 selected CPU/lifecycle/failure-recovery/registration/compute-progress CTest cases pass on each of native Windows 11 / GCC 15.2 and Debian x86-64 / GCC 14.2. This includes the blocked-publisher regression and existing spin/scale/wake controls. The refreshed sources and CPU fixtures were rebuilt against the existing source-built runtime dependencies. Local conventions, script registration, PR whitespace checks and JobManager CMake parsing pass. All five published heads are currently mergeable with main. The latest hosted checks have no failures, with some relinker/conventions jobs still running. These focused author runs do not replace fresh full-product/current-runtime CPU/GPU CI; the five heads are ready for the review and full CI runs you offered. |
|
@Felipebmaitan thanks for refreshing the stack, and for the barrier-debt fix in #10254, which reads right now. Two things before the next refresh, which will follow #10706 anyway:
The other six heads pass review as they stand. We will run full CI on the stack after that refresh. |
|
@Felipebmaitan A correction to my note above, now that #10706 has merged with its public-header rule (each exported function declared exactly once, in the library's public header reachable from
The other declarations already match main's signatures. After the refresh, |
|
@oneandonlydean Addressed both the prerequisite refresh and public-header correction. Refreshed from landed #10706/main
The reconciliation removes local export declarations/API type copies from the added fixtures and uses umbrella headers. JobManager's local import block and shutdown forward declaration are gone. The two
GPU retest: both the previous #10254 head and the header-refreshed head reproduced Windows device loss/timeout in the old 134-million-iteration synthetic spin. Reducing that workload passed. I replaced the timing-dependent overlap setup with a separate GPU2 gate released by the CPU callback, plus a three-second rescue that explicitly fails the test if used. The callback must observe GPU1's output while GPU2 is blocked; GPU2 must finish before Wait returns. The new full fixture passes on both platforms and in three repeat rounds. A Windows negative control omitting the callback release fails the deadline assertion, cleans up, and has no device loss. Earlier failures remain recorded. This fixture-only repair is propagated through #10264/#10272; other compute/shutdown assertions are retained. The table's CPU/compute/profiler cases pass on Windows 11 / GCC 15.2 and Debian x86-64 / GCC 14.2. Compute/GPU-profiler tests actually execute on RTX 5080 (621.01) and llvmpipe with require-Vulkan, no shader cache and Khronos validation: zero VUID or missing-layer errors. The main Fresh #10272 reference runs on each OS pass 16/16 host-all, 14/14 host parity and 14/14 original-module parity. Host hash is null; original SHA-256 is All published heads/descriptions are verified and all seven are mergeable. No latest hosted check is failing; some relinker jobs remain pending. Descriptions include the refreshed order and concrete commands/results. These focused author builds use existing source-built runtime dependencies, current public API headers and matching internal GPU-runtime headers; they do not replace fresh full-product/current-main runtime CI or the entire public-header compilation matrix. Full CI remains the next validation step. |
What
JobManager now places its manager, factories, sequence objects, worker records, and bounded scheduling nodes in the work area returned by its size query. Intrusive queues and a 72-byte node pool replace heap containers. Waiting callers keep their temporary Wait record on their own stack, preserving the existing allocation-free node-exhaustion recovery. Destruction and failed initialization release native synchronization/thread resources without freeing caller memory.
Queued compute marker names are borrowed until their CPU barrier retires, matching the original module, just like shader-register inputs. The regression changes both inputs behind a held CPU job and proves that the queued dispatch reads the deferred values. There is no new claim that every dispatch is encoded at the API call: the original-module probe disproves that for a dispatch behind a CPU barrier.
This is a dependent PR for the next layer after #10166, #10188, #10202 and #10213. The independently reviewable topic commit is
d14f5c0968c93c3e5654eb410456619c3e192683, parentaecb451d51; predecessor commits are included to make the exact combined head buildable. Base main snapshot:4997726a5f. After the prerequisites land, rebase this branch to retain only this topic's diff. No prerequisite PR should be closed or superseded.Integration order: #10202 → #10213 → #10231 → #10244 → #10254 → #10264 → #10272, followed by #10249 rebased on top. #10166, #10188 and #10706 have landed. This refreshed stack incorporates the #10706 public headers from main
f26434afa3and each refreshed prerequisite in that order. Preserve this landing order and the caller-owned, profiler, barrier, shutdown and Linux-reference changes. The focused runs below validate this composition; full-product CI and any further refresh after subsequent main changes remain separate.Tested
Public-header/prerequisite refresh
8ab682946aon mainf26434afa3, with refreshed parent42bff60650. 28/28 distinct focused cases pass on each of Windows 11 / GCC 15.2 and Debian x86-64 / GCC 14.2: 27 CPU/lifecycle/failure-recovery/registration/progress cases, the compute fixture. Commands:ctest --test-dir <focused-build> -V(CPU),ctest --test-dir <focused-build> -R "^(agc_driver_job_manager_compute|guest_job_manager_profiler.*)$" -V(GPU/profiler),python core/libs/tests/test_public_headers.py --audit-only,python tools/check_conventions.py --base origin/main, andgit diff --check. These pass. The current-main conventions checker, including its 8192-byte alignment rule, also passes. Public declarations/umbrella coverage are audited across all 368 libraries; affected headers and the reference adapter compile, and actual JobManager CMake targets/test registrations configure successfully with imported runtime dependencies. Each refreshed parent is an ancestor of its child.Compute/GPU-profiler execution uses
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon RTX 5080 and llvmpipe. No capability skips, missing-layer warning orVUID-errors. The mainf26434afa3focused baseline passes 17 CPU cases plus the same compute fixture on the same platforms/devices, also with zero validation errors. The exact refreshed JobManager sources and fixtures use current public API headers with existing source-built runtime dependencies; GPU fixtures use internal headers matching those runtime binaries. These are focused author builds, not fresh full-product/current-main runtime builds or the full public-header compilation matrix. Full CI remains pending.Earlier composition-specific evidence follows.
Stack refresh
376cab297d: merged mainc8d34aa8f4after #10166 landed. The landed scheduler/common regression code remains canonical; caller-owned queue operations and this PR's topic are retained. The refreshed parent is an ancestor of this head. 27/27 focused CPU/lifecycle/failure-recovery/registration/progress tests pass on each of Windows 11 / GCC 15.2 and Debian x86-64 / GCC 14.2, using the exact refreshed JobManager sources and fixtures with existing source-built runtime dependencies. Conventions, script registration and diff whitespace checks pass. Full product/current-runtime CPU/GPU CI remains pending the maintainer run; earlier GPU/reference results below belong to the stated earlier compositions.Main refresh
9a7b9cc95b: merged maindb6af9e0fdafter #10188 landed, preserving this PR's topic and applicable scheduler repair. Reconciled the JobManager debt text into one set of nonduplicated bullets. Exact merged JobManager sources and CPU fixtures were rebuilt against the existing source-built runtime dependencies: 27/27 focused CPU/lifecycle/progress tests pass on Windows 11 / GCC 15.2 and Debian x86-64 / GCC 14.2. Conventions, script registration and PR diff whitespace checks pass. Full product/current-runtime CPU/GPU CI remains pending the maintainer run; earlier GPU/reference results below apply to their stated pre-refresh compositions.Maintainer scheduler follow-up
4e1e36d257: adapted fix(libSceJobManager): honor worker spin and persistence policies #10166 fixdca749aaa0to the caller-owned intrusive queues. The two-worker zero-spin/zero-persistenceworker_waitfixture verifies the spare is parked, then requires a publisher to dispatch one child on a separate sequence and wait without any later external dispatch. Prior headd14f5c0fails the bounded child-progress assertion on native Windows and Linux; the repaired combined head passes. Recompiled this PR library and fixtures against the existing source-built runtime dependencies: 27/27 focused CPU/lifecycle/registration/progress CTest cases plus the compute CTest pass on both Windows 11 / GCC 15.2 and Debian x86-64 / GCC 14.2. Compute used require-Vulkan/no-cache/validation on RTX 5080 (Windows) and llvmpipe (Linux), with zero VUID lines and no missing-layer warning. This is a focused composition rerun, not a new full-product build. Existing prerequisite order is retained.Windows 11 Pro, MinGW GCC 15.2: the exact combined head passed 28/28, 14.75 s. Linux x86-64 Debian bookworm, GCC 14.2: 28/28, 13.70 s. Both use
ctest --test-dir build -R '^(guest_job_manager_|guest_ulobjmgr|agc_driver_job_manager_compute)' -V. The Linux source snapshot was verified by SHA-256 against the checkout.The ownership fixture covers 1 and 13 workers, 1 and 32 sequences, three reinitialization/recycling rounds, pointers into the supplied block and guard bytes after it. Compute storage tests check manager/factory/sequence placement for heap and mapped direct-memory areas. Concurrent Wait tests cover normal retirement and shutdown cancellation. Existing node exhaustion, worker policies, 45 initialization failure injections and registration tests remain passing.
Owned PPSA06888 module through ordinary Windows relinker startup:
owned_stateandconcurrent_waitpass. The complete compute fixture passes against both the original and fallback, including direct-memory ownership, maximum register/marker capacity and deferred input reads. The previous integrated fallback fails the new borrowed-marker assertion as a negative control. No proprietary module or disassembly is included.Focused main baseline
4997726a5fpassed 9/9 on the same Windows machine and RTX 5080. Main and changed GPU runs useANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation; all compared logs contain zero missing-layer warnings and zeroVUID-lines. Linux change runs on Mesa llvmpipe with the same required-layer flags and also contain zero of either. No speed claim.Eleven focused Linux cases pass UBSan with
-fno-sanitize=vptrbecause the guest ABI fixture intentionally invokes compatible vtables through independently declared C++ interface types. ASan could not start: its shadow-memory reservation conflicts with the custom guest address arena and reportsguest address space arena exhausted. This is not an ASan pass.GPT-6.1-sol adversarial review found no blocker. Independent probes exercised eight simultaneous Wait callers through 20 recycling rounds and cross-sequence shutdown. The reviewed topic files are unchanged by the final main refresh.
python tools/check_conventions.py --base origin/mainandgit diff --checkpass. The required overlap scan completed: the four declared predecessors are the JobManager overlaps. Conflicting test: organize library tests and label CTest suites #6044 was manually reviewed earlier and only relocates/registers tests. Other uncomparable shared files are docs/dev/ENVIRONMENT.md changes from the CPU prerequisite; this topic does not modify that file.To reproduce the native ownership/concurrent-wait checks, build
job_manager_referenceand runpython tools/run_job_manager_reference.py --module <owned-module> --build build --relinker <relinker.exe> --toolchain <compiler-bin> --cases owned_state concurrent_wait. The compute adapter published in #10188 runs the complete updated fixture from this checkout.Original-module comparisons exercise the host services, not a PS5. Console timing and advancement in a real calling title remain unmeasured. GPU-active shutdown and native rewind command batching remain follow-ups.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)