PyCForge 1.3.0 — memory, idle activity and concurrency audit
14 October 2026

The complete application retains advanced conversion/editor work, PCFC11 and
module fixes. Specific ownership, cancellation and shutdown problems are fixed.
This is not a claim that every workload is leak-free. Measurements used Linux
x64, Python 3.12.14, PySide6 6.12.0 and Qt offscreen. Battery watts/runtime and
native Windows behavior were not measured.

RESOURCE CHANGES INCLUDED

Conversion supervision:
- One active child and one latest pending request per supervisor. The newer
  shared admission budget for expensive background work remains in place:
  normally two participating jobs, one on sufficiently small machines. This
  is not a global thread limit; file services and builds have separate bounds.
- Empty supervisors wait for notification without periodic timeouts, removing
  the old 100-Hz idle polling. Active work still uses bounded supervision.
- Cancel, supersede and close also cover request encoding and process startup.
- One transport thread and one queued frame bound conversion pipe delivery.
  The coordinator can stop a child stalled before reading or during a partial
  reply. Malformed output and startup exceptions reclaim child/pipe resources.
- Children are joined and process handles closed. Idle service frames release
  completed source payloads; retired work retains its Future, not the whole job.
- close(wait=True) still joins after an earlier nonwaiting close. I/O joins
  share one total timeout; search cannot join its own thread.

Qt lifecycle and idle work:
- Temporary settings/About/file dialogs are disposed after completion. About
  telemetry stops while hidden. Dialog cycles no longer accumulate owned
  dialogs, file watchers and timers in the measured workload.
- One build dialog is deliberately reused, with its elapsed timer stopped
  while hidden/idle. Its 250 ms update runs only during a build. Signals carry
  source-state changes and cancel builds made stale by source edits.
- A build QThread remains owned until its finished callback, preventing a
  restart while the previous worker is being retired. Finished workers are
  disposed; application close cancels and follows the completion path.
- File previews use two bounded daemon workers with eight queued jobs, outside
  Qt's global pool. Dismissed previews cancel queued work and discard obsolete
  results. A blocked filesystem read may occupy a bounded worker but cannot
  keep the interpreter alive through Qt's pool.
- Cancelled startup now finishes and disposes its modal dialog. Previously,
  close() requested cancellation again and could leave the modal window alive,
  blocking later keyboard shortcuts. The reproduced regression now passes.

Memory and editing:
- Workspace reads reject nonregular files and inputs exceeding 16 MiB before
  allocation; reads are capped at limit+1 if the file grows. POSIX FIFO opens
  are nonblocking and rejected. UTF-8/universal-newline behavior and existing
  atomic-save permission/symlink behavior remain intact. This is a per-file
  input limit, not a whole-process RSS quota.
- The newer byte-budgeted analysis/position caches, immutable snapshots,
  close-time eviction and deferred passive work remain intact. Outline parsing
  uses a cancellable spawned process; editing tools have a process deadline
  and a 60-second idle retirement timer. Qt updates use signal delivery.
- Runtime C retains its context-owned arena. The new executable adapter calls
  pv_destroy after success, runtime errors and invalid entry return types.
- Tests cover stale callbacks, partial frames, startup cancellation, process
  reaping, blocked preview shutdown, module replacement, compiler output floods
  and timeout/cancellation of compiler descendants.

DESKTOP MEASUREMENTS

tools/profile_resources.py ran full startup readiness, including NumPy/Numba
warmup; 20 cycles of About/settings/Open dialogs; 20 open/close cycles of a
roughly 50 KB module; and 20 alternating Typed/Runtime conversions.

Phase                         RSS MiB  Python threads  OS threads  FDs
Startup                        286.16       9              29      11
After 20 dialog cycles         290.73       9              29      11
One retained hidden build UI   290.86       9              29      11
After 20 module open/closes    297.51       9              29      12
After 20 conversions           301.83      10              30      15
After workspace/controller close
                               298.92       1              21      11

Temporary owned dialogs after dialog cycles: 0. Hidden retained build dialogs:
1. Active owned Qt timers after conversion: 0. A transient 350 ms timer was
observed during module activity, but not at final idle. All 20 conversion
workers were reaped; maximum simultaneous conversions was 1; no normal-work
conversion needed forced termination.

