util: a negative return spec past i64::MIN is refused, not flipped positive #1690
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1700"
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?
Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T19:24:20Z.
util::parse_ret(the return values indata/stubdb.tomland ininit_dboverrides) negated a negative spec's magnitude asu64:That is right for
-1(0xFFFF_FFFF, a console HRESULT) but wraps for anything belowi64::MIN:"-9223372036854775809"came back as0x7FFF_FFFF_FFFF_FFFF, a positive value where a negative one was asked for, and"-+1"parsed as-1becauseu64::from_straccepts a leading+.This takes a negative spec as
i64(which acceptsi64::MINitself) and refuses everything below it instead of flipping it positive. The hex form and a wholeu64are unchanged.What is in it
crates/xcl/src/util.rs: parse the decimal spec asi64beforeu64inparse_ret; add unit testa_negative_return_spec_is_not_wrapped_around_i64_min(fails onmain:-9223372036854775809→Some(9223372036854775807)instead ofNone).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib util::tests: 6 passed, 0 failedRegression run
main (
1d027e5, clean tree, no local changes):PR (
b509a70, clean tree, no local changes):Not tested
AI use
util::parse_ret, wrote the fix and unit test (and confirmed it fails without the fix), rebased onto1d027e5, ran the test suite andscripts/smoke.ps1regression runs with #677's title hashing, and drafted this PR description.Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T22:07:38Z.
Rebased onto
1d027e5and re-ran: 960 passed, 0 failed, 43 ignored; both blocks above are from the current scripts/smoke.ps1 (#677's hashed itle: line), and the head run is 1643 frames / 0 crashes / 0 device removals against main's 1553.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:09:42Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:02:14Z.
XCL PR #1700 verification
Head
b509a70707bff971ca7e12e3560d4d0c5ccdf51dwas checked out detached and clean. The PR changes onlycrates/xcl/src/util.rs.STOR-WINLAB ran Windows 11 Enterprise Evaluation x64 (build 26200) on an AMD Ryzen 7 3800X with an Intel Arc A770 (driver 32.0.101.9175). DXC was 1.9.2609.5 and rustc was 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo used unoptimized dev/test profiles with incremental compilation and debug info disabled.
Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the Arc mutex. The latter compiled 19 test binaries.cargo test -p xcl --lib util::tests::return_specs -- --exactandcargo test -p xcl --lib util::tests::a_negative_return_spec_is_not_wrapped_around_i64_min -- --exacteach reported 1 passed, 0 failed, 0 ignored, 0 skipped. Both ran outside the mutex withXCL_ADAPTER=NONE_CPU_ONLY. They verified named, hexadecimal and decimal returns, signed values throughi64::MIN, rejection of overflow and malformed signs, and acceptance ofu64::MAX.cargo test --workspace --no-fail-fast -- --test-threads=4ran once insideInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. Cargo exited 101. Summing all 20test result:lines (19 binaries and 1 doctest target) gave 941 passed, 19 failed and 43 ignored. Both return-spec tests passed in this run too.Workspace failures and skips
CreateComputePipelineStateerror0x80070057. Four had output mismatches in FMA overflow, implicit-LOD sampling, f16 lane preservation and wave64 pixel reduction.SKIPPED. Seventeen cite unavailable wave64 and three cite refused wave32 per-lane forms. Five cover tiled-resource tier, heap windows, driver-cache controls and missing debug-layer support. These lines provide no test coverage.Not tested
Matched
mainbaseline, retail-title smoke runs, and other GPU vendors. Failure provenance is undetermined.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1700-suite.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:07:50Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T16:08:46Z.
NVIDIA test report for
b509a70: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug. Head tested as-is on its base1d027e5.cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 902 passed, 0 failed, 23 ignored; 22 SKIPPED: 18no wave64, 3 lower_dxil per-lane f16 forms refused by design (#1426), 1 driver-cache test (Developer Mode off); none in util.rs.util::tests::a_negative_return_spec_is_not_wrapped_around_i64_minwith--exact --test-threads=1 --nocapture, 3 runs: 3/3 passed, 0 SKIPPED.Lib tests only; no title run.
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T19:20:37Z.
merge-check claim
head:
b509a70707Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T19:31:41Z.
merge-check claim
head:
b509a70707Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T19:40:01Z.
merge-check
base:
ff0c364b3dhead:
b509a70707merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2890 passed, 0 failed, 51 ignored (25 SKIPPED: 22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none; new test util::tests::a_negative_return_spec_is_not_wrapped_around_i64_min passed
review: none. Read the full diff (+17/-2 in crates/xcl/src/util.rs). Replacing
strip_prefix('-')+u64::parse+(v as i64).wrapping_neg()witht.parse::<i64>()(falling back tot.parse::<u64>()) acceptsi64::MIN..=i64::MAXand0..=u64::MAXwhile refusing values belowi64::MIN(e.g.-9223372036854775809) and"-+1". The new unit test covers-1,i64::MIN,-2147483649,-9223372036854775809,-18446744073709551615,"-+1","-", andu64::MAX(fails before the fix on-9223372036854775809,-18446744073709551615, and"-+1"). Minimal scope; no duplicates found in open/merged PRs or #1607.performance: none (CLI/config string parsing only; not on any hot path)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro build 26300, Rust 1.100.0 / T3 Code (Antigravity), Gemini 4 Neon (Medium)
Imported from ivall/xcl. Originally posted by BBareth on 2026-11-30T19:40:30Z.
merge-check
base:
ff0c364b3dhead:
b509a70707merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2890 passed, 0 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: none. The base alone, run in the same batch: 2888 passed, 1 failed, 51 ignored, 28 SKIPPED lines; its one failure,
hle::d3d12x::pso_async::used_tests::emission_resolves_the_retained_recipe_after_title_address_reuse, passed in this merged run and in the six others of the batch, so it is intermittent on the base and not this PR's. The new testa_negative_return_spec_is_not_wrapped_around_i64_minpassed.review: no blocking finding; one file, every hunk read.
parse_retnow takes a decimal value as ani64first and falls back tou64, so-1is still 0xFFFF_FFFF_FFFF_FFFF,i64::MINis accepted, a magnitude past it is refused where it used to come back positive, and-+1/-are refused. Values 0 toi64::MAXgive the same result on either path, and a wholeu64is still accepted; the hex branch is untouched. No GPU or game path involved.performance: none: parsing of a configuration value at start-up.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:31:47Z.
Triage (#1607) – head
b509a70No open or merged PR makes the same change;
util::parse_reton main still negates the magnitude as u64. The newi64parse gives the same results for-1andi64::MINand refuses values belowi64::MIN(and-+1), which the test checks.No problems found in the diff.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.