mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-01 07:33:45 -06:00
feat: judge recorded runs again offline
core_probe rejudge appends, for each live record the oracle now judges otherwise, a record with the same runs judged again: verdicts, bios_used and inputs.oracle recomputed, supersedes the earlier one, judged_at and judged_by beside recorded_at. Records of another probe are left to it. The campaign reads a superseded record as its successor, and a file the log shows refused or loaded settles validation with no BIOS screen.
This commit is contained in:
1 parent
05192f43c7
commit
ad7dc0ea17
5 files changed
+166
-8
No files matched your search
+10
-4
@@ -1281,15 +1281,21 @@ class Campaign:
|
||||
self.settle(unit.emulator, content, core, index, entry, [verdict])
|
||||
|
||||
def read_record(self, emulator: str, rid: str | None) -> dict | None:
|
||||
"""A record by its id, or the record that supersedes it: a run
|
||||
judged again offline is read as judged last."""
|
||||
if not rid:
|
||||
return None
|
||||
path = self.paths.root / mr.records_path(emulator)
|
||||
if not path.is_file():
|
||||
return None
|
||||
for line in path.read_text(encoding="utf-8").splitlines():
|
||||
if f'"id":"{rid}"' in line:
|
||||
return json.loads(line)
|
||||
return None
|
||||
records = [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines()]
|
||||
by_id = {r["id"]: r for r in records}
|
||||
successor = {r["supersedes"]: r["id"] for r in records if r.get("supersedes")}
|
||||
seen = set()
|
||||
while rid in successor and rid not in seen:
|
||||
seen.add(rid)
|
||||
rid = successor[rid]
|
||||
return by_id.get(rid)
|
||||
|
||||
def judged(self, emulator: str, rid: str) -> bool:
|
||||
"""True for a record the boot oracle judged: only those prove a field."""
|
||||
|
||||
Reference in new issue
Block a user