Commit Graph
3079 Commits
Author SHA1 Message Date
Abdessamad Derraz b5cfa9179f refactor: drop the unused deterministic zip writer 2026-11-21 05:59:58 +01:00
Abdessamad Derraz 3fa2f77722 refactor: share one timestamp key table 2026-11-21 05:59:58 +01:00
Abdessamad Derraz 6df0ec503b refactor: stamp site data with build_timestamp 2026-11-21 05:59:58 +01:00
Abdessamad Derraz 8edf224999 chore: read records with record_at in slots test 2026-11-21 05:59:51 +01:00
Abdessamad Derraz fc70a1afa6 fix: accept core names in profile_sync and audit 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 8fdc00e07f refactor: look up a path's sha1 with sha1_at 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 82d3f595de refactor: read data/.versions.json in one place 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 67cb99606d refactor: read data dirs and inherits in one place 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 7be8a7cd7b fix: stop on one line when pyyaml is missing 2026-11-21 05:59:51 +01:00
Abdessamad Derraz eef13547e1 refactor: share one derived-view cache 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 35f335d001 refactor: read target overrides through one reader 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 812f2609db fix: read every source yaml as utf-8 2026-11-21 05:59:51 +01:00
Abdessamad Derraz d4aae50601 fix: read the guides file with the source loader 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 26c45da318 fix: keep the screen tests importable on 3.8
tests/sources.py used functools.cache (3.9) and test_install_selection
imported resolve.regions, which reaches core.cli and its 3.9 floor exit.
Both broke python3.8 -m unittest tests.test_install_tui in Validation.

ruff UP033 asks for functools.cache under target py39, so the modules the
3.8 run imports take the same UP exemption as installer/.
2026-11-21 00:08:06 +01:00
Abdessamad Derraz f025264f4e refactor: link platform lists through permalinks
ListSource.browse builds file links with source_permalink, which quotes
the path. A list read at no revision still links the repository, and a
GitLab list with no path now links its tree instead of a blob URL
ending in a slash.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 97af05db9a refactor: name release packs from the record
model.releaserecord now holds match_key, pack_label and pack_owner,
which the release notes and download.py each kept a copy of, and
recorded_pack, the pack release.json says serves a platform.

download.py reads release.json when it records the release it
downloads from. Otherwise it matches pack names and takes the shortest
match, so retroarch gets RetroArch_v1.22.2 rather than the
AndroidArm64V8A target pack listed before it.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz ad49fe8967 fix: pin large-files sizes in one decimal
The release notes test follows core.sizes.size_text, which the large-files page now prints.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 4dc4dc0429 refactor: restore large files with one copy
model.largefiles.restore_verified replaces generate_db _restore and
release restore _copy_verified: a scratch copy beside the target,
hashed, then renamed into place with a plain mode.

generate_db now refuses to put back a cached asset whose copy does not
hash to its database entry. The entry is still kept, as for an asset
the cache cannot supply. The restore script copies once instead of
through a second scratch.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz ab0805e6cb refactor: print sizes with one function
core.sizes.size_text replaces readme format_size, release record
size_text, render fmt_size, the large-files notes _mib and the handheld
_size. It prints one decimal in the largest unit reached, as the site
and the installer already did.

The README download table, the release notes and the large-files page
now say 29.2 MB where they said 29 MB, a handheld archive says 85.3 KB
where it said 85 KB, and a large-files asset under 1 MB is given in KB.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 3a76cf48ba refactor: share resolver, content and nightly
The probes resolve held files, read content.yml, list the buildbot and
fetch nightlies through one function each.

- region_check resolves BIOS files from the repo root (probes.entries
  held_file), so a run outside the root no longer sees every file missing.
- region_check reads content.yml as Content objects, and a malformed
  content folder raises Unavailable instead of FileNotFoundError.
- region_check and pack_probe fetch nightlies like the campaign: retried
  on network errors, streamed to disk, and replaced when the buildbot's
  ETag or Last-Modified moves. region_check keeps its cores under
  .cache/region/cores/<core>/ with a build.json record. pack_probe
  --refresh-cores now downloads only a nightly the buildbot replaced.
- The campaign loads profiles with load_emulator_profiles, so *.old.yml
  backups are skipped and hashes are normalized. Profile digests still
  come from the file on disk, so recorded checks keep their digest.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 1165b910ed chore: read the tree walk call through Placed
