From 356a101c533fd7a9c56315660b894dd28abd94ac Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 28 Oct 2026 00:29:09 +0100 Subject: [PATCH] fix: call a region claim ambiguous on every file PCSX-ReARMed opens the three regional BIOS files whatever the disc, and the rule called that a confirmation because one of them held the region. A run that opened its own region's file and the others too now settles nothing. --- scripts/region_check.py | 11 ++++++++--- tests/test_region_check.py | 5 +++++ wiki/tools.md | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/region_check.py b/scripts/region_check.py index fa95d159a..3ba28643b 100644 --- a/scripts/region_check.py +++ b/scripts/region_check.py @@ -114,8 +114,9 @@ def outcome(records: dict[str, dict], entries: list[dict], region: str) -> dict: """What the four records of one game on one core settle. `selected` is the regional file the core opened with every one staged. - The `region:` claim is `confirmed` when the regions of what it opened - hold the game's region, `contradicted` when none does, `unread` when it + The `region:` claim is `confirmed` when every regional file it opened + holds the game's region, `contradicted` when none does, `ambiguous` + when it opened its own region's file and others too, `unread` when it opened none. Each variant's result is its oracle verdict. While no reference frame is known for the game, a variant that samples the same frames as the full run (`as_full`) boots, and one that does not stays @@ -128,8 +129,12 @@ def outcome(records: dict[str, dict], entries: list[dict], region: str) -> dict: claim = "unrun" elif not selected: claim = "unread" - elif any(region in regions_of(by_dest[d]) for d in selected): + elif all(region in regions_of(by_dest[d]) for d in selected): claim = "confirmed" + elif any(region in regions_of(by_dest[d]) for d in selected): + # Opened every region's file, to hash them or to choose: the open + # alone does not say which one the core runs. + claim = "ambiguous" else: claim = "contradicted" results: dict[str, dict] = {} diff --git a/tests/test_region_check.py b/tests/test_region_check.py index 806cbaca2..176428fc6 100644 --- a/tests/test_region_check.py +++ b/tests/test_region_check.py @@ -135,6 +135,11 @@ class Outcome(unittest.TestCase): records = {"full": record("f", self.ALL, ["scph5501.bin"], [[0, "a"]], "boots")} self.assertEqual(rc.outcome(records, self.ENTRIES, "japan")["claim"], "contradicted") + def test_a_core_opening_every_region_file_settles_nothing(self) -> None: + """PCSX-ReARMed opens the three regional files whatever the disc.""" + records = {"full": record("f", self.ALL, self.ALL, [[0, "a"]], "boots")} + self.assertEqual(rc.outcome(records, self.ENTRIES, "japan")["claim"], "ambiguous") + def test_region_free_bios(self) -> None: records = {"full": record("f", self.ALL, ["scph5501.bin"], [[0, "a"]], "boots"), "own": record("o", ["scph5502.bin"], [], [[0, "a"]], "boots"), diff --git a/wiki/tools.md b/wiki/tools.md index 2a8d8231c..06ecfdc76 100644 --- a/wiki/tools.md +++ b/wiki/tools.md @@ -1129,7 +1129,7 @@ python scripts/region_check.py report # the outcome of every region recor The file the core opened in the `full` run, read from strace, settles the claim: `confirmed` when its `region:` holds the game's region, `contradicted` -when it does not, `unread` when the core opened none of them. Each variant's +when it does not, `ambiguous` when the core opened its own region's file and the others too (PCSX-ReARMed opens all three), `unread` when it opened none of them. Each variant's result is the oracle verdict of its record. While the oracle has no reference frame for a game, a variant counts as booting when it samples the same frames as the `full` run, and the outcome says it was judged that way. Other frames give no verdict: the US disc reaches its game on the Japanese and European BIOS through another licence screen. The system