Repository navigation
Active page files: list the kernel's live page files in the commit status line - #174
Merged
Merged
Conversation
…atus line Add commit_memory.active_pagefiles() (NtQuerySystemInformation / SystemPageFileInformation): every page file the kernel has active right now with its live size, use and peak, in bytes, with the same fail-open contract as commit_charge_and_limit / pagefile_breakdown. The registry's PagingFiles value only holds the boot-time configuration: it misses a file activated after boot (NtCreatePagingFile) and records system-managed files with no size. The System metrics window's commit status line now names each active file with its live use (refreshed every tick; the read is ~50 us), flags the registry's system-managed file, and totals the parts; it falls back to the previous registry-based text when the kernel read is unavailable. Parser kept separate (parse_pagefile_information) and struct-tested on every platform. Includes the spec (docs/pytest-fly-active-pagefiles-spec.md). Bumps to v0.10.6. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…orks off Windows too os.path.splitdrive knows drive letters only on Windows; the paths come from the Windows kernel and are Windows paths on every platform (the cross-platform GUI test showed the flag missing on Linux). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #174 +/- ##
==========================================
- Coverage 85.75% 85.67% -0.08%
==========================================
Files 74 74
Lines 6380 6450 +70
==========================================
+ Hits 5471 5526 +55
- Misses 909 924 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
commit_memory.active_pagefiles()->list[PageFileUsage](path, total/in-use/peak bytes,percent), read fromNtQuerySystemInformation(SystemPageFileInformation)(what Task Manager andWin32_PageFileUsageuse, ~50 µs, no privilege/dependency/subprocess). Same fail-open contract as the two existing readers:[]off Windows and on any error, logged once.parse_pagefile_information(buffer, page_size)with fixed-width ctypes structs, so it is unit-tested on every platform without touching the kernel.Pagefile: C:\pagefile.sys 0.6/26.6 GB (2%) system-managed · V:\pagefile.sys 0.1/128.0 GB (0%) (total 154.6 GB). Refreshed every tick. Thesystem-managedsuffix comes from the registry breakdown (a?:entry matches the system drive). When the kernel read returns[]the line is exactly the previous registry-based text.PagingFilesvalue is the boot-time configuration only. It misses a page file activated after boot withNtCreatePagingFileand records system-managed files as?:\pagefile.sys 0 0, so the old line could omit a file and show no size. On this machine the old line showed one file; the kernel reports two.docs/pytest-fly-active-pagefiles-spec.md.pagefile_breakdown()and its callers/tests are untouched. Admission gate and resource guard unchanged.Tests
tests/test_commit_memory.py: parser on a two-entry and a one-entry buffer built with the ctypes structs (chain walk,\??\stripped, pages -> bytes),percentwith a zero total, non-Windows returns[]with no warning, Windows fail-open (invalid information class ->[]twice, one warning), and a live Windows read.tests/test_gui_widgets.py: status line names each active file with its use and the system-managed flag; with the reader patched to[]the line matches the old text (with and without a sample, and with no configured files).ruff check/formatclean;ty check srcdiagnostics unchanged from master.🤖 Generated with Claude Code