A tracked game keeps its status through the first below-threshold scan and loses it on the second consecutive one; memory back at or above the threshold resets the wait. Mode stays on while any game remains.
Processes whose priority cannot be changed are still added to the blocklist, but the failure is no longer written to the log. README log contract updated.
Name the process that opens game mode, keep the game first in the set block, and close the block with 'game mode enabled'. Log 'disabling game mode' before restores and 'game mode disabled' after them; the opening marker is not repeated while a restore is retried. Update README log contract.
- Remove promoted map entirely — processes are demoted when RSS < -mem
and promoted when RSS >= -mem, no permanent state
- Remove trySetPrio closure — use setPrio directly for simplicity
- Remove curPrioWithHandle helper — inline procGetPriority.Call
- Remove GAME ... tracked as game (blocked) repeated log — log once
on detection via GAME DETECT, silently skip on subsequent scans
- Game mode: log GAME DETECT once when process first exceeds game-mem
- gameSaved stores original priority before IDLE demote, restores on
GAME MODE OFF or shutdown
- Delay between priority changes: 100ms
- Delete TZ.md (was a test for other AI)
Previously, once a process was promoted to HIGH, it stayed HIGH forever
even if its RSS dropped well below the -mem threshold. Now promoted
processes are demoted back to NORMAL when RSS < -mem, and removed from
the promoted map.
Also: added TZ.md with full technical specification of the project.
Previously, when SetPriorityClass failed for a process (e.g. anti-cheat),
it was added to 'blocked' and completely skipped in future scans —
including RSS measurement. This meant a game that started below game-mem
threshold and got blocked before reaching it would never trigger game mode.
Now pass 1 measures RSS for ALL processes (including blocked ones) and
adds them to gameProcs if they exceed game-mem. Pass 2 skips priority
changes for blocked processes but still tracks them as game processes.
In game mode, blocked game procs log 'tracked as game (blocked)' instead
of trying SetPriorityClass again.
- Use PROCESS_QUERY_LIMITED_INFORMATION instead of PROCESS_QUERY_INFORMATION
to open processes (fixes Access Denied for KeePassXC, HD-Player, etc.)
- Separate query handle from set handle: trySetPrio reopens with
PROCESS_SET_INFORMATION only when needed
- Two-pass scan: pass 1 collects RSS and detects game processes,
pass 2 applies priorities with correct hasGame state
- Game mode saves original priorities in gameSaved map, restores them
on GAME MODE OFF (not just NORMAL)
- Demote ALL non-game processes to IDLE in game mode (not just promoted)
- 50ms delay between priority changes for smooth transitions
- Replace isAlive/procName with pidMap from allProcs snapshot
- Replace mutex/MessageBox single-instance with killOtherInstances
- Defaults: -mem=512M, -game-mem=4G
- Fix double CloseHandle and handle leak in trySetPrio
- Update README with new defaults and game mode restoration behavior