Repository navigation
Rework action pipe transport and serve the kernel UI over a private pipe - #708
Open
markgalvan-intel wants to merge 1 commit into
Open
markgalvan-intel wants to merge 1 commit into
markgalvan-intel wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-process inheritance and shutdown require Windows validation and human review, with a transport timeout correction still outstanding.
What changed in this PR
Reworks action transport across the service, middleware, kernel, and UI around single duplex connections and explicit session lifetimes.
Changes:
- Adds packet routing, bounded deadlines, admission controls, and coordinated shutdown.
- Moves the kernel connection into the UI browser process using inherited private pipe handles.
- Removes service log-pipe options and adds transport regression coverage.
| File | Description |
|---|---|
| Tests/ensure-aux.ps1 | Explicitly imports PowerShell utilities. |
| PresentMonService.args.json | Removes obsolete logging option. |
| IntelPresentMon/UnitTests/UnitTests.vcxproj.filters | Lists hotkey tests. |
| IntelPresentMon/UnitTests/UnitTests.vcxproj | Includes hotkey tests. |
| IntelPresentMon/UnitTests/HotkeyTests.cpp | Tests binding cleanup and replacement. |
| IntelPresentMon/UnitTests/CMakeLists.txt | Builds hotkey tests. |
| IntelPresentMon/PresentMonService/testing/TestControl.h | Adds transport status access. |
| IntelPresentMon/PresentMonService/testing/TestControl.cpp | Reports session and acceptor counts. |
| IntelPresentMon/PresentMonService/PresentMonService.args.json | Removes obsolete logging option. |
| IntelPresentMon/PresentMonService/PMMainThread.cpp | Drains transport before stopping traces. |
| IntelPresentMon/PresentMonService/LogSetup.cpp | Removes service log-pipe publishing. |
| IntelPresentMon/PresentMonService/GlobalIdentifiers.h | Removes log-pipe identifier. |
| IntelPresentMon/PresentMonService/CliOptions.h | Removes log-pipe options. |
| IntelPresentMon/PresentMonService/acts/OpenSession.h | Updates session logging. |
| IntelPresentMon/PresentMonService/ActionServer.h | Exposes shutdown and transport status. |
| IntelPresentMon/PresentMonService/ActionServer.cpp | Implements server lifecycle wrappers. |
| IntelPresentMon/PresentMonService/ActionExecutionContext.h | Adds teardown-aware disposal contract. |
| IntelPresentMon/PresentMonService/ActionExecutionContext.cpp | Makes cleanup conditional on session state. |
| IntelPresentMon/PresentMonMiddleware/SharedServicePipeVerification.h | Includes connector dependency explicitly. |
| IntelPresentMon/PresentMonMiddleware/MiddlewareExecutionContext.h | Simplifies session context. |
| IntelPresentMon/PresentMonMiddleware/ActionClient.h | Uses updated connector accessor. |
| IntelPresentMon/PresentMonAPI2Tests/UiLaunchTests.cpp | Checks private UI pipe usage. |
| IntelPresentMon/PresentMonAPI2Tests/TransportWriteDeadlineTests.cpp | Tests request and write deadlines. |
| IntelPresentMon/PresentMonAPI2Tests/TransportTestKit.cpp | Registers transport test actions. |
| IntelPresentMon/PresentMonAPI2Tests/TransportSessionTests.cpp | Tests admission and session policies. |
| IntelPresentMon/PresentMonAPI2Tests/TransportPairedTests.cpp | Tests paired sessions and inheritance. |
| IntelPresentMon/PresentMonAPI2Tests/TransportDemuxTests.cpp | Tests routing and command tokens. |
| IntelPresentMon/PresentMonAPI2Tests/TestProcess.h | Exposes test control-pipe name. |
| IntelPresentMon/PresentMonAPI2Tests/TestCommands.h | Adds transport health fields. |
| IntelPresentMon/PresentMonAPI2Tests/RawPipeClient.h | Adds raw transport test client. |
| IntelPresentMon/PresentMonAPI2Tests/PresentMonAPI2Tests.vcxproj.filters | Lists new transport tests. |
| IntelPresentMon/PresentMonAPI2Tests/PresentMonAPI2Tests.vcxproj | Includes new transport tests. |
| IntelPresentMon/PresentMonAPI2Tests/PipePairTests.cpp | Tests pipe pairs and timed locks. |
| IntelPresentMon/PresentMonAPI2Tests/MultiClientTests.cpp | Adds service transport abuse tests. |
| IntelPresentMon/PresentMonAPI2Tests/CMakeLists.txt | Builds transport regression tests. |
| IntelPresentMon/PresentMonAPI2Tests/ActionRunnerTests.cpp | Tests deferred dispatch admission. |
| IntelPresentMon/KernelProcess/winmain.cpp | Creates inherited UI pipes and coordinates teardown. |
| IntelPresentMon/KernelProcess/KernelProcess.args.json | Removes service log-pipe option. |
| IntelPresentMon/KernelProcess/kact/KernelExecutionContext.h | Clears hotkeys when sessions end. |
| IntelPresentMon/Interprocess/source/act/Transfer.h | Routes responses and applies deadlines. |
| IntelPresentMon/Interprocess/source/act/SymmetricActionClient.h | Adds gated dispatch and explicit lifecycle. |
| IntelPresentMon/Interprocess/source/act/SessionLimits.h | Defines admission and handshake limits. |
| IntelPresentMon/Interprocess/source/act/SessionEndReason.h | Defines session disposition and cleanup policy. |
| IntelPresentMon/Interprocess/source/act/ServerSendPolicy.h | Declares server send policies. |
| IntelPresentMon/Interprocess/source/act/ResponseRouter.h | Defines pending-response routing contracts. |
| IntelPresentMon/Interprocess/source/act/Packet.h | Introduces protocol version 2 and bounds. |
| IntelPresentMon/Interprocess/source/act/Lifecycle.h | Tracks shutdown phases and completion. |
| IntelPresentMon/Interprocess/source/act/CommandTokenAllocator.h | Allocates available routing tokens. |
| IntelPresentMon/Interprocess/source/act/AsyncAction.h | Applies response write deadlines. |
| IntelPresentMon/Interprocess/source/act/AdmissionGate.h | Coordinates dispatch admission with shutdown. |
| IntelPresentMon/Interprocess/source/act/ActionServerShutdown.h | Orders server and trace teardown. |
| IntelPresentMon/Interprocess/source/act/ActionRunner.h | Shares dispatch and runner shutdown helpers. |
| IntelPresentMon/Interprocess/source/act/ActionContext.h | Defines transport context requirements. |
| IntelPresentMon/Core/source/win/HotkeyListener.h | Declares stop and binding cleanup APIs. |
| IntelPresentMon/Core/source/win/HotkeyListener.cpp | Implements listener shutdown and cleanup. |
| IntelPresentMon/Core/source/infra/LogSetup.cpp | Updates pipe availability call. |
| IntelPresentMon/Core/source/cli/CliOptions.h | Removes service log-pipe options. |
| IntelPresentMon/CommonUtilities/pipe/SecurityMode.h | Removes obsolete security modes. |
| IntelPresentMon/CommonUtilities/pipe/Pipe.h | Adds framing limits and timed writes. |
| IntelPresentMon/CommonUtilities/pipe/Pipe.cpp | Implements private pairs and cancellation. |
| IntelPresentMon/CommonUtilities/pipe/ManualAsyncEvent.h | Adds persistent signaling and timeouts. |
| IntelPresentMon/CommonUtilities/pipe/CoroMutex.h | Declares timed, cancellable locking. |
| IntelPresentMon/CommonUtilities/pipe/CoroMutex.cpp | Implements waiter ownership and cancellation. |
| IntelPresentMon/AppCef/source/winmain.cpp | Owns kernel connection in browser process. |
| IntelPresentMon/AppCef/source/util/SignalManager.h | Declares relayed signal handling. |
| IntelPresentMon/AppCef/source/util/SignalManager.cpp | Dispatches browser-forwarded signals. |
| IntelPresentMon/AppCef/source/util/LogSetup.cpp | Updates pipe availability call. |
| IntelPresentMon/AppCef/source/util/KernelWrapper.h | Stores renderer-side kernel versions. |
| IntelPresentMon/AppCef/source/util/KernelRelay.h | Defines browser-renderer relay contracts. |
| IntelPresentMon/AppCef/source/util/KernelRelay.cpp | Forwards calls, replies, and signals. |
| IntelPresentMon/AppCef/source/util/KernelLink.h | Declares browser-owned kernel connection. |
| IntelPresentMon/AppCef/source/util/KernelLink.cpp | Adopts inherited handle and opens session. |
| IntelPresentMon/AppCef/source/util/KernelActionRegistration.cpp | Registers both relay endpoints. |
| IntelPresentMon/AppCef/source/util/IpcInvocationManager.h | Converts renderer invocations into relay calls. |
| IntelPresentMon/AppCef/source/util/IpcInvocationManager.cpp | Tracks calls and resolves replies. |
| IntelPresentMon/AppCef/source/util/CliOptions.h | Replaces pipe name with inherited handle. |
| IntelPresentMon/AppCef/source/util/cact/TargetLostAction.h | Relays target-loss events. |
| IntelPresentMon/AppCef/source/util/cact/StalePidAction.h | Relays stale-process events. |
| IntelPresentMon/AppCef/source/util/cact/PresentmonInitFailedAction.h | Relays initialization failures. |
| IntelPresentMon/AppCef/source/util/cact/OverlayDiedAction.h | Relays overlay-exit events. |
| IntelPresentMon/AppCef/source/util/cact/HotkeyFiredAction.h | Relays hotkey events. |
| IntelPresentMon/AppCef/source/util/cact/CefExecutionContext.h | Uses browser-side signal relay. |
| IntelPresentMon/AppCef/source/util/async/GetAppInfo.h | Reads relayed kernel version metadata. |
| IntelPresentMon/AppCef/source/util/ActionClientServer.h | Accepts a connected pipe handle. |
| IntelPresentMon/AppCef/source/util/ActionClientServer.cpp | Initializes client from inherited connection. |
| IntelPresentMon/AppCef/source/NanoCefProcessHandler.cpp | Handles renderer replies and signals. |
| IntelPresentMon/AppCef/source/NanoCefBrowserClient.h | Declares kernel relay attachment. |
| IntelPresentMon/AppCef/source/NanoCefBrowserClient.cpp | Routes messages through kernel relay. |
| IntelPresentMon/AppCef/source/DataBindAccessor.cpp | Removes unused transport includes. |
| IntelPresentMon/AppCef/CMakeLists.txt | Builds kernel link and relay. |
| IntelPresentMon/AppCef/CefNano.vcxproj | Includes kernel link and relay files. |
| cmake/PresentMonCTest.cmake | Classifies private-pipe UI test. |
Review effort: Balanced
markgalvan-intel
force-pushed
the
pipe-update
branch
from
October 21, 2026 15:46
bc5d203 to
9014734
Compare
markgalvan-intel
force-pushed
the
pipe-update
branch
from
October 21, 2026 16:58
9014734 to
5301090
Compare
markgalvan-intel
force-pushed
the
pipe-update
branch
from
October 21, 2026 20:16
5301090 to
895f3da
Compare
Each action session now runs over a single duplex pipe instead of separate in and out pipes. Requests, responses and pushed events share that pipe and are demultiplexed by packet type and command token, with response timeouts and bounded handling of late responses. Clients and servers have an explicit lifecycle (Running, Stopping, Stopped): dispatches are admitted through a gate, shutdown waits for in-flight work and joins its runner rather than detaching it, and every session ends with a recorded reason before it is disposed. Server send policies (request-response, single peer, addressed, paired) are declared in the type; the server enforces a session cap and a handshake deadline, ends any connection that acts before OpenSession, and logs the system-reported client pid. Every pipe write has one deadline covering the wait for the write lock and the write itself: a write that stalls part way ends the session as PeerStalled, while one that times out before sending anything fails only that request. The kernel no longer publishes a connectable pipe for its UI; for each UI launch it creates a single-instance pipe pair, connects both ends itself, and passes the client end to PresentMonUI by handle inheritance, and the UI browser process owns that connection and relays page calls and kernel events to the renderer. The service log pipe and its command line options are removed, --p2c-act-name is replaced by --p2c-act-handle, and the packet header version is now 2, so builds from before this change cannot connect to it.
markgalvan-intel
force-pushed
the
pipe-update
branch
from
October 21, 2026 21:27
895f3da to
f189e7a
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The protocol replacement, cross-process handle inheritance, and asynchronous shutdown redesign require final human review supported by native Windows integration test results.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
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.


Each action session now runs over a single duplex pipe instead of separate in and out pipes. Requests, responses and pushed events share that pipe and are demultiplexed by packet type and command token, with response timeouts and bounded handling of late responses. Clients and servers have an explicit lifecycle (Running, Stopping, Stopped): dispatches are admitted through a gate, shutdown waits for in-flight work and joins its runner rather than detaching it, and every session ends with a recorded reason before it is disposed. Server send policies (request-response, single peer, addressed, paired) are declared in the type; the server enforces a session cap and a handshake deadline, ends any connection that acts before OpenSession, and logs the system-reported client pid. Every pipe write has one deadline covering the wait for the write lock and the write itself: a write that stalls part way ends the session as PeerStalled, while one that times out before sending anything fails only that request. The kernel no longer publishes a connectable pipe for its UI; for each UI launch it creates a single-instance pipe pair, connects both ends itself, and passes the client end to PresentMonUI by handle inheritance, and the UI browser process owns that connection and relays page calls and kernel events to the renderer. The service log pipe and its command line options are removed, --p2c-act-name is replaced by --p2c-act-handle, and the packet header version is now 2, so builds from before this change cannot connect to it.