Skip to content

wininet: log the status of every HTTP response so online features are verifiable - #643

Open
TimmyTurner51 wants to merge 1 commit into
willfaust:mainfrom
TimmyTurner51:pr/wininet-http-summary
Open

TimmyTurner51 wants to merge 1 commit into
willfaust:mainfrom
TimmyTurner51:pr/wininet-http-summary

Conversation

@TimmyTurner51

Copy link
Copy Markdown

The winhttp summary from #641 was live on device with the correct
SizeOfImage and printed zero lines across a 9,714-frame Forza Horizon 6
session. The instrument was fine; the module was wrong.

Wine's wininet has its own HTTP implementation (dlls/wininet/http.c) and
never calls into winhttp, so a title that loads wininet.dll produces no
[http] line at all. The same run resolved
gameservices.fh6.forzamotorsport.net, achievements.xboxlive.com and
userpresence.xboxlive.com via the ws2_32 [dns] lines — which proves the
title 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 every
handle passes through:

[http-inet] #<n> <verb> https://<host><path> -> <status>

It is printed after the do { } while (codeHundred) loop, so an interim
100 Continue is never reported as the answer. Host, verb and path come from
the request/session structs; status is the parsed numeric
request->status_code. Query strings are stripped before printing so
OAuth/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 log
says which module spoke.

Tests. tests/host/check-wininet-summary.py pins the failure modes rather
than 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 validates
the 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/ and
tests/. 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.

… 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
TimmyTurner51 force-pushed the pr/wininet-http-summary branch from e9d434e to 414a915 Compare November 29, 2026 15:27
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants