From f036bce930384039e0a3b19ed62086891d045caf Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:23:21 +0200 Subject: [PATCH] fix: cite profile code as path:line Sixteen prose citations wrote "file fn() lines N-M", a form the pin tracker never reads, and four had fallen behind their pins. Each is now a repository path with the span read at the profile's pin, and a test refuses the untracked form. --- emulators/kronos.yml | 6 +++--- emulators/o2em.yml | 6 +++--- emulators/opera.yml | 8 ++++---- emulators/prboom.yml | 2 +- emulators/yabasanshiro.yml | 4 ++-- emulators/yabause.yml | 4 ++-- tests/test_audit_regressions.py | 28 ++++++++++++++++++++++++++++ 7 files changed, 43 insertions(+), 15 deletions(-) diff --git a/emulators/kronos.yml b/emulators/kronos.yml index fddaf009..f760bac9 100644 --- a/emulators/kronos.yml +++ b/emulators/kronos.yml @@ -33,9 +33,9 @@ notes: | ROM cartridges for KOF95 and Ultraman are auto-detected via game database (db.c) and loaded from system_dir when the corresponding game is running. - BIOS loading: libretro.c retro_load_game() lines 1601-1727. - STV blob table: ctrl/src/stv.c BiosList lines 112-136. - ROM cartridge DB: utils/src/db.c lines 43-45. + BIOS loading: retro_load_game() at yabause/src/libretro/libretro.c:1601-1727. + STV blob table: BiosList at yabause/src/ctrl/src/stv.c:112-136. + ROM cartridge DB: yabause/src/utils/src/db.c:43-45. Standalone supports MPEG card ROM loading (Video CD card); disabled in libretro port (mpegpath = NULL in yabause/src/libretro/libretro.c:1578). diff --git a/emulators/o2em.yml b/emulators/o2em.yml index 321df782..67587071 100644 --- a/emulators/o2em.yml +++ b/emulators/o2em.yml @@ -27,9 +27,9 @@ notes: | (e.g. E480.WAV). Compiled with HAVE_VOICE=1 on most platforms. Optional: core works without samples, speech is silently skipped. - BIOS loading: libretro.c load_bios() lines 145-212. - BIOS selection: libretro_core_options.h lines 52-64. - Voice loading: voice.c init_voice() lines 38-79, called from libretro.c:1060-1067. + BIOS loading: load_bios() at libretro.c:150-229. + BIOS selection: libretro_core_options.h:52-64. + Voice loading: init_voice() at src/voice.c:39-91, called from libretro.c:1060-1067. files: - name: "o2rom.bin" diff --git a/emulators/opera.yml b/emulators/opera.yml index 98839b27..fcbd38a9 100644 --- a/emulators/opera.yml +++ b/emulators/opera.yml @@ -29,10 +29,10 @@ notes: | All BIOS files are exactly 1 MB (1048576 bytes) except 3do_arcade_saot.bin (512 KB) and panafz1-kanji.bin (933636 bytes). - BIOS definitions: libopera/opera_bios.c BIOSES[] lines 3-136. - BIOS loading: opera_lr_opts.c opera_lr_opts_set_bios() lines 239-270. - Font loading: opera_lr_opts.c opera_lr_opts_get_font() lines 274-293, - opera_lr_opts_set_font() lines 297-328. + BIOS definitions: BIOSES[] at libopera/opera_bios.c:3-136. + BIOS loading: opera_lr_opts_set_bios() at opera_lr_opts.c:283-315. + Font loading: opera_lr_opts_get_font() at opera_lr_opts.c:319-338, + opera_lr_opts_set_font() at opera_lr_opts.c:342-373. Core option: libretro_core_options.c opera_bios / opera_font. files: diff --git a/emulators/prboom.yml b/emulators/prboom.yml index c76372ce..9bbfe51d 100644 --- a/emulators/prboom.yml +++ b/emulators/prboom.yml @@ -26,7 +26,7 @@ notes: | (src/d_main.c:1109-1110), so the file is technically optional but expected for correct rendering of menus, HUD digits, and extended features. - File search order (libretro.c I_FindFile, line 1742): + File search order (I_FindFile, libretro/libretro.c:4176-4252): 1. WAD directory (same folder as the loaded game WAD) 2. system/prboom/ subdirectory 3. system/ directory directly diff --git a/emulators/yabasanshiro.yml b/emulators/yabasanshiro.yml index 649f612f..00384442 100644 --- a/emulators/yabasanshiro.yml +++ b/emulators/yabasanshiro.yml @@ -29,8 +29,8 @@ notes: | ROM cartridge and MPEG card ROM loading disabled in libretro port (cartpath = empty, mpegpath = NULL). - BIOS loading: libretro.c retro_load_game() lines 1048-1069. - Core load: memory.c LoadBios() line 1353, T123Load() memory.h lines 219-280. + BIOS loading: retro_load_game() at yabause/src/libretro/libretro.c:1048-1071. + Core load: LoadBios() at yabause/src/memory.c:1353-1356, T123Load() at yabause/src/memory.h:219-289. files: - name: "saturn_bios.bin" diff --git a/emulators/yabause.yml b/emulators/yabause.yml index 81eb71b2..b24a929b 100644 --- a/emulators/yabause.yml +++ b/emulators/yabause.yml @@ -28,8 +28,8 @@ notes: | ROM cartridge loading, SH1 ROM (CD Block LLE), and MPEG card ROM are standalone-only features disabled in the libretro port. - BIOS loading: libretro.c retro_load_game() lines 1035-1049. - Core load: memory.c LoadBios() line 1260, T123Load() memory.h lines 196-264. + BIOS loading: retro_load_game() at yabause/src/libretro/libretro.c:1035-1049. + Core load: LoadBios() at yabause/src/memory.c:1260-1263, T123Load() at yabause/src/memory.h:196-265. files: - name: "saturn_bios.bin" diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 3eba6746..26a757c3 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -2975,3 +2975,31 @@ class AMameCloneNameIsANameStep(unittest.TestCase): self.assertEqual( self.resolve(size=5, validation=["size"]), (None, "not_found") ) + + +class ProseCitationsUseTheTrackedForm(unittest.TestCase): + """profile_sync tracks `path:line` citations only. `libretro.c + I_FindFile, line 1742` escaped it, and sixteen such citations in six + profiles stayed behind when their pins moved, four already pointing at + other code.""" + + UNTRACKED = re.compile( + r"[\w./+-]+\.(?:c|cc|cpp|cxx|h|hh|hpp|inc|cs|py|rs|go|java|kt|js|ts" + r"|m|mm|s|asm|lua|sh)\b[^\n:]{0,80}?\blines? \d+" + ) + + def test_the_pattern_reads_the_old_forms(self): + for text in ("libretro.c I_FindFile, line 1742", + "memory.c LoadBios() line 1353", + "libretro_core_options.h lines 52-64"): + self.assertRegex(text, self.UNTRACKED) + self.assertNotRegex("I_FindFile, libretro/libretro.c:4176-4252", self.UNTRACKED) + + def test_no_profile_writes_a_line_number_profile_sync_cannot_see(self): + found = [ + f"{path.name}:{number}: {match.group(0)}" + for path in sorted((ROOT / "emulators").glob("*.yml")) + for number, line in enumerate(path.read_text().splitlines(), 1) + for match in self.UNTRACKED.finditer(line) + ] + self.assertEqual(found, [])