test: name the stale fixture DLL when an export is missing #1922

Manually merged
github merged 1 commit from gh-pr/1922/head into gh-pr/1922/base 2026-11-26 23:42:38 +00:00
Owner

@⁠ChazY11 on GitHub · 2026-11-24 21:20 UTC · original
ChazY11:test/x87-missing-export-diagnostic → main · +14 −1 · 1 files · 1 commits · merged 2026-11-24 21:27 UTC

What

tests/cpu/x87_add.py resolves a fixture export with getattr(self.lib, name). When a variant DLL is stale — which happens
whenever a partial build leaves one of the eleven apart — that raises

AttributeError: function 'fstsw_top' not found

which names neither the file nor the reason. I hit it twice reviewing #1861 and misread it as a broken fixture both times.

Change

One helper, used by both call sites (__call__ and with_live_value):

def export(self, name):
    """The fixture export `name`, or a message that names the stale DLL."""
    try:
        return getattr(self.lib, name)
    except AttributeError:
        # A partial build leaves the variants at their previous revision, so the newest
        # export can be missing from one of them. Say which file and what to rebuild.
        raise AssertionError(
            f"{self.path.name} has no export {name!r}: this fixture DLL predates the export. "
            f"Rebuild the target that produces {self.path.name} before running this check."
        ) from None

self.path is stored in __init__ for the message. No behaviour changes when the export is present.

Tested

ctest --preset dev --no-tests=error -R '^cpu_aot_x87'
100% tests passed, 0 tests failed out of 21

Negative control, end to end: remove legacy_controls from tests/cpu/x87_examine.def, rebuild only
cpu_x87_examine (leaving the variants as they are), run the fixture:

AssertionError: cpu_x87_examine.dll has no export 'legacy_controls': this fixture DLL predates the export.
Rebuild the target that produces cpu_x87_examine.dll before running this check.

then restore the .def and rebuild:

100% tests passed, 0 tests failed out of 1

So the message fires on the real path with the real file name, not only in a unit test of the wrapper.

Scope

One file, one helper, one stored attribute. No fixture, no CMake and no production code changes; every x87 check that consumes
this module still passes.

Notes

  • AI-assisted.
**@⁠ChazY11** on GitHub · 2026-11-24 21:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1922) `ChazY11:test/x87-missing-export-diagnostic` → `main` · +14 −1 · 1 files · 1 commits · merged 2026-11-24 21:27 UTC ## What `tests/cpu/x87_add.py` resolves a fixture export with `getattr(self.lib, name)`. When a variant DLL is stale — which happens whenever a partial build leaves one of the eleven apart — that raises ```text AttributeError: function 'fstsw_top' not found ``` which names neither the file nor the reason. I hit it twice reviewing #1861 and misread it as a broken fixture both times. ## Change One helper, used by both call sites (`__call__` and `with_live_value`): ```python def export(self, name): """The fixture export `name`, or a message that names the stale DLL.""" try: return getattr(self.lib, name) except AttributeError: # A partial build leaves the variants at their previous revision, so the newest # export can be missing from one of them. Say which file and what to rebuild. raise AssertionError( f"{self.path.name} has no export {name!r}: this fixture DLL predates the export. " f"Rebuild the target that produces {self.path.name} before running this check." ) from None ``` `self.path` is stored in `__init__` for the message. No behaviour changes when the export is present. ## Tested ```powershell ctest --preset dev --no-tests=error -R '^cpu_aot_x87' 100% tests passed, 0 tests failed out of 21 ``` **Negative control**, end to end: remove `legacy_controls` from `tests/cpu/x87_examine.def`, rebuild only `cpu_x87_examine` (leaving the variants as they are), run the fixture: ```text AssertionError: cpu_x87_examine.dll has no export 'legacy_controls': this fixture DLL predates the export. Rebuild the target that produces cpu_x87_examine.dll before running this check. ``` then restore the `.def` and rebuild: ```text 100% tests passed, 0 tests failed out of 1 ``` So the message fires on the real path with the real file name, not only in a unit test of the wrapper. ## Scope One file, one helper, one stored attribute. No fixture, no CMake and no production code changes; every x87 check that consumes this module still passes. ## Notes - AI-assisted.
A partial build leaves the x87 variant DLLs at their previous revision, so the
newest export can be missing from one of them. The lookup then raised a bare
AttributeError naming only the function: 'function fstsw_top not found', with no
file and no hint that the build was incomplete. Name the DLL and the target to
rebuild instead.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:42:37 +00:00
github manually merged commit 8730bc1204 into gh-pr/1922/base 2026-11-26 23:42:38 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 21:23 UTC · original · reviewed

Review of #1922 at head 8730bc1204 (tier TIER_B_TESTS, file tests/cpu/x87_add.py). No P1/P2 defects.

Commands run locally:

  • git merge-tree --write-tree --name-only origin/main HEAD: no conflicts
  • git diff --check origin/main...HEAD: rc=0
  • python3 tests/docs_links_check.py: rc=0 (18 files, 384 links)
  • python3 tests/bidi_controls_check.py: rc=0 (1345 files)
  • python3 -m py_compile tests/cpu/x87_add.py: rc=0
  • python3 -B tests/cpu/x87_add.py without arguments: rc=1 (needs the fixture DLLs from the build; the changed path cannot run on Linux)

The change wraps getattr(self.lib, name) so a missing export raises an AssertionError that names the stale DLL. It adds no assertion and no new expected value. The only code path it touches is the failure message of a missing export, so there is no mutation of tools/ or src/ logic that this change makes any test fail. Reverting the wrapper only brings back the raw AttributeError.

Result: the change is a diagnostic improvement and does not pass the quality filter for a safe-merge. No receipt written, not merged. The GitHub check "Build and test on Windows" was still pending at review time. A maintainer can merge it by hand if the clearer message is wanted.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 21:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1922#pullrequestreview-6047641172) · **reviewed** Review of #1922 at head 8730bc1204b3d254d6b3bf643b13f6265b8e399a (tier TIER_B_TESTS, file tests/cpu/x87_add.py). No P1/P2 defects. Commands run locally: - git merge-tree --write-tree --name-only origin/main HEAD: no conflicts - git diff --check origin/main...HEAD: rc=0 - python3 tests/docs_links_check.py: rc=0 (18 files, 384 links) - python3 tests/bidi_controls_check.py: rc=0 (1345 files) - python3 -m py_compile tests/cpu/x87_add.py: rc=0 - python3 -B tests/cpu/x87_add.py without arguments: rc=1 (needs the fixture DLLs from the build; the changed path cannot run on Linux) The change wraps getattr(self.lib, name) so a missing export raises an AssertionError that names the stale DLL. It adds no assertion and no new expected value. The only code path it touches is the failure message of a missing export, so there is no mutation of tools/ or src/ logic that this change makes any test fail. Reverting the wrapper only brings back the raw AttributeError. Result: the change is a diagnostic improvement and does not pass the quality filter for a safe-merge. No receipt written, not merged. The GitHub check "Build and test on Windows" was still pending at review time. A maintainer can merge it by hand if the clearer message is wanted. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.