OLD-10029: test(hw_oracle): unit tests for tools/hw_oracle/drm.py #1029

Merged
leonida/mandy
klikso merged 1 commit from carry/old-10029-hw-oracle-drm-tests into main 2026-11-28 11:41:51 +00:00

Pull request successfully merged and closed

klikso commented 2026-11-24 17:03:06 +00:00

Claimed in the coordination issue as: OLD-10029

What and why

Carries forward old-pr/10029 (draft #297) rebased onto current main:

  • Adds unit tests in tests/test_hw_oracle_drm.py for tools/hw_oracle/drm.py covering DRM device node discovery, render node enumeration, chip generation detection, and fallback paths.

Original commit preserved: Ritolino <230431388+Ritolino@users.noreply.github.com>.

Tested

  • python -I tests/test_hw_oracle_drm.py: 13/13 passed
  • python -I scripts/check_no_game_data.py tests/test_hw_oracle_drm.py: passed (no game data)
  • python -I tests/test_text_write_line_endings.py: passed
  • python -m compileall -q make_game.py tools tests: clean

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed: n/a (no translator rule).
Claimed in the coordination issue as: OLD-10029 ### What and why Carries forward `old-pr/10029` (draft #297) rebased onto current `main`: - Adds unit tests in `tests/test_hw_oracle_drm.py` for `tools/hw_oracle/drm.py` covering DRM device node discovery, render node enumeration, chip generation detection, and fallback paths. Original commit preserved: `Ritolino <230431388+Ritolino@users.noreply.github.com>`. ### Tested - `python -I tests/test_hw_oracle_drm.py`: 13/13 passed - `python -I scripts/check_no_game_data.py tests/test_hw_oracle_drm.py`: passed (no game data) - `python -I tests/test_text_write_line_endings.py`: passed - `python -m compileall -q make_game.py tools tests`: clean GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed: n/a (no translator rule).
KernelSmoker approved these changes 2026-11-24 17:07:52 +00:00
KernelSmoker left a comment

Verified on exact head d612e596df62e5a4e5394b0550a8d1fd99ed177f (base fce586c6d6f74160eccff015d9806e179188d862). tests/test_hw_oracle_drm.py passes 13/13; line-ending tests pass 3/3. The changed test file passes scripts/check_no_game_data.py and git diff --check. The cases exercise discovery, generation parsing, fallback behavior, ELF/kernel-register decoding, launcher construction/cache, and failure reporting through synthetic files and mocked system calls. No GPU or /dev/dri hardware access is claimed.

Verified on exact head d612e596df62e5a4e5394b0550a8d1fd99ed177f (base fce586c6d6f74160eccff015d9806e179188d862). `tests/test_hw_oracle_drm.py` passes 13/13; line-ending tests pass 3/3. The changed test file passes `scripts/check_no_game_data.py` and `git diff --check`. The cases exercise discovery, generation parsing, fallback behavior, ELF/kernel-register decoding, launcher construction/cache, and failure reporting through synthetic files and mocked system calls. No GPU or `/dev/dri` hardware access is claimed.
klikso commented 2026-11-24 17:42:37 +00:00

Note for reviewers: the head moved from d612e596d to 22ce0f40a. Only the commit's committer field changed (to a GitHub noreply address); the tree, the author and the message are identical, and the base is the same. The approval above was given on d612e596d.

Note for reviewers: the head moved from `d612e596d` to `22ce0f40a`. Only the commit's committer field changed (to a GitHub noreply address); the tree, the author and the message are identical, and the base is the same. The approval above was given on `d612e596d`.
MoonEyes commented 2026-11-27 23:45:07 +00:00

Hi @klikso, thanks for these tests. I merged this pull request onto current main locally and ran them: they pass, and they also pass on plain main. The "Is it mergeable?" list in CONTRIBUTING.md asks for "A new test that fails on main and passes with the pull request", so as it stands this one doesn't show a bug that main still has. If one of these cases did fail before a fix that has since landed, could you say which commit, or add a case that still fails on main? If the tests are meant to lock in behaviour main already has, please say so in the description and a maintainer can decide.

AI-assisted (Claude Code, Claude Opus 5.5).

Hi @klikso, thanks for these tests. I merged this pull request onto current `main` locally and ran them: they pass, and they also pass on plain `main`. The "Is it mergeable?" list in CONTRIBUTING.md asks for "A new test that fails on `main` and passes with the pull request", so as it stands this one doesn't show a bug that `main` still has. If one of these cases did fail before a fix that has since landed, could you say which commit, or add a case that still fails on `main`? If the tests are meant to lock in behaviour `main` already has, please say so in the description and a maintainer can decide. AI-assisted (Claude Code, Claude Opus 5.5).
sodove commented 2026-11-28 11:26:18 +00:00

#1029 | head 22ce0f40ab6046c0519b8c50cc13b5b755374378 | python3 -I tests/test_hw_oracle_drm.py -v | red: 13 passed | green: 13 passed | Passed on both trees

The file tests DRM discovery, launch formatting and error handling with fixtures/mocks. All 13 passed on the existing implementation.

Copied the PR tests onto clean main 4a54aedcb6b66525e0c9f72a6ea10263337c9141 for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. Batch claim.

#1029 | head `22ce0f40ab6046c0519b8c50cc13b5b755374378` | `python3 -I tests/test_hw_oracle_drm.py -v` | red: 13 passed | green: 13 passed | **Passed on both trees** The file tests DRM discovery, launch formatting and error handling with fixtures/mocks. All 13 passed on the existing implementation. Copied the PR tests onto clean main `4a54aedcb6b66525e0c9f72a6ea10263337c9141` for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. [Batch claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7238450840).
DadaCap commented 2026-11-28 11:41:53 +00:00

Merged, thank you @klikso! This PR (OLD-10029: test(hw_oracle): unit tests for tools/hw_oracle/drm.py) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Merged, thank you @klikso! This PR (OLD-10029: test(hw_oracle): unit tests for tools/hw_oracle/drm.py) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.
Sign in to join this conversation.
No description provided.