Implement the PIX device-session receive stream #241
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!241
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/241/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@bambermf on GitHub · 2026-11-23 06:45 UTC · original
bambermf:port/pix-session-stream→main· +453 −9 · 6 files · 5 commits · closed without mergingLibrary / area — Build 19041 PIX runtime, receive side of XBTP device sessions.
Exports changed — None.
Source of behaviour — Headless IDA MCP on a local 19041 pixrt10.dll. The transport reassembles length-prefixed blocks at RVA
0x2bff8, decodes raw or compressed payloads at0x2c62c, and assembles messages with a 12-byte header. I ran the reference decoder from0x329f0under instruction emulation with synthetic XPRESS inputs produced on Windows.What was missing
The device engine closes an accepted link before reading a tool request. This draft implements and exercises the stream reader needed between acceptance and request dispatch. The device connection routine now passes accepted in-process links to this reader on build 19041.
Measurements
Seven Windows XPRESS inputs decoded to the exact original bytes in the reference decoder. The input payload sizes before compression were 30, 4095, 4096, 4097, 16384, 65536 and 524288 bytes. A separately constructed overlapping match expanded to 35 repeated bytes in both the reference decoder and the new reader.
The change
Read eight-byte block headers, handle raw payloads or call the Windows XPRESS decoder, and reassemble length-prefixed messages across blocks. Validate lengths before allocating. A clean end of stream and a truncated message produce distinct results.
Build 19041 version query
The session can now reply to opcode 1306. The response carries the request identifiers, the reported magic and version, and the four version-query values returned by the console handler. The writer emits raw PIX blocks that fit the configured block capacity. The reference comparison uses the original reply-building routine at RVA
0x15b24under instruction emulation. Three synthetic requests varied the sequence, opcode flag bits and echoed fields.Device request loop and validation
The stream code now builds as part of the pixrt10 library. The 19041 request loop consumes successive messages until the peer closes. Opcodes 1200 through 1202 consume a message without sending a reply. For unknown opcodes the console fallback at RVA
0x14a5csends a 68-byte E_NOTIMPL reply unless initialization flag bit 0 suppresses it. Recognized requests whose handlers still need porting return a local unsupported error.A single XBTP exchange sends opcode 1200, an unknown opcode and the version query. The peer checks the complete 68-byte error and 84-byte version messages in order. Both reference replies were produced by executing the original reply builder with synthetic identifiers. All 44 release tests across pixrt and pixrt10 passed with the local reference DLLs available for export comparison.
Device-session handoff
The worker calls the dispatcher after accepting an XBTP link when
compat_common::os_host::routes::current_build() == 19041. It checks for the in-process device tag before resolving session I/O and uses the accepted handle for both receive and send. This path opens no OS sockets.The 19041 test runs the worker’s connection routine, listens on service 0x1080, and exchanges three requests with an in-process peer. The 22000 regression starts the runtime worker, connects a peer and observes EOF with zero response bytes. Its session-I/O resolver would fail the test if invoked. Both PIX release DLLs built, all 44 release tests passed with local reference DLLs, and the PR gate passed.
Remaining integration
The separate 19041 title initializer still returns E_NOTIMPL before starting the worker. This tests the worker connection path directly for that build. Live title startup and capture remain unfinished.
@omonkeyz on GitHub · 2026-11-23 06:57 UTC · original
Thanks, the stream decoding and its tests look careful. One issue before this can go in:
transport_stream.rsisn't declared incrates/compat/pixrt/src/lib.rs. Only the pixrt10 test includes it, through#[path], so nothing in the shipped DLL uses it. Could you wire it into the device-session path? When you do:reply_to_version_query_19041whencompat_common::os_host::routes::current_build() == 19041, the same way #223 gates its 19041 behaviour, and keep other builds on today's path.@bambermf on GitHub · 2026-11-23 07:13 UTC · original
Fixed in
5bf436d. The shipped DLL now includes the stream decoder, and the device worker answers the version query on the accepted in-process XBTP link only when current_build() is 19041. The handler opens no OS sockets. I added a regression test for the existing path on other builds. All 44 release tests across pixrt and pixrt10 passed.The PR is still a draft while I work on the separate 19041 title initializer. The worker tests exercise an accepted connection directly.
@bambermf on GitHub · 2026-11-23 07:28 UTC · original
Continued in #250, which includes this PR through commit
5bf436dand adds the 19041 title initializer. Its integration test starts the device worker through the initializer and verifies the version reply over in-process XBTP. I’m closing this draft to keep further work and review in #250.Pull request closed