feat(progress): count stubs no measured use needs as unobserved #13801
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13801"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T07:17:41Z.
What
This is a proposal that changes how project status is reported. The owner has decided that the headline is the rule below, implemented / (implemented + observed stubs), which shows 98.83% today. The declared figure (26.25%) stays visible next to it in every report and page. Read the headline as the share of functions that a measured use has shown to be needed, not as the share of PS5 functions implemented; the declared figure counts every declared function. If the rule changes later, only the headline commits change.
Today a function counts as pending whenever its body calls
NotImplemented_nid_no_patch. Commits that declare every callable export of a firmware library add thousands of stubs that no measured use needs (libSceNKWebKit alone has 8842 pending against 11 implemented), so the libraries figure drops and suggests work that nothing needs.This PR adds a third state to
tools/progress.py:docs/dev/observed/<library>.txt.Evidence search, 2026-10-31
Source: all 11,972 pull requests with their bodies and review bodies, all 1,314 issues, all pull request and issue comments (48,215 and 5,455), 333 review comments, 415 discussions, every commit message in the history (47,472 commits) and every markdown file on
upstream/maine8c25dd3ba.Method: an exact match of each of the 20,305 pending names, and of their 11-character NIDs computed with the repository's NID function, against all that text. 8,430 names appear in human text and 17,829 in all text including the docs. Of those, 412 names have a game or title word, or a title ID, together with a use word (calls, imports, stops, crashes, needs, requires and similar); each was classified by reading its excerpts (four reviewers, then a lead check of all 140 game-use verdicts).
Results: 82 stubs with retail-title use (26 libraries; libSceHttp2 has 20), 30 with only homebrew, emulator or app use, 26 unclear and 2 with no evidence. The 82, with the reference and the title identifier only and no excerpts:
The 82 stubs with retail-title use
sceAgcCbMemsetExclusivesceAgcUpdateInterpolantMapping_0100sceAjmBatchJobControlsceAjmBatchJobGetStatisticssceAjmInstanceCreatesceAjmStrError_ZNKSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE3getES3_S3_RSt8ios_baseRNSt5_IosbIiE8_IostateEP2tmPKcSE__nid_postfix_ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE7_GetcatEPPKNSt6locale5facetEPKS5__nid_postfixsceAmprAmmSetPageTablePoolOccupancyNotificationThresholdsceContentDeleteByPathsceContentExportFromDatasceContentExportFromDataWithThumbnailsceContentExportGetProgresssceContentSearchOpenMetadataByContentIdsceHmd2GazeGetResultsceHmd2GazeGetResultForFoveatedRenderingsceHmd2ReprojectionEnableVrModesceHmd2ReprojectionGetStatus9a0aa5f6a7sceHmd2ReprojectionInitializesceHmd2ReprojectionQueryBufferSizeAlignsceHmd2ReprojectionSetAllowPositionalReprojectionsceHttp2AddRequestHeadersceHttp2GetAllResponseHeaderssceHttp2GetResponseContentLengthsceHttp2GetStatusCodesceHttp2ReadDataAsyncsceHttp2SendRequestsceHttp2SendRequestAsyncsceHttp2SetCookieBoxsceHttp2SetMinSslVersion23398893cdsceHttp2SetRedirectCallbacksceHttp2SetResolveRetrysceHttp2SetSslCallbacksceHttp2SslEnableOptionsceHttp2WaitAsyncsceHttp2WebSocketCloseAsyncsceHttp2WebSocketCreateRequestsceHttp2WebSocketSendDataMessageAsyncsceHttp2WebSocketSendTextMessageAsyncsceHttp2WebSocketSetPingIntervalsceHttp2WebSocketSetPingTimeoutsceImeSetConsecutiveClauseConversionEnabledsceMouseSetAbsoluteVirtualScreenSizesceNpAppLauncherLaunchAppsceNpGetSandboxInfosceNpMatching2SignalingGetConnectionStatussceNpSignalingGetConnectionStatusscePadOpenExtscePadOpen_nid_postfixscePadReadExtscePadSetAngularVelocityBiasCorrectionStatescePadVrControllerGetDeviceInformationscePadVrControllerGetTriggerEffectStatescePadVrControllerReadscePsmlMfsrCreateContext1100scePsmlMfsrCreateContext1300scePsmlMfsrGetContextBufferRequirement1100scePsmlMfsrGetDispatchMfsrPacket1000scePsmlMfsrGetDispatchMfsrPacket1100scePsmlMfsrGetDispatchMfsrPacket1300beba4ce204sceRegMgrNonSysGetIntsceRudpGetOptionsceRudpGetRemoteInfoe2bfacefa3sceSaveDataCancelsceSaveDataMountsceSaveDataPrepareForTransferringsceTextToSpeech2RegisterTextConversionItemsceVideoOutClearFlipMastersceVideoOutCursorSet2xMagnifysceVideoOutSetFlipMastersceVideoRecordingClosesceVideoRecordingOpensceVideoRecordingQueryMemSizesceVideoRecordingStartsceVideoRecordingStopsceVoiceWriteToIPortsceVoiceQoSGetLocalEndpointAttributesceKernelAddFileEventsceKernelCreateSemasceKernelGetModuleInfoForUnwindsceKernelPrintBacktraceWithModuleInfosceKernelIsNeoModeRules used: a title identifier (PPSA or CUSA with a number under 90000, or a named retail title) counts as retail; identifiers in the 90000 range and named apps, emulators or homebrew do not; a statement that no title reaches a function does not count; a source link to shadPS4 does not count.
Limits: about 8,000 names appear only in human text without a game word or a use word and were not read one by one, so the count is a lower bound. The excerpts come from what people wrote publicly, not from dumps or console runs. A few counts rely on a title count ("six title binaries", "20 titles") without naming the titles.
Manifests: following the owner's decision, this PR ships a manifest for each of the 32 libraries with at least one listed name: 111 NIDs in total, the 82 retail-use and the 30 homebrew, app or emulator-use names minus one entry judged too weak; 110 of them are pending stubs on the current tree (one listed function has since been implemented upstream). The 26 unclear and the 2 no-evidence names are not listed. Each NID line is tagged
manual: reported in PR #N,issue #N,comment #Norfound in commit <sha>, cites only the public reference and holds no title name; every NID was checked with the repository's NID function against its name before it was written.Effect on this PR's tree (
upstream/main5bae1a4bc2merged in)The default is unobserved, so only the 108 observed stubs count as pending. Scanner output on the PR head
e8410ce824(after mergingupstream/main5bae1a4bc2): libraries 9138/9246, headline 98.83%; declared figure 26.25% (9138/34808); 108 observed stubs and 25,562 unobserved stubs. The per-library numbers for the 32 libraries that have a manifest (every other library has all its pending stubs unobserved):The headline is 98.83% because it divides by implemented plus observed stubs, and only 108 stubs are observed; the declared figure is 26.25%. The owner has decided to show this headline, with the declared figure next to it. Implemented functions always count; of the stubs, only those with a measured use enter the denominator, so the headline says nothing about how many PS5 functions are still missing.
Headline rule: libraries percent = implemented / (implemented + observed stubs). Every implemented function counts whether observed or not, so implementing never lowers a number. The old figure stays visible as
declared_total/declared_percentinprogress.json, as the Declared % column and the Implemented / Observed stubs / Unobserved stubs columns on the progress page, in the page text, in the PR report and in the summary line.Default: a library with no manifest file has an empty set of observed NIDs, so every pending stub in it is an unobserved stub (grey on the map, including libSceNKWebKit's); a stub is observed (red) only when a manifest names its NID, that is when a measured use found in the texts shows it is needed. There is no separate state for libraries nobody has looked at.
Known limit, stated in
docs/dev/PROGRESS.md: the import audit reads what the relinker resolves at load time and misses functions a title resolves at run time (sceKernelDlsymby name), and a NID no measurement has reached yet is unobserved, so a manifest can undercount; a manual entry with# evidence: <reason>is supported.Traceability and graphs (all optional; none changes a count or the headline rule, and none holds a title name):
tools/progress.py --originsaddsoriginsto each library group inprogress.json: for each declaration, the commit, UTC date and time, author and pull request number (pr, ornull) fromgit blameof the declaration line. The pull request is taken from the commit subject ((#N),Merge pull request #N) or from the first-parent merge that brought the commit into the branch. It needs a git work tree and is behind the flag, so the scanner still runs on a plain archive. A blame names the commit that last wrote the line, so a later edit of the declaration moves the origin; this is stated indocs/dev/PROGRESS.md. New moduletools/stub_origins.py.audit: <tool> <date>,loaderormanual: <reason>.observed_imports.py addwrites the audit tag,entryrequires--tag,checkrejects unknown tags and lists untagged entries (old lines without a tag stay valid and count asuntagged). The scan recordsobserved_tagsper observed stub andobserved_by_tagin the totals; the conventions check rejects unknown tags and warns on untagged added lines.docs/dev/inventory/<library>.txt(<NID> <source>), written bytools/stubgen.py --inventory-source/--inventory-out, read by the scan asinventory, validated by a conventions rule. No listing is shipped, because there is no machine-readable firmware list for the existing stubs on this machine.progress-detail.svg, whose tooltip for each pending cell shows the function, its state and tag, the origin commit and date, and the inventory source; the plainprogress.svgstays small. The page says how many pending functions are unobserved and counts observed stubs by tag.history.jsonkeepsunobservedanddeclared_total(old cached and old points still load and chart), the chart gains an observed-stubs line (red) and an unobserved-stubs line (grey) with their own labels, and the table links each day's commit and shows the functions declared since the previous day.declared <before>% → <after>%when unobserved stubs change, the unit is dropped from the stub counts, and each newly declared stub is listed with a link to its origin commit, its time, its author and its pull request. The report, Pages and Pages-progress workflows now pass--origins(Pages-progress checks out the full history).For reference only, the earlier scanner gave 44.67% (6822/15273) at
7a225bb303(2026-10-29) and 41.26% (6946/16836) at the parent of #13117.Changes, one coherent commit each:
tools/progress.py: manifest reader and validation, split of the pending functions,unobserved/unobserved_names/done_unobserved_namesfields (old fields keep their meaning; old snapshots withclassifiedstill validate), declared figure, snapshot validation that accepts old snapshots, comparisons and the PR report (new stubs listed as observed or unobserved, and the declared percentage before and after in the headline when unobserved stubs change, plus "implemented but not observed anywhere"), changed-libraries table, treemap with a dimmer third colour and a legend, library table, page text, summary line.tools/progress_history.py: measuresdocs/dev/observedwhere a commit has it; commits from before the manifests have none, so their stubs are all unobserved (said on the page).tools/observed_imports.py(new):addmergesimport_audit.py --json/audit_dump.py --jsoninto the manifests (sorted, deduplicated, rejects malformed NIDs and unknown libraries,--checkwrites nothing),entryadds one NID with a required provenance tag,checkvalidates the files and the tags. NID matching reusesnid_names.nids_of(moved fromimport_audit.py), soAPS5_EXPORTaliases and postfixes map exactly as the audit maps them.tools/check_conventions.py: newobserved-manifestrule for files underdocs/dev/observed(name, library exists, sorted, unique, valid NIDs). The silent-stub and unknown-nid rules are untouched. I did not add a non-blocking note for PRs that add many exports absent from the manifest.tools/stubgen.py: help text says stubs for unobserved NIDs are inventory only.tools/import_audit.pycounts observed and unobserved stubs alike as stubs, so the audit does not depend on the manifests.docs/dev/observed/**(and the new tool ornid_names.pywhere they matter) added to the path filters ofpages.yml,pages-progress.ymlandprogress-report.yml.progress-comment.ymlneeds no change.docs/dev/PROGRESS.md(states, headline vs declared, manifest format, tool, limits), the README footnote and the footnotes of the four translated READMEs (docs/user/README.es.md,docs/user/README.pt-BR.md,docs/user/README.ru.md,docs/user/README.zh-CN.md),CONTRIBUTING.md,docs/dev/GAME_TESTING.md,docs/user/USAGE.md. The translations of the footnote are not reviewed by a native speaker.Tested
No C++ changed, so no build or ctest run. Everything below was run locally on Linux with Python 3.11 on the head named in the PR; Hosted CI results are on the PR checks, not in this description.
Scanner,
python3 tools/progress.py --json. With no manifest every pending stub is unobserved, so the merge base93c71cc1bb(a tree without manifests) gives libraries 7216/7216, headline 100.0%, declared 7216/27404 = 26.33%, which is the old headline; shaders 1166/1166 as before. On the PR head tree (with the 32 manifests andupstream/main5bae1a4bc2merged in): libraries 9138/9246, 98.83%, declared 26.25% (9138/34808), 108 observed and 25,562 unobserved stubs (observed_by_tag{manual: 110}). The rule that a library with no manifest is unobserved is pinned by a test that scans a library with no manifest, by one that scans a whole tree with no manifest directory, and by the same stub counted observed only once a manifest names its NID.Tests on the PR head, all passing: 446 tests across
test_progress,test_progress_history,test_shader_scan,test_progress_render_sliver,test_progress_wrappers,test_import_audit,test_observed_imports,test_stub_origins,test_stubgen,test_check_conventions_observed,test_inspect_selfandtest_audit_dump(7 skipped). The full tools suite (everytools/testsmodule excepttest_run_report_schema, which needsjsonschemafrom its own workflow venv) runs 2021 tests with 2 errors, both intest_patch_lib_atrac9; the same two fail onmain, because that test reads CMake'ssys.argv[1].tools/check_test_registration.py --scripts(243 scripts),python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpass. Negative control on the PR head: counting unobserved stubs in the headline denominator (summarize) makes 12 tests fail intest_progress,test_progress_history,test_progress_render_sliverandtest_progress_wrappers; with the change reverted all of them pass again.tools/env_reference.py --checkfails identically onupstream/mainand on this branch (APS5_PAD_SPEAKER_FALLBACK_DBhas a row but is no longer read).Negative controls for the traceability work, each failing as expected and passing again after restoring: no per-cell tooltips fails 2, accepting unknown tags fails 1, no declared figure in the headline fails 2, a flat unobserved series fails 1, no origins fails 2, the unit on stub counts fails 3. Negative control for the default: counting every pending function as observed fails 8 tests and errors in 3 in
test_progress, and fails 3 intest_progress_history. Tests also cover a stub with its NID in the manifest counted and the same stub without it not counted, an empty manifest, aliases, and an old snapshot that still compares.The branch is based on
93c71cc1bband hasupstream/main5bae1a4bc2merged in.With
--originsthe run takes about two minutes and names the origin of nearly every function;progress.jsonwith origins is 11.8 MB,progress-detail.svg7.9 MB and the plainprogress.svg4.0 MB, which is why only the detailed map has per-cell tooltips. On the full history at head 969a4d5d5f, 26,277 of the 32,925 declarations name a pull request (1,462 distinct pull requests) and all 32,925 have a time and an author; the other 6,648 declarations come from 67 commits that reachedmainwithout a merge commit naming a pull request or a(#N)subject, so theirprisnull. On a fixture repository with a manifest (one audit-tagged and one loader-tagged NID), an inventory listing and one commit, the scan printedlibraries 1/3 (33.33%), declared 25.0% with 1 unobserved stubs,observed_by_tag{audit: 1, loader: 1}, the colours in the detailed map and the tooltip of that stub named its declaration commit and date; the time, author and pull request parts were added afterwards and are checked bytest_origin_text_names_the_time_author_and_pull_request, which prints<sha10> on 2026-05-06 12:00 UTC by <author> in PR #<n>.Not done: no inventory listing is shipped (no data) and the manifests hold only the 111 NIDs with public evidence, so the headline is high until more evidence is added; origins name the commit that last wrote a declaration line, not always the first one, and the 67 commits without a pull request number have no
pr; the history chart and table use the commit of each day, not a per-stub origin; the history chart attached for review samples about a dozen days of the first-parent history instead of every day; C++ build and ctest, CI, the Pages workflows, and a visual check of the rendered SVG and HTML were not run.Overlaps, rechecked on head
e8410ce824(merge previews against the current heads of the open pull requests named here): clean with #13171, #12766, #12767, #10218, #12881, #14321 and #14424. #13615 has merged since the earlier check. #14212 (a draft, janzezno) conflicts with this branch intools/check_conventions.pyand needs a rebase after this PR or before it. #7454 already conflicts withmain, and this PR does not touch those lines.Completeness audit: every file named in the task was re-read and either changed or checked and left alone (
audit_dump.py,audit_nid_names.py,pr_overlap.py,progress-comment.yml, the PR template,TechnicalDebt.mdand the debt documents); agit grepfor the two-state names over tools, docs, README files, workflows and tests found no remaining consumer that assumes two states other than the ones above. It is repeated against the pushed head after opening.Graphs
Reading the graphs (the same explanation is on
progress.html,history.htmland in the README footnote). Green is implemented: the function no longer callsNotImplemented_nid_no_patch. Red is an observed stub: declared but not implemented, and a measured use shows it is needed. Grey is an unobserved stub: declared but not implemented, and no measured use is known, which does not mean no title uses it; in the shader panel the same grey is a form the decoder does not decode yet, or an instruction that is not implemented, and red is never used there, and the map legend has one grey entry, "Unobserved stub (libraries) / Not implemented (shaders)". The headline is implemented / (implemented + observed stubs), so grey stubs do not lower it; the declared figure is implemented / (implemented + observed + unobserved) and counts every declared function. The headline is 98.55% because only 110 stubs are observed; the declared figure is 22.72%. The maintainer must choose the headline rule before this leaves draft.The history chart keeps the original two panels. The system library panel now plots implemented (blue), observed stubs (red) and unobserved stubs (grey) on the same axes, with the dashed counted line and a label for each series at the right edge; the GPU shader panel is unchanged. It samples 48 days, from 2026-09-15 to 2026-11-01, one point each, because measuring every commit takes hours. The maps and the history chart below were generated from head
e8410ce824(after mergingupstream/main5bae1a4bc2) and are the current files of the gist. Their numbers are 9138/9246 (98.83%) with 25,562 unobserved stubs, the same as the figures above.What the progress-report comment looks like (example from head
e8410ce824)The Progress report workflow comments this text on a pull request. The block below is the exact output of
python3 tools/progress.py --compare base.json head.json, generated locally from base5bae1a4bc2(upstream/main, a tree without manifests) and heade8410ce824(this PR, scanned with--origins), the same snapshots and function the workflow uses; nothing was edited.98.83% (..., ...)is implemented over implemented plus observed stubs on the head, and the figure in brackets is its change from the base. It is printed whenever the headline, the observed count or the unobserved count changes, even when no function was implemented or declared, so a reviewer always sees the headline move. Here it falls because the base has no manifests, so every stub there is unobserved and the base headline is 100%.108 observed stubs in total, 25562 unobserved stubs in totalare the totals on the head, after the per-function changes such as+1 implemented functionsor+2 observed stubswhen there are any. They say how much of what is declared has a measured use (observed, red) and how much has none known (unobserved, grey).declared 26.25% → 26.25%is implemented over every declared function, observed or not, before and after. It does not move when only classifications change, which is why it sits next to the headline: it shows whether the headline moved because functions were implemented or because stubs were reclassified.implemented/(implemented + observed stubs) (percent)plus+N unobservedfor that library's grey stubs, and Change as the difference of the two percentages (n/awhen a side has no observed or implemented function). A library whose Before is 100% had no observed stub on the base, so nothing counted as pending: unobserved is the default for a stub with no measured use, and the sentence above the table says so.Newly implemented functions with no measured use: when a pull request implements a function that no measured use shows to be needed, the report adds a warning line under the headline, for example
⚠️ 1 newly implemented function with no measured use: add each one to docs/dev/observed with its reason in this PR, or name the observed function that needs it.The sample above has no such function, so the warning is not in it. The warning is not an error: it clears when the function is listed with its reason in the same pull request, or when the pull request names the observed function that needs it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Pull request closed