Files

15 KiB

Progress reporting

tools/progress.py generates progress.json, HTML, SVG maps and badges. The Pages workflow publishes them with the web converter after pushes to main that change the converter, the web page or these tools. The Pages progress workflow runs after pushes that change core/libs/prx or the opcode list, compares the generated progress.json with the deployed one and dispatches the Pages workflow only when they differ, so the history chart gains new days only when the progress changes. The Progress report workflow compares the base and head trees of pull requests.

The page also shows a dated estimate of library progress after combining open pull requests against main. tools/progress_prs.py fetches each open head by the commit GitHub lists for it, not by its refs/pull/<number>/head ref, which GitHub does not publish for every open pull request, applies declared dependencies first, and combines them in a temporary Git history. A head commit the server does not have, a conflict or an unresolved dependency excludes that pull request and any dependent changes. Identical changes are present once in the resulting source tree, and the existing name-based progress scanner counts each function once. Pull requests that do not change the measured source can be included without changing the percentage. If the GitHub query or virtual integration fails, the estimate is marked unavailable and the current progress remains visible. The Pages workflow refreshes the estimate daily, on relevant pushes, and when run manually. This figure is a source-count scenario, not a claim that all pull requests will merge or that the emulator is compatible with more titles.

Library counts

The scanner reads APS5_VABI function definitions under core/libs/prx/<library>/, excluding tests subdirectories and their descendants. Test callbacks do not contribute to library counts. Definitions whose names end in _nid_no_patch or _nid_no_patch_cut are internal helpers and are not counted, unless an APS5_EXPORT in the library exports them under an explicit name. Definitions with internal linkage, in an anonymous namespace (including a namespace nested in one) or declared static at namespace scope on the definition or an earlier declaration in the same file, are callbacks passed to the guest by pointer and are not counted either, unless an APS5_EXPORT exports them; their unimplemented paths are tracked in Technical debt, not on the page. A definition is pending when its body calls NotImplemented_nid_no_patch, directly or through a recognized local stub wrapper or another APS5_VABI definition of the same library. A call to another definition follows that function's own classification: it reaches the stub when every definition of that name is pending. Call matching uses complete identifiers and accepts whitespace or comments before (. Wrappers that share a name are told apart by overload: a call keeps only the overloads its argument count fits, and drops an overload whose non-const reference or pointer parameter names a type declared in the library that the argument's declared type cannot bind to (an unrelated type, or a different pointer depth). Inheritance and using or typedef aliases count as related types. An argument whose type is not a plain variable of known declared type, a template or deduced parameter, or a call no overload fits, keeps every candidate. Other definitions are counted as implemented. Braces inside string literals, character literals and comments do not delimit bodies. These counts describe declared functions, not every firmware export, verified ABI compatibility or playable games. Silent behavior and unverified assumptions remain in Technical debt.

A library with no scanned definitions can include a sibling library's source builder. The scanner recognizes literal include(${CMAKE_CURRENT_SOURCE_DIR}/../<library>/<file>.cmake) references, including quoted paths. It does not evaluate arbitrary CMake expressions. It also recognizes a top-level .cpp that includes another library's source with #include "prx/<library>/<file>.cpp".

For these wrappers, the JSON group adds shared_sources with the source library's directory name. Its own counts and name lists remain empty. The HTML table links to the source library instead of showing 0/0; the source library's map tooltip lists its wrappers. Global totals count the definitions at the source library once.

A library with no scanned definitions and no shared sources, such as one whose Export.cpp only has APS5_DUMMY_FUN because its functions are implemented in another library, is listed as having no exports instead of 0/0. It is left out of the map.

History

The table's Functions implemented column shows the net change in implemented library functions since the previous recorded day, independently of changes to the declared total. The first point is n/a because it has no previous measurement. The column is calculated for every historical point when the page is generated.

