Commit Graph

22 Commits

Author SHA1 Message Date
PrimeBuild-pc 20abf7006c fix: issues found testing the beta in a clean Windows 11 VM
- Process counter could show more visible processes than the total
  ('157 / 151'): the batch total was a snapshot from the first load.
- Narrow windows (or 150% scaling): toolbar buttons move under the search
  box instead of squeezing it to a few letters.
- Rules list keeps the 'Applies' column readable when narrow.
- Settings status message gets its own line instead of being cut.

Tested in a Hyper-V Windows 11 VM: clean install, upgrade, uninstall,
light and dark theme, 100% and 150% scaling.
2026-10-14 18:42:05 +02:00
PrimeBuild-pc 5d19a46fc1 feat: per-process efficiency mode (EcoQoS) for live processes and rules
Closes #66.

- Native: SetProcessInformation/GetProcessInformation with
  ProcessPowerThrottling (EXECUTION_SPEED), three states: Windows decides,
  On (EcoQoS), Off (never throttle / HighQoS).
- Process tab: context menu entries, a picker with Apply in the details
  panel, current state in the summary, undo of the last change, included
  when saving current settings as a rule (only if explicitly set).
- Rules: EfficiencyMode + ApplyEfficiencyModeOnStart, applied by the rules
  engine, editable in the saved-rule editor, validated on import and part
  of conflict detection.
- The summary flags when the global Power Throttling tweak voids it. CPU
  priority is left alone, unlike Task Manager's efficiency mode.
- Localized in all seven languages.
2026-10-14 17:16:36 +02:00
PrimeBuild-pc 2eeec21702 feat: clearer process and rule editors
- Process details: CPU, memory and I/O priority pickers with an explicit
  Apply, undo of the last manual priority change (guarded against reused
  PIDs), adaptive side/bottom details panel.
- Manual process control stays available while automation is paused, with
  a persistent notice instead of an overlay.
- Saved-rule editor stages all edits (including the core mask) and saves
  them together, showing pending changes.
- Localized the new strings in all seven languages.
2026-10-14 17:06:42 +02:00
PrimeBuild-pc df23cd1be9 fix: buttons that do what they say, and rules you can actually see
Three findings from a pass over the main dashboard.

"+ Custom" in the affinity picker did nothing at all. CreateCustomMask was
searching the visual tree for a TabControl and setting SelectedIndex; the
window has been a NavigationView for several versions, so the search returned
null - no navigation, no error, no feedback. It now raises OpenMasksRequested,
mirroring the OpenRulesRequested event the window already handles. The dead
FindVisualChild helper goes with it.

Clearing CPU Sets left the core chips advertising the assignment that had just
been removed until the process happened to be reselected - and a rule saved in
between would have captured those cores.

Rules saved from the Process tab context menu were invisible: nothing listed
them, and the Rules tab shows power plan associations, which are a different
thing entirely. They now have their own tab there, saying in plain words what
each rule applies and how it differs from the associations, with a delete that
shares one implementation with the context menu path so the two can never
disagree about which rule belongs to a process. The list is re-read on every
visit to the tab, which is enough while the two views cannot be on screen at
the same time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 23:38:13 +02:00
PrimeBuild-pc c8826547e2 bug fix v1.7.3 2026-08-26 23:38:13 +02:00
PrimeBuild-pc 451fe1cc1c fix: correct CPU Set resolution, Automatic conflicts, and affinity UI hints
Follow-ups to the affinity apply fix, from a second review pass.

CpuSetMapping.ResolveCpuSetIds trusted the raw CpuSetIds stored with a saved
rule ahead of the selection's logical processors. Those IDs are opaque and can
name a different processor after a topology change, while GetProcessDefaultCpuSets
still verifies them, so a stale rule silently pinned the wrong CPUs. Coordinates
are now resolved against the current mapping whenever they exist, and every one
must resolve - a partial match surfaces as InvalidTopology instead.

Automatic mode attempted CPU Sets even when the process already had a hard
affinity mask excluding the requested CPUs. Windows will not schedule outside
that mask whatever default CPU Sets are installed, yet the read-back still
verifies, so ThreadPilot reported success for an assignment that could not take
effect. It now goes straight to the hard affinity path in that case, which
actually replaces the restriction. Verified end to end: a process pinned to
0x3 targeting CPUs 4-5 now moves to 0x30 instead of silently staying at 0x3.

Affinity masks are 64-bit patterns, not magnitudes: a mask including CPU 63 is
a negative long, and the "> 0" comparisons discarded it. Replaced with
comparisons against zero so 64-CPU single-group systems are handled.

The per-CPU checkboxes stay read-only by design, but nothing said so, and the
hint first landed in the Grid.Column="2" pane that has been Visibility="Collapsed"
since 91287c9. The hint and tooltips now sit in the visible Advanced Affinity
Picker expander. Context menu rule items explain that saved rules are re-applied
automatically on process start and are separate from the Rules tab.

