tooling: refuse non-finite --timeout in dxc_compile_time #2794

Merged
RenzoWit35 merged 2 commits from upstream-pr/2802 into main 2026-11-26 11:05:38 +00:00
RenzoWit35 commented 2026-11-26 11:00:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-26T11:00:06Z.


Change

tools/dxc_compile_time.py only checked args.timeout <= 0. --timeout inf (or 1e999) passed that check and later crashed with OverflowError: timestamp out of range for platform time_t from proc.communicate(timeout=inf). --timeout nan also passed and ended in Invalid value NaN.

The tool now rejects non-finite values with parser.error("--timeout must be a finite positive number") before any work, the same rule tools/mesh_od_pipeline.py already uses (math.isfinite(value) and value > 0). tests/dxc_compile_time_cli_check.py gets cases for nan, inf, -inf (written as --timeout=-inf, because argparse reads a separate -inf as a flag) and 1e999. The existing 0 case still matches "positive".

Verification

  • python -B tests/dxc_compile_time_cli_check.py with the fix: Ran 7 tests, OK.
  • Negative control: the same test file run against the origin/main copy of the tool (copied to a scratch dir, tool and test side by side): Ran 7 tests, FAILED (failures=4), one for each of nan, inf, --timeout=-inf, 1e999.
  • Repro: python -B tools/dxc_compile_time.py --dxc <python.exe> --timeout inf --variants control now prints the usage line and error: --timeout must be a finite positive number, exit code 2.
  • The two other checks that import the tool, run with DXC from Windows SDK 10.0.26100: python -B tests/dxc_compile_time_check.py <dxc.exe> -> dxc_compile_time_check: OK; python -B tests/dxc_gvn_output_check.py <dxc.exe> <offscreen_check.exe> warp -> dxc_gvn_output_check: OK.

Evidence and follow-up

No follow-up. The check is already registered as dxc_compile_time_cli_check in CMakeLists.txt.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6625183258 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2802). Originally posted by [RenzoWit35](https://github.com/RenzoWit35) on 2026-11-26T11:00:06Z. --- ## Change `tools/dxc_compile_time.py` only checked `args.timeout <= 0`. `--timeout inf` (or `1e999`) passed that check and later crashed with `OverflowError: timestamp out of range for platform time_t` from `proc.communicate(timeout=inf)`. `--timeout nan` also passed and ended in `Invalid value NaN`. The tool now rejects non-finite values with `parser.error("--timeout must be a finite positive number")` before any work, the same rule `tools/mesh_od_pipeline.py` already uses (`math.isfinite(value) and value > 0`). `tests/dxc_compile_time_cli_check.py` gets cases for `nan`, `inf`, `-inf` (written as `--timeout=-inf`, because argparse reads a separate `-inf` as a flag) and `1e999`. The existing `0` case still matches "positive". ## Verification - `python -B tests/dxc_compile_time_cli_check.py` with the fix: Ran 7 tests, OK. - Negative control: the same test file run against the `origin/main` copy of the tool (copied to a scratch dir, tool and test side by side): Ran 7 tests, FAILED (failures=4), one for each of nan, inf, `--timeout=-inf`, 1e999. - Repro: `python -B tools/dxc_compile_time.py --dxc <python.exe> --timeout inf --variants control` now prints the usage line and `error: --timeout must be a finite positive number`, exit code 2. - The two other checks that import the tool, run with DXC from Windows SDK 10.0.26100: `python -B tests/dxc_compile_time_check.py <dxc.exe>` -> `dxc_compile_time_check: OK`; `python -B tests/dxc_gvn_output_check.py <dxc.exe> <offscreen_check.exe> warp` -> `dxc_gvn_output_check: OK`. ## Evidence and follow-up No follow-up. The check is already registered as `dxc_compile_time_cli_check` in `CMakeLists.txt`. AI-assisted.
tedin7 commented 2026-11-26 11:02:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:02:18Z.

Review: COMMENTED


Review of head fd50ae36 (comment only).

  • Change: --timeout now fails fast unless finite and positive (math.isfinite), same rule as tools/mesh_od_pipeline.py. nan, inf and 1e999 no longer reach communicate(timeout=...).
  • Test: tests/dxc_compile_time_cli_check.py adds nan, inf, --timeout=-inf and 1e999 cases.
  • Scope: two files, no sibling callsite left out. No other open PR covers this (#2581, merged, did not touch this check).

Commands run locally:

  • python3 -B tests/dxc_compile_time_cli_check.py: 7 tests OK
  • Mutation 1 (restore args.timeout <= 0 only): 3 failures
  • Mutation 2 (only math.isnan): 2 failures (inf and 1e999 cases)
  • python3 tests/docs_links_check.py: OK
  • python3 tests/bidi_controls_check.py: OK
  • git diff --check origin/main...HEAD: clean

No blocking findings.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6072979036 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2802#pullrequestreview-6072979036). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:02:18Z. **Review:** COMMENTED --- Review of head fd50ae36 (comment only). - Change: `--timeout` now fails fast unless finite and positive (`math.isfinite`), same rule as `tools/mesh_od_pipeline.py`. nan, inf and 1e999 no longer reach `communicate(timeout=...)`. - Test: `tests/dxc_compile_time_cli_check.py` adds nan, inf, `--timeout=-inf` and 1e999 cases. - Scope: two files, no sibling callsite left out. No other open PR covers this (#2581, merged, did not touch this check). Commands run locally: - `python3 -B tests/dxc_compile_time_cli_check.py`: 7 tests OK - Mutation 1 (restore `args.timeout <= 0` only): 3 failures - Mutation 2 (only `math.isnan`): 2 failures (inf and 1e999 cases) - `python3 tests/docs_links_check.py`: OK - `python3 tests/bidi_controls_check.py`: OK - `git diff --check origin/main...HEAD`: clean No blocking findings. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 11:03:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:02:19Z.


Win2025 WARP receipt for head fd50ae36 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit fd50ae369c1206e3daeb3a31e8b07ffd08b64912:

  • Windows Python checks: tests/dxc_compile_time_cli_check.py ok (3.2s, PYCHECK rc=0)
  • Python-only PR: no builds or CTest tests apply. Real-GPU run not available (RunPod stopped).
  • Command: x2w_pipe.py win2025 2802 --wait 7200 --keep-release --py-checks tests/dxc_compile_time_cli_check.py

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190178111 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2802#issuecomment-7190178111). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:02:19Z. --- Win2025 WARP receipt for head fd50ae36 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `fd50ae369c1206e3daeb3a31e8b07ffd08b64912`: - **Windows Python checks**: `tests/dxc_compile_time_cli_check.py` ok (`3.2s`, `PYCHECK rc=0`) - Python-only PR: no builds or CTest tests apply. Real-GPU run not available (RunPod stopped). - Command: `x2w_pipe.py win2025 2802 --wait 7200 --keep-release --py-checks tests/dxc_compile_time_cli_check.py` AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 12:04:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2794
No description provided.