tools/progress_history.py measures the first-parent history of main with the same rules as progress.py and writes history.json, history.svg and history.html (the chart with a tooltip per day plus a table, linked from the README and the end of the progress page). The chart plots counts, not percentages, so it shows how much is added over time: one panel for library functions and one panel for each shader metric present, each on its own scale with the implemented count as a solid line and the declared total as a dashed one. The RDNA2 reference panel uses the base and VOP3 forms in tools/rdna2_isa_forms.txt. The separate gfx1013 reference panel uses tools/gfx1013_isa_forms.txt and appears only for points where the source scan measures that profile. Commits where the source scan cannot read the archived recompiler use a separate legacy panel counting the archived opcode table against tools/rdna_isa.txt. Values are comparable only within the same panel.

Each point in history.json keeps the existing shaders counts and shader_metric (decoded for the RDNA2 reference, legacy for opcode names). The optional gfx1013 object has its own done, total and percent fields; an absent profile is omitted rather than counted as zero. The gfx1013 profile appears in JSON, HTML and SVG. With --csv, history.csv includes gfx1013_done, gfx1013_total and gfx1013_percent, with empty fields for days without that profile. The history cache includes the profile parser and inventory in its counting-rules signature.

The history takes one point per UTC day, at the last commit of the day, and skips commits whose tree lacks the scanned paths. The chart compacts as days accumulate: up to 14 days it labels every day, up to 150 days one label per Monday, beyond that one per month; points are drawn up to 45 days, and every day keeps a hover tooltip, while the table and history.json keep every day. Old trees are measured with today's counting rules and instruction lists, so each series is comparable across days but is not what the page showed on that day. The workflow checks out the full history for it.

Shader recompiler numbers

The shader badges and the "Shader recompiler: counted from the code" section of the progress page come from tools/shader_scan.py. They are counted from the shader recompiler's code, not from playing games, so they say nothing about whether a game runs. badge-shaders.svg retains the RDNA2 reference counts; badge-shaders-gfx1013.svg reports the separate gfx1013 reference. The map and page label the two profiles separately. The older "GPU shader instructions" figure counted instruction names that have an RdnaOpcode enumerator and reached 100%. That figure stays in progress.json under shaders for comparisons and history, and is shown only when the shader source scan cannot run (a local run without --require-shader-source).

The RDNA2 reference uses the forms in tools/rdna2_isa_forms.txt, derived from AMD's RDNA2 instruction set. A form is the base encoding, the VOP3 encoding of a VOP1, VOP2 or VOPC instruction, or a DPP16 or DPP8 word on a VOP1 or VOP2 instruction. This preserves the existing reference total. Literal extensions, MIMG NSA forms and SDWA forms are outside that reference inventory.

The gfx1013 reference uses tools/gfx1013_isa_forms.txt: an AMD RDNA1 baseline, RDNA2 BVH A-encoding forms and supplemental opcodes from the pinned LLVM gfx1013 target. Its header records the source versions, XML hashes and included features. It is a public target reference, not a complete or hardware-verified PS5 ISA specification. Mandatory literal instructions count once; optional literals, MIMG NSA variants, SDWA selectors and other operand combinations are not separate rows. Its counts, form groups and missing names are stored under shader_source.profiles.gfx1013; the existing shader_source.instructions, dpp and forms remain the RDNA2 reference.

  • Decoded: the decoder's opcode tables under core/shader/recompiler/RdnaDecoder/src map the form to an RdnaOpcode, applying the same VOP3 opcode offsets and the VOP2 and DPP refusals as the decoder. Each reference reports decoded forms against its own inventory.
  • Translated: that RdnaOpcode has a case label in TranslationContext::emitScalar, emitVector, emitMemory or emitInterpolation. A case label shows the translator handles the opcode at all, not that the translation is correct.
  • DPP forms are reported separately.
  • Unsupported throws: throw statements under core/shader/recompiler (tests excluded) whose message or exception type says unsupported or not implemented.

The "Still needed" panel under the progress map, and the matching section of the progress page, list what is left, all read from the same scan:

  • the forms the decoder does not decode (base and VOP3 forms, then DPP forms separately) and the decoded opcodes the translator has no case for, by name, grouped by encoding and form;
  • the unsupported-throw sites as bars per recompiler area (the first directory under core/shader/recompiler; top-level files are "Recompiler"). progress.json carries the per-site file, line and message under shader_source.throw_sites;
  • image formats as bars: sampled and typed-buffer formats from the recompiler's format tables (IrBufferFormat, DefinedImageFormats, kFormatInfoTable, GetFormatInfo), and formats the driver maps to a Vulkan format in libSceAgcDriver/Graphics/src/TextureFormat.cpp (kFormatLookup and remapGuestFormat).

