Repository navigation
Apply parallel worker memory budgets on Windows - #2035
Merged
Mister-Meeseeks merged 1 commit intoOct 15, 2026
Merged
Mister-Meeseeks merged 1 commit into
Mister-Meeseeks merged 1 commit into
Conversation
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.
Change and mathematical scope
Native Windows has no
os.sysconf, sorun_parallel.memory_gib()returnedNoneand the default worker count ignored the documented three-GiB-per-worker budget. On the tested Windows host, the old code chose 32 workers; querying 31.297 GiB of physical RAM now selects 10. The sharedverify_parallel.default_jobs()also receives the detected capacity.Use the standard-library
ctypesbinding toGlobalMemoryStatusEx, with the SDK's fixed-width fields and initialized structure length. Preserve the POSIX query, explicitJOBSoverrides and unknown-memory fallback. This restores the existing total physical memory heuristic; it is not a free-memory reservation or a hard resource limit. No scientific input, certificate, selected result or kappa changes.Task and overlap
c676548106012571fefa1dce0ec16f1bcfe11dce.verifier-engineering / portable-replay, priority revision 3, scope key831cc1a3c8f9ff01b197, chooser noncecdb3518b3b43e210c16c478540c21dea. Scope refined to one native Windows resource-detection failure in the existing verification tooling.e76026571dbfa7299bf474b941c9abeb5bd556b3) addresses Windows onboarding encoding/process cleanup in different files.Validation
The new tests produced five failures against the unchanged base implementation. After the fix:
python -X utf8 -B -m unittest discover -s tests -p test_parallel_memory.py -vpython3 -B -m unittest discover -s tests -p 'test_parallel*.py' -vControls cover a fractional capacity above 4 GiB, total versus available memory, API failure with a populated buffer, zero/unknown capacity, CPU and minimum-worker bounds, explicit overrides, and the shared isolated-group budget. The existing Windows-safe scheduler tests also pass (four tests covering overrides, failure propagation, snapshots and invalid CLI/group inputs).
python -X utf8 -B scripts/research_baseline.py,python -X utf8 -B scripts/verify_selected_result.pyandgit diff --checkpass. The source-bound baseline reports the unchanged selected record. No heavy audit workers were launched for the scheduler comparison. Full historical/mathematical replay was not run for this tooling-only change. Hosted CI is separate from these local results.Hosted CI currently requires maintainer approval: Verify research artifacts reports
action_requiredwith no jobs executed. The local results above do not claim hosted CI success.Credit
Retain the existing Apache-2.0 notice and credit eumemic's PR154 worker policy and the integrated maintenance work. API layout and return semantics follow Microsoft's MEMORYSTATUSEX and GlobalMemoryStatusEx documentation. Prepared for Tairitsu-Aya with substantial OpenAI Codex assistance.
Open next questions
This is an existing-tool repair, not a new research package. Accounting for competing processes, free RAM or container/job-object limits would require a separate scheduling-policy change; this patch preserves the current total-memory policy.