The builder passes its Placed to data_directory_members: the source
check of RequiredOnlyReachesDataDirectories looks for that call.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz c2dc50db50 chore: count path index walks over items too
record_at builds its index from files.items(): the walk counter of
test_slots counts items() as well as values().
2026-11-20 20:03:26 +01:00
Abdessamad Derraz 8bc1fcb5db refactor: index the database by path once
model.database.record_at and sha1_at read one cached path index with
normpath keys. They replace records_by_path of resolve.packfiles, the
manifest's own sha1 index, the per-call indexes of regionaudit,
emulatorcheck and hidden_extras, and the linear scan of held_record.
resolve_sha1 drops its by_path argument. A path spelled with ./ or a
doubled slash now finds its record everywhere; the database writes none,
so the output is the same.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz ca3ff1d4c5 refactor: place every file through Placed
data_directory_members, pack_data_tree and manifest_core_entries take
the Placed record instead of three loose sets and a fold flag, and verify's
replay of the builder (_builder_placement), hidden_extras and the
emulator pack check keep a Placed of their own. hidden_extras records the
sha1 at each taken path through the new Placed content option, which keeps
its same-content case twin rule. No behavior change.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz facebef9e5 refactor: index source lines once per file
core.lines.LineIndex answers the line of an offset by binary search.
mame_parser and fbneo_parser counted the newlines before each match,
O(n) per set, and csharp_source kept its own copy of the index.

arcade_parent_importer reads a profile's repository slug through
core.upstream.parse_repo and refuses a source that is not on GitHub,
the only forge its fetches reach.
2026-11-20 20:03:20 +01:00
Abdessamad Derraz c63c2f369e chore: run every batocera test class directly
unittest.main() now follows the locator tests added after it.
2026-11-20 20:03:09 +01:00
Abdessamad Derraz 0332f6149a refactor: read RetroPie scripts from one tarball
script_members in retropie_scraper yields every shell script of a
RetroPie-Setup tarball. The platform scraper, the exporter and the target
scraper read the scripts through it. The target scraper fetched one
contents listing per section and about 200 raw files; it now reads the
tarball of the pinned revision in one request. On the cached tarball the
three produce the same module ids, scripts, BIOS-bearing scripts and
targets as before. The targets file keeps its source URL.
2026-11-20 20:03:09 +01:00
Abdessamad Derraz f7c08a6ca3 refactor: read md5 lists through parse_hash_list
The RetroDECK and Recalbox exporters compare md5 lists with
resolve.reconcile.hash_values, and the RetroDECK scraper reads an entry's
md5 with md5_field and parse_hash_list instead of its own copy.