Also removes ApplyCoreMaskToProcessAsync, which had no RelayCommand attribute
and no callers, corrects an audit message that claimed CPU Sets had failed when
they were deliberately skipped, and fixes "core mask" mistranslations in the
Italian, Spanish, French and Russian locales plus German phrasing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhS1xyuMPFvxrojERQ4NuY
2026-08-26 14:26:11 +02:00
PrimeBuild-pc 2ee397ac83 fix: apply real CPU affinity when a rule is applied
A user reported that the CPU affinity feature did nothing when applying a
rule. Two distinct defects were behind it.

ProcessService.SetProcessorAffinity(process, long) silently substituted
SetProcessDefaultCpuSets for the hard affinity write. CPU Sets are only a
soft scheduling hint and leave the mask returned by GetProcessAffinityMask
untouched, so the single caller - AffinityApplyService.ApplyAsync, which
reads the mask back and compares - always reported VerificationMismatch.
The Rules tab path (ProcessMonitorManagerService association core masks)
therefore failed while the affinity never changed. Reproduced on a 16-CPU
machine: requesting 0x3 left the process at 0xFFFF and returned a failure.
The overload now writes the affinity mask it was asked for; soft assignment
keeps its own entry points (CpuAssignmentMode.CpuSets, CpuSelectionAffinityApplier).

The shipped DefaultCpuAssignmentMode was Automatic, which is CPU-Sets-first,
so out of the box "Apply CPU Assignment" produced no change visible in Task
Manager while reporting success. The default is now AffinityMask, and the
CPU Sets result message states that it is a soft preference rather than
claiming "Affinity applied successfully".

Save Current Settings as Rule only captured the core selection while edits
were staged, otherwise falling back to process.ProcessorAffinity - which
soft modes never change - saving a rule pinned to every CPU. It now captures
what the core checkboxes show.

