Repository navigation
wininet: log the status of every HTTP response so online features are verifiable - #643
Open
TimmyTurner51 wants to merge 1 commit into
Open
TimmyTurner51 wants to merge 1 commit into
TimmyTurner51 wants to merge 1 commit into
Conversation
… verifiable
The winhttp equivalent already exists, but Wine's wininet has its own HTTP
implementation (dlls/wininet/http.c) and never calls into winhttp. A title
that loads wininet.dll therefore produces no [http] line at all.
Measured on iOS with Forza Horizon 6: the winhttp instrument was live (the
packaged winhttp.dll has SizeOfImage 0xb0000 and the run's image table
contains exactly "image ...+0xb0000 (winhttp.dll)") and printed zero lines
across a 9,714-frame session, while the title resolved
gameservices.fh6.forzamotorsport.net, achievements.xboxlive.com,
userpresence.xboxlive.com and the Steam hosts through the ws2_32 [dns] lines.
DNS proves the title TRIES to reach those services; it says nothing about
whether an exchange completed. That gap is why "Xbox Live verified" was never
actually established.
This prints one line per completed response from HTTP_GetResponseHeaders(),
the single function every HTTP response for every handle passes through:
[http-inet] #<n> <verb> https://<host><path> -> <status>
Placed after the do { } while (codeHundred) loop so an interim 100 Continue is
never reported as the answer. Host comes from request->session->hostName, verb
from request->verb, path from request->path, status from the parsed numeric
request->status_code. Query strings are stripped before printing so
OAuth/XSTS material cannot reach a log, converted buffers are force-
terminated, and the counter is interlocked because the header parse can run on
more than one thread. The tag is [http-inet] rather than [http] so a log says
which module spoke.
tests/host/check-wininet-summary.py pins the invariants that matter, not the
string's presence: the print sits in HTTP_GetResponseHeaders, follows the
100-Continue loop, strips the query before printing, leaves
HTTP_ProcessHeader(Status) after it, and uses wininet's own tag. It validates
the applied source or the patch post-image, whichever the checkout has. Two
mutants die on named checks (deleting the query strip, printing a constant
status).
Co-authored-by: Cursor <cursoragent@cursor.com>
TimmyTurner51
force-pushed
the
pr/wininet-http-summary
branch
from
November 29, 2026 15:27
e9d434e to
414a915
Compare
TimmyTurner51
pushed a commit
to TimmyTurner51/Madeira
that referenced
this pull request
Nov 29, 2026
…retention bound needed a gauge Documentation and tooling for three measured findings on device. 9.70: 113 of 114 hitch frames (>40ms) are "other"-dominated, i.e. frame time minus GPU, cpu-wait, pso, tex, heap and ecl -- guest code running and touching no D3D12 site. 52.7 of the 53.5s of hitch time is in that bucket, while the D3D12 layer is 2.3ms of a 52.9fps frame (encode 0.6, replay 0.7, reset waits 1.0). The one GPU-dominated frame is a genuinely different bug (4095.9ms of GPU on a single command buffer). 851,410 real compiles against 25.08M compile-path lookups, ~62us each, accounts for the 52.7s; corr(fps, compiles | draws held) is -0.86 on this log. The frame-time lever is how much code FEX translates, not the layer. 9.71: the dull, non-shiny car paint is tex-drop-mip = 2, which rebuilds 1,795 sampled 2D textures without their top two mip levels and shifts the SRV so shaders sample what was mip 2 -- a quarter of the linear resolution. It covers every sampled 2D texture with no format exemption, so it hits the packed metallic/roughness maps and the flake/detail maps that make paint look like paint. Ruled out with numbers: no nan/denormal/precision-fault line (the 67 grep hits were "nanosleep"), the FP probe passes its blessed case, and both texture paths report 0 fallbacks, so no format is being substituted. 9.72: the winhttp response summary was live at the right SizeOfImage and printed zero lines for a full session, because Wine's wininet has its own HTTP stack and never calls winhttp. Adds the wininet equivalent and documents why "online verified" could not be established before. (Upstream as PR willfaust#643; the fork keeps a build/wine-patches copy.) 9.73: the bounded retention run booted -- 9,731 presents and 0 EXHAUSTED against the unbounded arm's frozen 10 and 2 refusals -- and then failed this repo's own verdict tool, because [pool-retain] arenas= is a cumulative fetch_add sum, not a gauge: 872 against a budget of 16 on a run that never exhausted. The gauge that can answer the question is GetGlobalLivePoolArenas(), which was already correct and simply unprinted; it is now reported as live=, and the verdict FAILs only on live > budget, returning UNKNOWN for a pre-gauge log instead of the false FAIL that re-scoring produced. An earlier attempt to increment that gauge inside the adoption loop was caught by check-retention-patch.py: every arena is already counted once by AddPoolArena(Arena, true) and once by ~GuestToHostMap(), so the increment would have double-counted and made ArenaCap refuse real allocations. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
The winhttp summary from #641 was live on device with the correct
SizeOfImageand printed zero lines across a 9,714-frame Forza Horizon 6session. The instrument was fine; the module was wrong.
Wine's
wininethas its own HTTP implementation (dlls/wininet/http.c) andnever calls into
winhttp, so a title that loadswininet.dllproduces no[http]line at all. The same run resolvedgameservices.fh6.forzamotorsport.net,achievements.xboxlive.comanduserpresence.xboxlive.comvia thews2_32[dns]lines — which proves thetitle tries to reach those services and nothing about whether an exchange
completed. That is why "Xbox Live / Horizon Life verified" was never actually
established.
This prints one line per completed response from
HTTP_GetResponseHeaders()— the single function every response for everyhandle passes through:
It is printed after the
do { } while (codeHundred)loop, so an interim100 Continueis never reported as the answer. Host, verb and path come fromthe request/session structs; status is the parsed numeric
request->status_code. Query strings are stripped before printing soOAuth/XSTS material can never land in a log, converted buffers are
force-terminated, and the counter is interlocked because the header parse can
run on more than one thread. The tag is
[http-inet], not[http], so a logsays which module spoke.
Tests.
tests/host/check-wininet-summary.pypins the failure modes ratherthan the string's presence: the print must sit in
HTTP_GetResponseHeaders,follow the 100-Continue loop, strip the query before printing, keep
HTTP_ProcessHeader(Status)after it, and use wininet's own tag. It validatesthe applied source or the patch post-image, so it is meaningful in a checkout
that has not applied the patch and stronger in one that has. Both modes
verified, and in a simulated upstream tree that contains only
patches/andtests/. Two mutants die on named checks — deleting the query strip fails"query string is stripped before printing", printing a constant fails
"status is the parsed numeric status_code".
This is instrumentation, not verification: it does not show that any service
answered. It removes the reason the question could not be asked.