Repository navigation
Tests: pin XSTS sign-request header layout and offline token contract - #2486
amazedturnip wants to merge 1 commit into
Conversation
|
On head One hour is AI use: OpenAI Codex (GPT-6; exact variant unavailable) reviewed the diff and verified the unit conversion; no tests were run for this review. |
|
Rerun on the new head
A clock 1 h + 1 tick behind still passes: the tests' own "now" is taken in whole seconds ( First run, on Tested:
Also in that test: its comment says "more than a day in the past" while the assert message says 1h, and the name says Not tested: a release build; the signing path through the AI use: Claude Code (Claude Opus 5.5) ran the suite and the scratch changes, and wrote this report. |
|
One non-reproducing flake burst, otherwise clean. First cold-cache
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Adds crates/xcl/tests/xsign_contract.rs, a black-box contract suite for xsign.rs: offline_token starts 'XBL3.0 x=xcl;local-' with a 16-char hex suffix matching config().user_id; current_filetime is a plausible now (and non-decreasing); base64_encode matches RFC 4648 vectors and round-trips; sign_request_at writes a parseable 76-byte XSTS v1 header ([version u32 BE == 1][filetime u64 BE == fixed][64-byte sig]); sign_request stamps a same-shape header within an hour of now. None of these contracts were guarded by any integration test outside the module, so a silent regression in the offline-signing path would not be caught.
|
Fixed: both FILETIME checks now use a shared ONE_HOUR_TICKS constant (36_000_000_000 ticks = 1 hour) instead of 3_600_000_000_000_000 (~11.4 years). Each test also now asserts that a timestamp more than an hour off (+1 tick past the bound, either side) fails the check. Test name/comment cleaned up (claps_2024_plus -> plausible_now_2024_plus, 'more than a day in the past' -> 'more than an hour in the past'). Verified locally: |
eaf578b to
33ea27f
Compare
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Independent desktop NVIDIA verification of PR #2486 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --test xsign_contract -- --nocapture (3 consecutive runs) |
5 passed; 0 failed; 0 ignored; 0 filtered out × 3 (0.00s × 3, 0 skipped: base64_encode_matches_rfc4648_and_decodes_roundtrip, current_filetime_is_plausible_now, offline_token_has_xbl3_xcl_prefix_and_hex_user_id, sign_request_at_produces_parseable_xsts_v1_header, sign_request_returns_ok_and_has_xsts_v1_shape) |
cargo test --release -p xcl --lib xsign (3 consecutive runs) |
4 passed; 0 failed; 0 ignored; 1320 filtered out × 3 (0.00s × 3, 0 skipped) |
cargo build --release -p xcl |
Clean build (0.07s incremental after --test/--lib build, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):
xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB
PR #2486 (33ea27fbb2bb40ef4ee1227e6e9d9064440d893d):
xcl-smoke v1
commit: 33ea27fbb2bb40ef4ee1227e6e9d9064440d893d
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14023 MB
Runtime log observations (xcl.log)
9220log lines,0[ERROR]/ device-removal / panic lines (dxil_cache:460hits,0misses,0compilation failures;228background pipelines,0failures).- Final draw/memory telemetry in log:
19519 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14022 MB committed by the process; video memory 6115 MB local, 4683 MB non-local.
Limits of coverage
- This PR is test-only (
crates/xcl/tests/xsign_contract.rs,+141/-0,0production-code changes); all 5 new black-box XSTS signing/offline-token contract tests and all 4 existinghle::xgameruntime::xsign::testsunit tests passed3/3in--releaseon Windows 11. - The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
merge-check claim |
|
merge-check |
|
releasing: my merge-check claim for head 33ea27f (someone else took this slot after my claim) |
|
merge-check |
|
No open PR adds these tests. Part of it repeats main's own unit tests in AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Adds a black-box integration contract suite for crates/xcl/src/hle/xgameruntime/xsign.rs so the XSTS v1 offline-signing path is pinned outside the module: offline_token starts with 'XBL3.0 x=xcl;local-' with a 16-hex-char suffix round-tripping config().user_id; current_filetime is plausible now (>= ~2020, within 1h of now, non-decreasing); base64_encode matches RFC 4648 vectors and decodes round-trip; sign_request_at with a fixed filetime yields a parseable 76-byte [version u32 BE == 1][filetime u64 BE][64-byte sig] header; sign_request returns Ok with a same-shape header within 1h of now. Test-only, 129 lines, no source changes.
What is in it
crates/xcl/tests/xsign_contract.rs: black-box contract suite forxcl::hle::xgameruntime::xsign—offline_token()starts withXBL3.0 x=xcl;local-and ends with 16 hex chars that round-tripconfig().user_id;current_filetime()is a plausible now (>= ~2020, within 1h of now, non-decreasing);base64_encodematches RFC 4648 vectors and round-trips;sign_request_atwith a fixed filetime yields a base64 header whose decoded bytes are exactly [version u32 BE == 1][filetime u64 BE == fixed][64-byte signature] (76 bytes);sign_requestreturns Ok and decodes with version == 1 and 96-byte... wait, 76-byte payload and filetime within 1h of now.Tested
AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64),XCL_ADAPTER=radeon):cargo test --workspace -- --test-threads=1— 1297 passed, 1 failed, 26 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1)offline_token_has_xbl3_xcl_prefix_and_hex_user_idFAILED ("token XBL3.0 x=local-0009000000000001 must start with XBL3.0 x=xcl;local-"), 4 other tests passed; thengit checkout -- crates/xcl/src/hle/xgameruntime/xsign.rsto restore.Not tested
AI use