Adds a regression test that spawns a real process and asserts the hard
affinity mask actually changes; it fails on the previous implementation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhS1xyuMPFvxrojERQ4NuY
2026-08-26 14:26:11 +02:00
Prime Build d730260541 Prepare ThreadPilot 1.7.0 gaming and signing release (#51) 2026-08-13 01:50:48 +02:00
PrimeBuild-pc 7381a68dbd Release ThreadPilot 1.6.0 CPU assignment modes 2026-08-12 14:58:23 +02:00
PrimeBuild-pc 9f7ba5e4af Fix persistent automation monitoring preference 2026-08-03 17:38:45 +02:00
Prime Build 9553bfd20d Complete measured runtime overhead reductions (#36)
* perf: defer inactive view initialization

* perf: eliminate redundant powercfg refreshes

* perf: suspend hidden log updates

* perf: back off WMI recovery

* perf: reuse static process metadata

* test: cover low-overhead runtime policies
2026-07-12 08:54:30 +02:00
Prime Build fbfe010fb0 Fix persistent priority reversion after process startup (#33) 2026-07-11 19:17:24 +02:00
Prime Build 7953fc7774 Refactor repo with ponytail cleanup (#31) 2026-06-24 17:52:45 +02:00
Prime Build 91287c9860 Fix startup binding and prepare v1.2.0 pre-release (#22)
* Fix startup binding and prep v1.2.0

* Polish v1.2.0 validation UX

* Fix final v1.2.0 validation polish

* Make Activity Logs a ThreadPilot audit trail

* Fix high scheduling registry value

* Polish process list and automation settings UX

* Fix process context menu separator styling

* Theme process context menu visuals

* Stabilize process context menu styling

* Remove process menu icon gutter

* Polish startup and idle process refresh

* Finalize PR22 release polish
2026-05-23 14:28:24 +02:00
Prime Build dd45b38007 Add Apply now and save as rule flow (#20)
Add Apply now and save as rule flow

Add explicit opt-in persistent rule creation from Process tab actions.

- Add ProcessRuleCreationService for creating/updating persistent process rules
- Add Rules submenu with Save Current Settings as Rule and Apply Affinity and Save as Rule
- Match existing rules by executable path or process name fallback to avoid duplicates
- Preserve rule Id and CreatedAt when updating existing rules
- Prefer CpuSelection and only save legacy affinity when safely representable
- Avoid saving Normal CPU priority from automatic current-state capture
- Block Realtime priority and unsafe affinity persistence with controlled messages
- Save memory priority when known
- Keep existing normal context actions from creating persistent rules
- Add tests for create/update, path/name matching, CpuSelection, legacy safety, priority capture, memory priority, no-action failure and ViewModel commands

No full rules editor, modal confirmation flow, registry/IFEO, Windows Service, diagnostics changes, version bump or tag changes.
2026-05-22 12:00:09 +02:00
Prime Build b45fcf16f1 Add Process tab context menu actions (#19)
Add Process tab context menu actions

Add a lightweight right-click context menu to Process tab rows using existing safe process action paths.

- Add row context menu for Process tab DataGrid rows
- Add row-specific Apply Affinity command using ProcessAffinityApplyCoordinator
- Add Clear CPU Sets action using the safe CPU Sets clear path
- Add CPU priority actions while keeping Realtime blocked
- Add memory priority actions through ProcessMemoryPriorityService
- Add Open Executable Location, Copy Process Info and Refresh Process Info actions
- Refresh selected-process summary after context actions
- Keep context menu actions from creating persistent rules
- Add tests for row-specific affinity, CPU priority, memory priority, copy/open/refresh, CPU Sets clear and no rule creation

No save-as-rule flow, rules editing UI, persistent rule creation, affinity core changes, memory-priority backend changes, diagnostics changes, version bump or tag changes.
2026-05-22 00:52:38 +02:00
Prime Build 6eec1bab3f Add selected process summary to Process tab (#18)
Add selected process summary to Process tab

Add a lightweight current-process status strip under the Process tab process list without reintroducing dashboard-style monitoring.

- Add SelectedProcessSummaryViewModel populated from selected ProcessModel data
- Show selected process name, PID, path, CPU priority, memory priority, affinity, rule status, CPU usage and memory usage
- Read memory priority once on selection when available
- Check saved persistent rule status through the existing rule store and matcher
- Avoid PerformanceMonitoringService, diagnostics/live monitoring and timers
- Guard async summary updates so stale memory/rule lookups cannot overwrite newer selections
- Update summary after refreshed process fields only when the selected process is still current
- Add tests for no-selection state, selection changes, memory priority, rule status, no performance dependency and stale async update protection

No context menu, save-as-rule flow, rules editing UI, diagnostics redesign, background monitoring, version or tag changes.
2026-05-22 00:23:35 +02:00
Prime Build cbe2402f1b Migrate Process tab manual affinity apply to CpuSelection (#16)
Migrate Process tab manual affinity apply to CpuSelection

Route manual Process tab affinity operations through a topology-aware coordinator so CpuSelection and CPU Sets are preferred over legacy long masks.

- Add ProcessAffinityApplyCoordinator for manual Process tab affinity apply
- Prefer CoreMask.CpuSelection when available
- Migrate legacy BoolMask selections to CpuSelection when topology is available
- Block unsafe legacy fallback for selections above CPU64
- Keep legacy long mask fallback only for safe single-group <=64 selections
- Wire SetAffinity, ApplyCoreMaskToProcessAsync and QuickApplyAffinityAndPowerPlan through the coordinator
- Document CoreMask.ToProcessorAffinity as legacy-only
- Ensure ProcessViewModel fallback coordinator receives topology provider
- Add regression tests for CPU64, multi-group, safe legacy fallback, migration and protected-process messages

No UI redesign, preset generator, memory priority, persistent rules engine, migration logic, version or tag changes.
2026-05-20 22:25:34 +02:00
Prime Build 9f56303e93 CPU topology v2 phase 7: improve affinity errors and priority guardrails (#13)
Improve affinity errors and priority guardrails

Centralize safe user-facing messages for process affinity, CPU Sets, protected processes, access denied cases, topology errors and priority guardrails.

- Add CpuSetApplyResult detailed path while preserving existing bool CPU Sets APIs
- Use detailed CPU Sets results in the CpuSelection affinity flow
- Centralize affinity/priority messages in ProcessOperationUserMessages
- Improve AccessDenied, anti-cheat/protected, invalid topology, process exited and legacy fallback blocked messages
- Add High priority warning
- Block Realtime priority for direct apply, profile load and registry priority requests
- Audit and log blocked Realtime priority attempts
- Prevent critical status messages from being cleared immediately
- Add tests for affinity messages, CPU Sets detailed failures, priority guardrails and status clearing

No persistent rules engine, registry affinity, preset/profile migration, version or tag changes.
2026-05-20 16:03:34 +02:00
Prime Build 4fceda163d Perf/professional hardening (#4)
* Improve background refresh and process detection

* Harden affinity and power plan automation

* Fix passive process refresh failures

* Improve UX terminology and process layout

* Polish UX layout and empty states

* Expand core service test coverage
2026-05-09 23:15:49 +02:00
PrimeBuild-pc 2382c47789 Reduce background refresh overhead 2026-05-09 12:02:42 +02:00
PrimeBuild-pc 594a3c4b85 Refactor MainWindow behaviors into partial class
Move and centralize MainWindow behavior/logic into a new partial file and tidy related viewmodel/service code.

- Add MainWindow.Behaviors.partial.cs containing initialization, loading overlay, view model loading, service setup, system tray management, monitoring lifecycle, keyboard shortcuts, elevation/performance overlays, graceful shutdown and related helpers (moved out of MainWindow.xaml.cs).
- Remove duplicated behavior code from MainWindow.xaml.cs.
- Add ProcessViewModel.Behaviors.partial.cs and update ViewModels/ProcessViewModel.cs to separate behavior logic from core viewmodel.
- Update Models/ProcessModel.cs and services (GameDetectionService.cs, ProcessMonitorService.cs, ProcessService.cs) to align with the refactor and improve robustness (timeouts, fallbacks, logging and error handling).

Reason: reduce MainWindow.xaml.cs size, improve separation of concerns and maintainability, and introduce more resilient startup/shutdown and tray/update logic.
2026-04-15 23:13:11 +02:00