mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1493] [Engine] Add opt-in memory relief and supervised tool resource leases #3488
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#3488
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/1493
Author: @midhatn
Created: 10/8/2026
Status: 🔄 Open
Base:
main← Head:codex/adaptive-background-draft📝 Commits (10+)
9fe6721Port opt-in live memory controls from PR #726a1f003dHarden live-memory port and add shadow co-adaptive policy research1ab0323Add native capacity feedback and measured adaptive routing gatesb20e1e4fix: separate running VRAM targets from fitting reserves9d8848ddocs: record adaptive memory and agent acceptance limitsf154e3efeat: yield at native safe points for bounded background controlef13abaperf: sample Windows workload counters in one bounded snapshot15e7234feat: park active text requests under sustained memory pressurea67718ddocs: publish scoped adaptive acceptance and implementation provenancea3b0ecaMerge remote-tracking branch 'origin/main' into codex/adaptive-background-draft📊 Changes
122 files changed (+23872 additions, -180 deletions)
View changed files
➕
.github/workflows/ci.yml(+81 -0)📝
CMakeLists.txt(+34 -0)➕
bench/results/2026-10-05-live-memory-integration/README.md(+105 -0)➕
bench/results/2026-10-05-live-memory-integration/measurements.json(+699 -0)➕
bench/results/2026-10-08-adaptive-background/README.md(+326 -0)➕
bench/results/2026-10-08-adaptive-background/foreground_work.cpp(+67 -0)➕
bench/results/2026-10-08-adaptive-background/near64k_fixture.py(+49 -0)➕
bench/results/2026-10-08-adaptive-background/request-fixtures.json(+42 -0)➕
bench/results/2026-10-08-adaptive-background/results.json(+782 -0)➕
bench/results/2026-10-08-adaptive-background/runtime-settings.json(+29 -0)➕
bench/results/2026-10-08-adaptive-background/unique_sorted_checks.cpp(+27 -0)➕
bench/results/2026-10-08-adaptive-background/vision-fixture.png(+0 -0)➕
bench/results/2026-10-08-idle-pressure/README.md(+110 -0)➕
bench/results/2026-10-08-idle-pressure/results.json(+169 -0)➕
bench/results/2026-10-09-supervisor-handoff/README.md(+163 -0)➕
bench/results/2026-10-09-supervisor-handoff/supervisor-result.json(+123 -0)➕
bench/results/2026-10-10-pressure-prefill/hermes-pressure-prefill-attempt01-audit.json(+59 -0)➕
bench/results/2026-10-10-pressure-prefill/pressure-prefill-component-results.json(+269 -0)➕
bench/results/2026-10-10-resident-handoff/README.md(+320 -0)➕
bench/results/2026-10-10-resident-handoff/component-results.json(+453 -0)...and 80 more files
📄 Description
Problem and result
Local agents need memory for compilers and GPU tools between model calls. This opt-in draft lets a supervisor declare that work, request resident relief or confirmed inference unload, and return after a fresh capacity check. Sustained external pressure can also trigger relief. Uncertain execution or teardown keeps the ownership barrier in place instead of repeating a tool or regrowing inference over it.
This remains a draft. Current head is
06ba725d8b9bb42b457302f71dd85204e9760c32, incorporating upstream v0.2.3.1 without rewriting the earlier public history. The earlier native executable qualification below applies toa69684f1;b580e627recorded that result, and06ba725dadds the Python routing correction described below. Native sources are unchanged. Reopening after the tracker reset did not mark the feature ready for review.Related discussion
This continues #1493 following the tracker-reset invitation. The reset was not a technical rejection or approval of the scope; no separate maintainer scope agreement is recorded here. The allocator foundation is medking82's #726. The engine-independent Hermes terminal authorization seam is Hermes #135418. The separate Windows token-default correction is #3399.
Approach
Reuse the existing live RAM blocks, GPU VMM cache, acknowledged memory protocol and server lifecycle/FIFO. An authenticated loopback lease separates admission, execution, renewal and release; a supervisor grants tool profiles and runtime-identified workers share one broker. Physical RAM, commit headroom and native GPU headroom are checked separately. The feature is opt-in; unsupported combinations refuse startup rather than bypassing adaptive ownership. Capacity is observed, not reserved by the OS.
The upstream merge retains current vision diagnostics, tool-picture handling, drafting configuration and web API-key behavior while preserving adaptive admission and confirmed process shutdown. Startup validation uses effective user arguments. Protocol and limits and implementation provenance retain behavior and attribution. The private disk checkpoint bank and the newer local Python scheduling experiment are excluded.
Validation
Passed:
Head
06ba725d: correct delivery of the coadaptive route through the existing native request serializer'sstrata_tune.pcie_fracfield. Explicit nested values, including zero, take precedence and other tuning values remain intact. The new actual-Service/serializer regression fails on preceding publicb580e627(three tests, four failed subtest/assertion results). After the nine-line production correction, all 46 focused routing/coadaptive tests pass. These are CPU/fake-engine checks, not new model or native-build qualification. The independent Windows token-rights fix #3399 and the larger scheduling/learner experiment remain excluded.Exact source
a69684f1f2609da46c82f9719d5159f5f9b307dc: Windows CUDA 13.4, MSVC 14.44.35207, architecture 89, portable Release build. All 183 build steps completed with one worker in 961.907s. All 13 native utility, protocol and parity programs exited zero, includinglive_memory_test --protocol-only. No model was started. Configure, build, tests and outer worker exited zero; all 1,638 retained process handles signaled exit and owned cleanup was verified. Thestrata.exeSHA-256 is744205e4e024b5cbba19e4b560678ffe21e6899e59050929f7af51557f3c6198.Resolved upstream merge
e1242813(upstream7ddc17a3, source treeb37e52d2): 14 focused server/web modules, 188 collected, 187 passed, one optionaljsonschemaskip, in 39.078s including wrapper overhead. A separate terminal drafting run passed 40 tests in 7.746s. The current report lists commands, module counts, exact identities, cleanup scope and the compact native receipt.Earlier v0.2.2 source
037314f9plus the five-line test-only synchronization committed ase39dbb99:python -B -m unittest serve.test_idle_parking_service -v, 42 passed in 4.920s. The client could receive its response before the server'sfinallyreleased preparation ownership; the bounded wait preserves the original assertions. This focused pass does not replace the failed complete run below.Historical v0.1.45 results remain in the original revision-specific report. They are not counted as current-head passes.
Failed:
037314f9executed 1,402 tests with two failures, one error and 21 skips. One failure was the corrected idle fixture ordering. The remaining failure/error reproduce on exact unmodified upstream v0.2.2 afteradopt_user_defaults(): readable child identity and its ownership record fail. The same three selected lifeline tests pass on plain upstream and with only default-token DACLFAchanged toGA. This is tracked separately in #3399; the patch is not folded into this PR. The original complete run remains failed.Not run:
Limits
All touched-backend builds remain required before requesting review; this PR stays draft while those checks and scope review are unfinished. It targets a single engine; finite execution workspace and races with unrelated allocations remain. There is no universal no-OOM, uninterrupted-progress, foreground-performance or speedup claim. Prepared with Codex; contributor responsibility, authorship and license notices are retained.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.