[PR #1679] [CLOSED] Windows: cap conversation-memory admission at the commit limit too (#1607) #3606

Closed
opened 2026-11-07 15:29:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1679
Author: @nekomario28
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: fix-1607-commit-limit


📝 Commits (1)

  • 44fdbab Windows: cap conversation-memory admission at the commit limit too (#1607)

📊 Changes

3 files changed (+9 additions, -5 deletions)

View changed files

📝 include/strata/core/conversation_memory.hpp (+3 -2)
📝 src/core/conversation_memory.cpp (+4 -1)
📝 src/program/generate.cpp (+2 -2)

📄 Description

Fixes #1607.

The conversation-cache/checkpoint admission reads ullAvailPhys only, so it admits allocations the commit limit (RAM + page file) then refuses — the engine exits 0xC0000409 with no message even with GiB of physical RAM free. Under WDDM the card's VRAM is charged to the commit too (#141), and the reporter reproduced the crash 6 times, every time within 0.1 GiB of the limit.

Change

conversation_available_memory() on Windows now returns min(ullAvailPhys, ullAvailPageFile) — the same pair host_available_memory already exposes to the expert-source path. It never admits more than today (when the page file is generous, physical RAM is still the bound); the admission floor logic is untouched, and Linux still reads MemAvailable. The two parking log lines drop the word "physical" since the bound can now be the commit charge.

Test plan

  • x86_64-w64-mingw32-g++ -fsyntax-only on conversation_memory.cpp and _conversation_memory_test.cpp: the _WIN32 TU type-checks against real windows.h.
  • Native build + run of conversation_memory_test: 23 checks pass; the Windows-specific check (*available <= ullTotalPhys) still holds since the bound only tightens.
  • g++ -fsyntax-only on the Linux path: unchanged, clean.

Not tested: the actual 0xC0000409 crash on Windows (no Windows box here) — the change only tightens admission, and the reporter's trace ties every crash to the commit boundary this now respects.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1679 **Author:** [@nekomario28](https://github.com/nekomario28) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-1607-commit-limit` --- ### 📝 Commits (1) - [`44fdbab`](https://github.com/Niko1221/Strata/commit/44fdbab1b7947fda457d52ca089a5c018cf11df4) Windows: cap conversation-memory admission at the commit limit too (#1607) ### 📊 Changes **3 files changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/core/conversation_memory.hpp` (+3 -2) 📝 `src/core/conversation_memory.cpp` (+4 -1) 📝 `src/program/generate.cpp` (+2 -2) </details> ### 📄 Description Fixes #1607. The conversation-cache/checkpoint admission reads `ullAvailPhys` only, so it admits allocations the **commit limit** (RAM + page file) then refuses — the engine exits `0xC0000409` with no message even with GiB of physical RAM free. Under WDDM the card's VRAM is charged to the commit too (#141), and the reporter reproduced the crash 6 times, every time within 0.1 GiB of the limit. ## Change `conversation_available_memory()` on Windows now returns `min(ullAvailPhys, ullAvailPageFile)` — the same pair `host_available_memory` already exposes to the expert-source path. It never admits *more* than today (when the page file is generous, physical RAM is still the bound); the admission floor logic is untouched, and Linux still reads `MemAvailable`. The two parking log lines drop the word "physical" since the bound can now be the commit charge. ## Test plan - `x86_64-w64-mingw32-g++ -fsyntax-only` on `conversation_memory.cpp` and `_conversation_memory_test.cpp`: the `_WIN32` TU type-checks against real windows.h. - Native build + run of `conversation_memory_test`: 23 checks pass; the Windows-specific check (`*available <= ullTotalPhys`) still holds since the bound only tightens. - `g++ -fsyntax-only` on the Linux path: unchanged, clean. Not tested: the actual 0xC0000409 crash on Windows (no Windows box here) — the change only tightens admission, and the reporter's trace ties every crash to the commit boundary this now respects. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:30 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3606
No description provided.