Recalbox's comparison no longer keeps an empty item: md5="a,,b" states
a,b where it stated ,a,b. The RetroDECK scraper now splits a
comma-joined value and refuses an md5 that is neither a string nor a
list of strings, as the batocera-systems readers do. The ten cached
component manifests write neither form, so retrodeck.yml is unchanged.
2026-11-20 20:02:44 +01:00
Abdessamad Derraz e19025231e refactor: locate the systems dict once
systems_span in batocera_scraper finds the systems literal of a
batocera-systems script by reading strings of either quote and
comments, and accepts systems = OrderedDict({. The exporter cuts the
script at those braces and reads comments with the same comment_start,
in place of its line prefix rule, its ast fallback and a comment test
that only knew double quotes. Both give the same cut on the cached
Batocera, AmberELEC, EmuELEC, KNULLI and ROCKNIX scripts.

An unclosed dict is refused by name instead of failing in literal_eval.
2026-11-20 20:02:44 +01:00
Abdessamad Derraz db1446079a refactor: read listxml through one streamer
scripts/scraper/listxml.py holds the element window, attribute
reader, ROM member extraction and open_listxml that romset_dat_importer,
mame_devices and arcade_parent_importer each wrote. On mame0289lx.zip
and the 19 FBNeo DATs the three produce the same recipes, release and
sets as before.

Attribute values are entity-decoded everywhere: romset_dat_importer
kept f&amp;m.basic.bin where the archive member is f&m.basic.bin. The
five comx_eb member names of recipes/mame.json are corrected to what a
re-import now writes. A release zip with no or several .xml members is
refused by name instead of raising StopIteration.
2026-11-20 20:02:44 +01:00
Abdessamad Derraz 3505eaa835 refactor: walk es_systems.yml once
es_systems_entries yields (system, emulator, core, spec) and the four
batocera_scraper readers and the target scraper's package map are built
on it. Output is identical on batocera-43.1's es_systems.yml.

The target scraper now raises on a file that is not a mapping or does not
parse, where it returned an empty map and failed later on 0 mappings.
2026-11-20 20:02:30 +01:00
Abdessamad Derraz f61c2cb7d4 refactor: one network layer for the scrapers
Each network job had several copies. One is kept per job and
every caller uses it.

- Source revision: model.sourcerevision (source_revision, required_revision,
  platform_revision) replaces BaseTargetScraper's pattern list, the
  exporter's _REVISION, the four launcher_revision copies and RetroBat's
  own YAML reader. It reads the union of the shapes: GitHub raw, blob and
  tree with or without a path after the revision, GitLab raw, blob, tree
  and archive, codeload tar.gz and zip. The target scrapers now answer
  for RetroDECK, NextUI, MinUI and MyMinUI, whose tree URLs end at the
  commit, and the exporter reads GitLab blob and tree and codeload zip.
  EmuDeck and RetroBat still require a 40-hex commit, and each launcher
  reader requires its own repository in the URL.
- Latest release: fetch_github_latest_version, type-checked, is the only
  lookup. mame_hash_scraper, romset_dat_importer and the Lakka target
  scraper call it. romset_dat_importer's NoReleaseError is gone: a
  release without a tag raises RuntimeError.
- Tree listing: github_tree and tree_entries refuse a truncated or
  unreadable listing. The libretro and core-info scrapers share
  core_info_files and fetch_info_file, with libretro's refusal of an empty
  listing. The core-info listing and the RetroDECK, ROCKNIX launcher and
  libretro listings were not checked for truncation before.
- GET: fetch_bytes is the one request path. fetch_text, fetch_present
  (None on 404 only), github_json and download are built on it, so every
  read retries 429 and 5xx, caps the body and raises FetchError, a
  ConnectionError carrying the HTTP status. The target scrapers' own
  fetch_text raised RuntimeError: they now raise FetchError, and an
  optional Batocera board include is skipped on 404 only, not on any
  failure. The exporter's originals, MiSTer, RetroPie, redump and the
  buildbot index go through it too.
- Headers: core.upstream.forge_headers is the one builder. The token goes
  to api.github.com and raw.githubusercontent.com, the host compared
  whole, as Bearer. A URL that only names api.github.com in its query
  got the scrapers' token before, and profile_sync sent its token to
  github.com, whose release downloads redirect to asset storage with the
  header. Scraper reads of raw files now carry the token.
- Submodule commit: submodule_commit checks that the path is a
  submodule. Batocera's target scraper accepted any contents answer with
  a sha, a directory's tree sha included.
- Download: download streams through a scratch file renamed into place,
  retries like fetch_bytes, can keep an existing file and returns the
  Content-Disposition. It replaces the _download of romset_dat_importer
  and game_dat_importer.
2026-11-20 20:02:15 +01:00
Abdessamad Derraz cf03dcb2ef refactor: share CLI options and default paths
core.paths holds the default database, platforms, emulators and bios paths, core.cli declares the options built on them (add_repo_inputs) and the --emulator/--system modes verify and generate_pack share. model.targets.target_scope answers --target for a command line, model.profiles.no_profile_for_systems the system with no emulator. tests/sources.declared_options reads the options a script declares through either form.
2026-11-20 18:28:46 +01:00
Abdessamad Derraz 348d5b51c3 refactor: read hashes and the registry one way
Hash fields go through core.hashing.parse_hash_list, which also splits comma-joined list items: the truth model compared a comma-joined sha256 list as one value. _registry.yml goes through load_platform_registry (required= where an absent file must stop the run), database.json through load_database, file and member digests through file_digest and stream_hashes. download.py and check_release read SHA256SUMS.txt with one parser: a sha256sum -b line matched nothing in download.py and the pack went unchecked.
2026-11-20 18:28:40 +01:00
Abdessamad Derraz ac16875c5b fix: date the site period from its first count 2026-11-20 08:18:16 +01:00
Abdessamad Derraz 84f749fda9 feat: read GoatCounter counts from its export
Paging /stats/hits by exclude_paths spent more than the 500 requests
GoatCounter allows in an hour on four weeks. The JSON export holds the
same hourly counts by path and referrer: on 2026-11-10 to 16 it gave
67,877 views and 24,343 actions, the figures /stats/total gives, with
identical top paths and referrers. One export an hour is allowed.
2026-11-20 07:17:36 +01:00
Abdessamad Derraz e1cbf79415 feat: collect the Switch firmware NCAs
The yuzu family reads its firmware from nand/system/Contents/registered/,
which EmuDeck links from bios/<emulator>/firmware and RetroBat places in
the emulator folder. The 229 NCAs of the held firmware zip are now kept
loose under that tail, so the directory entries resolve and the packs
and install lists carry them. Each NCA is named after the first 16 bytes
of its SHA-256, the comparison the firmware install runs, and a test
holds every committed NCA to it. The NCAs are committed, so the entries
no longer claim release storage.
2026-11-20 05:36:15 +01:00
Abdessamad Derraz 075ae0d9ad fix: keep a smaller GoatCounter window once full
A day over the excluded-path cap was read whole, then again in halves,
and the next day the same. Four busy weeks spent the 500 requests
GoatCounter allows per hour before the report was written. The window
now keeps the size that fit, so the overflow is paid once.
2026-11-20 04:37:46 +01:00
Abdessamad Derraz de3c570886 chore: record the citron and suyu source trees
The Eden note test reads the corrected firmware note.
2026-11-19 20:52:25 +01:00
Abdessamad Derraz c7ea76fbfb feat: document the Switch firmware trees
Each yuzu-line profile (yuzu, suyu, sudachi, citron, eden) gains the
installed tree nand/system/Contents/registered/ and the install medium
the UI accepts, Ryujinx and Kenji-NX the bis/ tree and the zip, xci or
folder ContentManager verifies. Citron and Suyu are pinned to their
Software Heritage revisions.
2026-11-19 20:23:54 +01:00
Abdessamad Derraz 56290f3bb7 fix: name an unanswered directory by its path 2026-11-19 20:23:54 +01:00
Abdessamad Derraz b4b4ddffb5 feat: give every Nintendo console its own page
"gba bios" landed on mGBA's page because the Game Boy Advance was a section of the Nintendo page. CONSOLE_PAGES now splits Nintendo as it does Sony: eleven more consoles get a page (Famicom Disk System, Game Boy Advance, Game Boy Color, Nintendo 64, Pokemon Mini, Satellaview, SuFami Turbo, Super Famicom Box, Super Game Boy, Switch, Wii). Each section keeps its heading and anchor on the Nintendo page and leads to the console's page. The search gate expects the Game Boy Advance, Game Boy Color and Wii pages first for their queries.
2026-11-19 19:58:08 +01:00
Abdessamad Derraz 2d587749a5 feat: move two long gap tables to their own pages
The per-emulator table (339 rows) and the files not collected yet (282 rows) held most of the 8,300 elements of /gaps/, laid out in one 200 ms task on a phone. Each is now a page of its own linked from its section, which keeps its heading and anchors (per-emulator, not-collected-yet, acknowledged-gaps) with the row count. Emulator cards link the new page. Mobile Lighthouse Performance on /gaps/ goes from 99 to 100.
2026-11-19 19:58:08 +01:00
Abdessamad Derraz 831f12db1a fix: generate the pronoun test site in a copy
test_site_pronouns ran generate_site.py in the checkout, which rewrote website/public/data/wanted.json and the pages after a build, and ThePublishedList then compared the built page with another list. The run now happens in the scratch checkout copy.
2026-11-19 19:58:08 +01:00
Abdessamad Derraz b2ec1969e0 refactor: hold the search hint in one attribute
Two empty kbd elements with a data-key each added 24 bytes to every
page and put RomM over its weight budget in test_site_platform_density.
The hint is one data-key on the outer kbd, 50 bytes lighter than the
text it replaced.
2026-11-19 18:42:55 +01:00
Abdessamad Derraz 9760c2fadd fix: size the upstream table by a class
The cross-reference upstream table was reached with
.sl-heading-wrapper:has(> #by-upstream-emulator) ~ section, which the
browser matched again for every block added after any heading of any
page: about 400 ms of style work while the gaps page loads (mobile, 4x
CPU throttling, 586 ms down to 200 ms). The table sits in a
.rb-xref-upstream block, and the address column is its second.
2026-11-19 18:42:55 +01:00
Abdessamad Derraz cb23f7f8a4 fix: read table and sidebar geometry after layout
Two reads forced a layout of the whole page. The sidebar measured the
current link as the script ran (114 ms on gaps, mobile, 4x CPU
throttling), and every table's width was read in an idle callback that
still found the layout invalidated (103 ms), then again after enhance()
wrote captions (131 ms). The sidebar now reads an IntersectionObserver
entry and the tables a ResizeObserver, whose callbacks run once the page
is laid out. The observer also covers a window resize and a block that
opens.
2026-11-19 18:42:55 +01:00
Abdessamad Derraz 3eb5d1fce1 fix: lay out every file card
With content-visibility: auto an off-screen card took a 320px
placeholder, so the links of the card above were drawn over its own and
Lighthouse failed target-size on the PS2 page (31 links on desktop, 7
on mobile). Laying out every card moved no Lighthouse metric: TBT stays
at 0 ms on the PS2 and Project64 pages, mobile.
2026-11-19 18:42:55 +01:00
Abdessamad Derraz 7e4192870f fix: draw the search shortcut hint from CSS
The search button is named "Search" and showed "Ctrl K" as text in
its content, so Lighthouse flagged label-content-name-mismatch. The keys
are drawn from data-key with ::before, and aria-keyshortcuts still
announces the shortcut.
2026-11-19 18:42:55 +01:00
Abdessamad Derraz 950aa6de25 feat: put the command first on split pack pages
A get/ page whose release pack comes in parts opens on the command, then offers the parts and says all are needed. A pack in one file keeps its ZIP first and now shows the command after it.
2026-11-19 17:46:30 +01:00