mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1130] [Engine] Windows: apply commit limits after allocation failure #3048
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3048
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1130
Author: @SladeThe
Created: 10/6/2026
Status: 🔄 Open
Base:
main← Head:windows-commit-retry-v2📝 Commits (1)
1f4b7cdApply commit limits after allocation failure📊 Changes
6 files changed (+293 additions, -26 deletions)
View changed files
📝
CMakeLists.txt(+2 -0)📝
docs/DETAILS.md(+1 -1)📝
docs/UNSLOTH_Q4.md(+10 -5)📝
include/strata/core/expert_source.hpp(+20 -2)📝
src/core/expert_source.cpp(+73 -18)📝
tests/core/file_expert_source_test.cpp(+187 -0)📄 Description
Problem and result
Follow-up to #749: the resident-memory allocation is capped against current Windows commit capacity before an allocation is attempted, even when a system-managed page file could grow to satisfy it.
This change first attempts the allocation permitted by available RAM. After host allocation failure, Windows takes a fresh RAM/commit snapshot and retries once with a smaller positive budget. Borrowed GPU-cache slots that fit remain resident, including when every expert is already held by a GPU cache.
Related discussion
Approach
Keep the existing RAM headroom on the first attempt. Apply the commit limit to the smaller retry only after pinned and ordinary allocation fail. Check for an empty retry after planning borrowed slots, preserve both attempts' errors and the file fallback, and require a strict whole complement to fit. Other platforms retain their existing allocation flow.
Validation
Tested on 1 November 2026 at
1f4b7cdd56243fccbc21af4478202dbb50521814, rebased on upstreammainatc62d5e3a15b40ea51c96aae9e8d36928965f53ab(Strata 0.2.9 source, engine 0.1.55).Environment: Windows 11 build 26300, RX 6900 XT, 192 GiB RAM, AMD Clang 24.0.0git and Visual Studio 2022. Release HIP build for
gfx1030, withSTRATA_BUILD_TESTS,STRATA_NATIVE_EXPERTS,STRATA_PORTABLEandSTRATA_PREFILL_MMQenabled.Passed:
The HIP engine and test executable built successfully. CTest reported:
The whitespace check exited successfully with no output. The regression checks cover one smaller retry, fresh memory limits, explicit and automatic budgets, borrowed slots, empty retries, retained bytes, errors and the file fallback. The GPU integration test ran on one physical GPU; additional-stage residency is represented by the fixture and the initial allocation failure is injected.
GitHub Actions also built and linked the Metal engine successfully on
macos-26for this PR. This compiles the host engine; it does not execute Metal kernels on a GPU.Failed: None in the checks above. Compilation emitted warnings.
Not run:
Limits
Draft pending the missing backend validation, as required by CONTRIBUTING.md. Help is needed to build the shared engine changes with CUDA on this revision. There is no new end-to-end performance claim. A successful first allocation does not enforce a separate commit reserve, and allocation success is not guaranteed after a memory snapshot.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.