When the recompiler is restructured so a table or function cannot be found, the scan stops with an error naming it. The Pages workflows pass --require-shader-source, so nothing is published from a failed scan; without the flag progress.py prints a warning and leaves the shader source numbers out.

tools/rdna2_isa_forms.txt is derived from AMD's machine-readable ISA XML (amdgpu_isa_rdna2.xml, published under the MIT licence; the file keeps AMD's copyright and permission notice). To refresh it for a newer release, run python3 tools/progress.py --regenerate-isa-forms amdgpu_isa_rdna2.xml.

Regenerate the gfx1013 reference with python3 tools/progress.py --regenerate-gfx1013-forms amdgpu_isa_rdna1.xml amdgpu_isa_rdna2.xml. This validates both architectures and XML hashes against the pinned release before writing the inventory and its provenance header. A new source release requires reviewing the target features and updating the pinned inputs in tools/isa_profiles.py.

Comparisons

Comparisons identify functions by library and name. When a head group becomes a shared-source wrapper, its previous definitions are compared under the source library's identity. Removing a duplicate implementation is reported as sharing sources, without reporting the retained functions as removed.

Real removals and transitions back to stubs remain visible. Percentages retain the original snapshot totals, so eliminating duplicate accounting can change a percentage without changing available functionality. Older JSON snapshots without shared_sources are accepted.

PR reports include a table of changed libraries with implemented export counts, declared totals, percentages before and after, and the change in percent (%), the difference between the two percentages, written with the same unit as the headline of the report. The table uses the same two JSON snapshots as the global report. A library appears when its counts, export names or shared-source owner change, including when its counts stay equal. Unchanged libraries are omitted, and the table lists at most 100 libraries in name order with a count of omitted rows.

New or removed libraries show Not present on the missing side. Libraries whose snapshots contain both counts and report zero exports show No exports; if either count is absent, the table shows Counts unavailable. Wrappers show Shared sources with the source library's name. These rows show n/a for the percentage change. The table retains the scanner's counting rules; it does not measure compatibility.

Implemented definitions are also classified as behaviourally empty when their body holds only (void)name; discards and at most one constant return, bare return; or throw, including a return of a local wrapper that is itself behaviourally empty; wrapper calls whose arguments contain calls do not qualify. Comparisons list newly implemented behaviourally empty functions without changing any count. Older JSON snapshots without inert_names are accepted.

  • tools/progress_diff.py <baseline> <candidate> compares two progress snapshots as JSON: the symbol sets that were added and removed. Coverage is not game compatibility. A symbol that changes from a stub to an implementation appears in todo_names.removed and done_names.added. change_percentage_points is the candidate percentage minus the baseline percentage.

One library

--module NAME limits the library totals to those directories under core/libs/prx. Repeat the flag to include several. A name that is not a directory is an error. Shader counts stay complete. A shared-source wrapper is included only when its own directory is named. --json prints the object written to progress.json on stdout, instead of the two summary lines. Either flag makes the output directory optional. Without them the directory is still required, and a run that names only the directory still writes the whole tree.

Verification

python3 tools/tests/test_progress.py
python3 tools/tests/test_progress_prs.py
python3 tools/tests/test_progress_open_pr_page.py
python3 tools/progress.py /tmp/anyps5-progress
python3 tools/progress.py --module libScePad
python3 tools/progress.py --json
python3 tools/tests/test_progress_history.py

The regressions check that adding test callbacks leaves counts and comparisons unchanged, including when a callback shares a pending function's name or a wrapper uses shared sources. They also create a source library and a copied wrapper, move the wrapper to a shared builder, check output labels and totals, then verify real regressions and removals are still reported. With BUILD_TESTING=ON and Python available, CTest registers these suites as progress_report, progress_prs, progress_open_pr_page, and progress_history plus the progress_history_* tests.