[PR #468] [MERGED] SEMANTIC-PROCESS-TIMEOUT: bound hung test subprocesses #519

Closed
opened 2026-11-26 20:18:09 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/468
Author: @csmith105
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: codex/semantic-process-timeout


📝 Commits (2)

  • 973593f Add optional timeout to semantic test subprocesses
  • 90eb728 Reject semantic-test timeouts beyond portable wait limits

📊 Changes

2 files changed (+87 additions, -6 deletions)

View changed files

📝 scripts/run_semantic_tests.py (+38 -6)
📝 tests/test_run_semantic_tests.py (+49 -0)

📄 Description

Claimed in the coordination issue as: SEMANTIC-PROCESS-TIMEOUT

What and why

A hanging test subprocess can block the semantic regression runner indefinitely. Add an optional positive finite --timeout SECONDS (at most 86,400 seconds / 24 hours): it limits each module in parallel mode, or the entire existing unittest-discovery subprocess with -j 1. Timeouts return failure, retain partial output, and allow other parallel modules to finish. Omitting the option preserves existing behavior.

The limit terminates the direct subprocess; it does not promise descendant-process cleanup. This change does not alter shader translation or test discovery.

Tested

Windows 11, Python 3.12.14:

  • python -I tests/test_run_semantic_tests.py: 15 tests passed, including hanging synthetic modules, preserved output, healthy parallel modules, serial behavior, invalid/out-of-range timeout values, and a passing fixture at the maximum supported timeout.
  • python -m compileall -q make_game.py tools tests: passed.
  • python -I make_game.py --help: passed.
  • python -I scripts/run_semantic_tests.py tests/semantic -j 4 --timeout 300: 465 files / 6,104 tests in 484 seconds; two modules failed because spirv-as and spirv-val were absent (test_sopc_validation, test_unary_f16_validation). No timeout failures occurred.
  • After adding checksum-verified SPIRV-Tools 2026.4 to the task-local PATH, reran those two modules with python -m unittest discover -s tests/semantic -p <filename>: 11 and 5 tests passed respectively. The full suite was not rerun after that environment change; the initial failures are retained in the validation record.
  • python -I scripts/check_no_game_data.py scripts/run_semantic_tests.py tests/test_run_semantic_tests.py: passed.
  • git diff --check: passed. Independent source review found no blockers.

GPUs tested: n/a (test-runner change; no GPU execution).

AI-assisted: yes, OpenAI Codex, supervised through csmith105's session.

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in quoted logs.
  • Translator contract table: not applicable; no translator rule changes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/468 **Author:** [@csmith105](https://github.com/csmith105) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `codex/semantic-process-timeout` --- ### 📝 Commits (2) - [`973593f`](https://github.com/ubiquitarianism/leonida/commit/973593f4a7c14cb70ba9827f2e5e04641294ff20) Add optional timeout to semantic test subprocesses - [`90eb728`](https://github.com/ubiquitarianism/leonida/commit/90eb7284feaae3d2e1511ffef0685d95a7dd7525) Reject semantic-test timeouts beyond portable wait limits ### 📊 Changes **2 files changed** (+87 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `scripts/run_semantic_tests.py` (+38 -6) 📝 `tests/test_run_semantic_tests.py` (+49 -0) </details> ### 📄 Description Claimed in the coordination issue as: [SEMANTIC-PROCESS-TIMEOUT](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123225660) ### What and why A hanging test subprocess can block the semantic regression runner indefinitely. Add an optional positive finite `--timeout SECONDS` (at most 86,400 seconds / 24 hours): it limits each module in parallel mode, or the entire existing unittest-discovery subprocess with `-j 1`. Timeouts return failure, retain partial output, and allow other parallel modules to finish. Omitting the option preserves existing behavior. The limit terminates the direct subprocess; it does not promise descendant-process cleanup. This change does not alter shader translation or test discovery. ### Tested Windows 11, Python 3.12.14: - `python -I tests/test_run_semantic_tests.py`: 15 tests passed, including hanging synthetic modules, preserved output, healthy parallel modules, serial behavior, invalid/out-of-range timeout values, and a passing fixture at the maximum supported timeout. - `python -m compileall -q make_game.py tools tests`: passed. - `python -I make_game.py --help`: passed. - `python -I scripts/run_semantic_tests.py tests/semantic -j 4 --timeout 300`: 465 files / 6,104 tests in 484 seconds; two modules failed because `spirv-as` and `spirv-val` were absent (`test_sopc_validation`, `test_unary_f16_validation`). No timeout failures occurred. - After adding checksum-verified SPIRV-Tools 2026.4 to the task-local PATH, reran those two modules with `python -m unittest discover -s tests/semantic -p <filename>`: 11 and 5 tests passed respectively. The full suite was not rerun after that environment change; the initial failures are retained in the validation record. - `python -I scripts/check_no_game_data.py scripts/run_semantic_tests.py tests/test_run_semantic_tests.py`: passed. - `git diff --check`: passed. Independent source review found no blockers. GPUs tested: n/a (test-runner change; no GPU execution). AI-assisted: yes, OpenAI Codex, supervised through csmith105's session. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in quoted logs. - [x] Translator contract table: not applicable; no translator rule changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:09 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#519
No description provided.