[PR #601] [CLOSED] Windows: the engine waits for QUIT on Ctrl+C and Ctrl+Break, so a stop keeps its conversation #621

Closed
opened 2026-10-29 21:27:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/601
Author: @pschaub
Created: 10/28/2026
Status: ❌ Closed

Base: main ← Head: windows-ctrl-break


📝 Commits (1)

  • 115b330 Windows: the engine waits for QUIT on Ctrl+C and Ctrl+Break, so a stop keeps its conversation

📊 Changes

2 files changed (+12 additions, -0 deletions)

View changed files

📝 src/ds4/ds4_main.cpp (+5 -0)
📝 src/program/generate.cpp (+7 -0)

📄 Description

Note

Claude Opus 5.5 found this while testing MAYA_GLM_SLOT_KEEP on my PC, wrote this fix and tested it there. It also wrote the text below.

Fixes #576.

On Windows the engine now ignores Ctrl+C and Ctrl+Break in serve mode, as it already ignores SIGINT and SIGTERM on Linux. The server still stops on them and ends the engine with QUIT, so with MAYA_GLM_SLOT_KEEP=1 the engine writes the conversation in the model before it ends. The problem and the measurements are in #576. No new setting.

What changes:

  • src/program/generate.cpp: the POSIX block at the start of glm_pack_generate gets an #else. In serve mode the engine ignores SIGINT and SIGBREAK, which the C runtime on Windows raises for the console's Ctrl+C and Ctrl+Break.
  • src/ds4/ds4_main.cpp: the same in serve, and as on Linux only while it keeps conversations.

What stays as it is: The server handles the stop as before. The first Ctrl+C or Ctrl+Break stops it and it ends the engine with QUIT, and an engine that has not ended after MAYA_ENGINE_QUIT_S is killed. If the server ends without QUIT (a second Ctrl+C), the engine still ends when its input closes. Linux builds are unchanged, the new code is in the _WIN32 branch only.

Before and after: In #576 (v1.1.27, 2 runs each), after a Ctrl+Break stop and a restart the conversation that was in the model was read again from token 0 without the fix (7.8 s) and reused with it (6,164 of 6,206 tokens, 2.0 s). On this branch (v1.1.35, one run each): without the fix 0 of 6,206 reused, 14.2 s; with it 6,164 of 6,206, 3.4 s. All reads were slower in this run than in #576, in both builds alike (the first read of the prompt took 14 to 16 s).

Output: Unchanged, only the stop is touched.

Tests:

  • tools/check_hip_compat.py: OK, on main and with this PR.
  • Server tests, as in tests.yml: 463 OK and 12 skipped, the same on main.
  • Installer and tools tests: 584 with 31 skipped and 1 error, the same on main. The error is test_ds4_engram_ram, which needs a process without CAP_IPC_LOCK.
  • Windows build of maya and maya-ds4 (MSVC 19.44, CUDA 13.4), and the Ctrl+Break runs above with maya on an RTX 5090.
  • Not tested: Ctrl+C (same path, SIGINT), maya-ds4 runs (it builds), the Windows AMD build.

My setup: Maya v1.1.35 built from source, MSVC 19.44, CUDA 13.4, RTX 5090 32 GB, 64 GB DDR5, Ryzen 9 9950X3D2, Windows 11, Maya-S-v2 IQ2_XXS


🔄 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/mw00/project-maya/pull/601 **Author:** [@pschaub](https://github.com/pschaub) **Created:** 10/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `windows-ctrl-break` --- ### 📝 Commits (1) - [`115b330`](https://github.com/mw00/project-maya/commit/115b3305744f32b0390b3ea13bbe34ccab4f902e) Windows: the engine waits for QUIT on Ctrl+C and Ctrl+Break, so a stop keeps its conversation ### 📊 Changes **2 files changed** (+12 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/ds4/ds4_main.cpp` (+5 -0) 📝 `src/program/generate.cpp` (+7 -0) </details> ### 📄 Description > [!NOTE] > Claude Opus 5.5 found this while testing `MAYA_GLM_SLOT_KEEP` on my PC, wrote this fix and tested it there. It also wrote the text below. Fixes #576. On Windows the engine now ignores Ctrl+C and Ctrl+Break in serve mode, as it already ignores SIGINT and SIGTERM on Linux. The server still stops on them and ends the engine with QUIT, so with `MAYA_GLM_SLOT_KEEP=1` the engine writes the conversation in the model before it ends. The problem and the measurements are in #576. No new setting. **What changes:** - `src/program/generate.cpp`: the POSIX block at the start of `glm_pack_generate` gets an `#else`. In serve mode the engine ignores `SIGINT` and `SIGBREAK`, which the C runtime on Windows raises for the console's Ctrl+C and Ctrl+Break. - `src/ds4/ds4_main.cpp`: the same in `serve`, and as on Linux only while it keeps conversations. **What stays as it is:** The server handles the stop as before. The first Ctrl+C or Ctrl+Break stops it and it ends the engine with QUIT, and an engine that has not ended after `MAYA_ENGINE_QUIT_S` is killed. If the server ends without QUIT (a second Ctrl+C), the engine still ends when its input closes. Linux builds are unchanged, the new code is in the `_WIN32` branch only. **Before and after:** In #576 (v1.1.27, 2 runs each), after a Ctrl+Break stop and a restart the conversation that was in the model was read again from token 0 without the fix (7.8 s) and reused with it (6,164 of 6,206 tokens, 2.0 s). On this branch (v1.1.35, one run each): without the fix 0 of 6,206 reused, 14.2 s; with it 6,164 of 6,206, 3.4 s. All reads were slower in this run than in #576, in both builds alike (the first read of the prompt took 14 to 16 s). **Output:** Unchanged, only the stop is touched. **Tests:** - `tools/check_hip_compat.py`: OK, on main and with this PR. - Server tests, as in tests.yml: 463 OK and 12 skipped, the same on main. - Installer and tools tests: 584 with 31 skipped and 1 error, the same on main. The error is `test_ds4_engram_ram`, which needs a process without CAP_IPC_LOCK. - Windows build of `maya` and `maya-ds4` (MSVC 19.44, CUDA 13.4), and the Ctrl+Break runs above with `maya` on an RTX 5090. - Not tested: Ctrl+C (same path, SIGINT), `maya-ds4` runs (it builds), the Windows AMD build. My setup: Maya v1.1.35 built from source, MSVC 19.44, CUDA 13.4, RTX 5090 32 GB, 64 GB DDR5, Ryzen 9 9950X3D2, Windows 11, Maya-S-v2 IQ2_XXS --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:27:33 +07:00
Sign in to join this conversation.
No labels
pull-request
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
mw00/project-maya#621
No description provided.