Idle CPU as percent of one logical core:
- Empty workspace: 0.142% over 5.23 seconds.
- After dialogs: 0.0107% over 5.26 seconds.
- Converted workspace: 0.00652% over 5.21 seconds.
The conversion supervisor made zero timed idle waits in all three periods.
These short controlled samples show low idle work, not battery-life gains.
Resident numeric/Qt threads can be asleep; thread count alone is not CPU use.

RSS rose about 15.67 MiB through the workload. Dialog cycles 11–20 grew about
0.22 MiB; conversion cycles 11–20 about 0.37 MiB. Handles and threads did not
grow each cycle. This does not show an unbounded per-cycle leak in these paths,
but longer soaks are still needed. Allocators, Qt caches and loaded libraries
can retain RSS after objects are released.

The older 1.2.1 package lacked the newer numeric dependencies and advanced
implementation. Its lower startup RSS is not an equivalent comparison and
must not be presented as an improvement achieved by dropping features.

CONVERSION MEMORY SCALING — REMAINING LIMIT

tools/profile_conversion_memory.py uses full desktop-default observation.
Parent RSS is sampled every 20 ms; each child reports its own Linux VmHWM.
All five tested conversion workers were reaped.

Input                          Child high-water MiB  Parent sampled peak MiB
One typed function                       64.0                    68.6
100 typed functions                      92.4                   109.3
500 typed functions                     198.3                   281.4
750,000 bytes of comment padding         420.4                   145.3
Runtime strings/lists/formatting          68.3                   136.4

The parent sequence retains allocator effects between cases. These are not
five independent cold starts. Parent/child maxima need not coincide, so they
cannot be summed into an exact combined peak or used as memory guarantees.

Source processing, mappings, IR, observation and serialized copies can cost
far more memory than source byte size. Comment-heavy input remains expensive.
This release neither imposes an OS memory quota nor rewrites the advanced
converter's representation. A next allocation-focused pass should measure
individual stages before changing source-position and observation contracts.

Other remaining limits:
- Open documents and Qt undo histories are outside worker cache budgets.
- Runtime values live until context destruction. The default 64 MiB logical
  arena budget is not an RSS quota; long-running generated programs can reach
  it even when Python would collect intermediate objects earlier.
- Some OS filesystem calls cannot be interrupted immediately. Daemon ownership
  bounds the shutdown consequence, not the completion time of every read.
- PCFC11 builds have separate process group/job and reader-thread ownership.
  Linux descendant cleanup is tested; native Windows Job Object behavior is
  preserved but remains a native acceptance item.

VERIFICATION

Final full suite: 1,638 passed; 4,233 subtests passed; 19 skipped; no failures.
The skips are 18 checks requiring absent sealed historical predecessor archives
and one test for the no-PySide6 environment, since PySide6 is installed.
Raw final results: evidence/consolidation/release-suite.log and .xml.

PCFC11 0.1.1 was built from recovered source and used with GCC on Linux. Checks
cover both conversion ABIs, O0/O1, entry statuses/errors, object output and
modules/classes/comprehensions/dictionaries/sorting/formatting/UTF-8 files in
one compiled runtime program. PCFC11 remains installed separately.

Narrow Windows UCRT compatibility headers under build/windows_include supply
runtime declarations missing from PCFC11 0.1.1. Windows x64 assembly generation
passes at O0/O1; native Windows linking/execution remains unverified.

Installed-wheel checks exercise actual site-packages code: version, startup,
dependencies, both conversion modes, all 21 Help pages, editor services and a
three-module file example. Its output bytes match Python and the documentation.
The source inventory preserves all newer paths and all implementation/test
paths from both snapshots. All 14 runtime converter files remain byte-identical.
No PyPI publication was performed.

REPRODUCE

From the extracted source root after installing the supplied wheel/dependencies:
  python -m pytest -q
  python tools/profile_resources.py --offscreen --output resource-profile.json
  python tools/profile_conversion_memory.py --output conversion-memory.json
Set PCFC11_PATH to include native compiler cases. Omit --offscreen for a native
Windows desktop profile. The child high-water conversion probe is Linux-only.
Native Windows, longer suspend/resume soaks and physical laptop energy checks
remain listed in the accompanying acceptance checklist.

FINAL INSTALLED BUILD

The final wheel also passed 35 installed-package PCFC11/dialog/module
regressions and 8 subtests, plus the full installed editor/startup/Help probe.
Logs: final-installed-regressions.log/.xml and final-installed-editor.log.
