Progress counts host-safety fault throws as unimplemented: add a separate fault helper #23391
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 RiverWhy on 2026-11-18T23:57:38Z.
Problem
tools/progress.pycounts an export as implemented once it no longer callsNotImplemented_nid_no_patch. Many exports still call it only on inputs where the console module would crash, or where upstream has undefined behaviour, for example a null pointer or an unreadable guest buffer. On such inputs there is no behaviour left to implement: the host must throw instead of crashing the emulator. But because the throw goes throughNotImplemented_nid_no_patch, these exports show as unfinished forever.The same situation is counted both ways today, depending only on which exception the author picked:
libharfbuzz, the buffer exports throwstd::runtime_errorfor a null buffer (Buffer.cpp:146onwards) and count as done.hb_shapethrowsNotImplemented_nid_no_patchfor the same null buffer (Shaping.cpp:21) and counts as todo.libharfbuzzshows 31 of 38. Its 7 "todo" exports already forward every valid input to HarfBuzz 10.0.1. Their onlyNotImplemented_nid_no_patchcalls are a null buffer, font, face or feature array, null blob data with a nonzero length, a foreign FreeType face, and a failed load of the bundled ICU data.libfontconfigshows 24 of 53. In it,FcConfigCreateandFcConfigReferencealways return null, so the "config exists" branches ofFcFontList,FcFontMatch,FcFontSort,FcFontSetMatchandFcConfigSubstitutecan never run. The other throws are null arguments that Fontconfig 2.15.0 asserts against.Across
core/libs/prx, 133NotImplemented_nid_no_patchcalls in 19 libraries are guarded only by a null check on the same line. There are about 1,900throw std::invalid_argumentsites, many of them for the same kind of input in exports that already count as done.This understates progress, and it also hides the real gaps: a reader can't tell "behaviour unknown" from "console crashes here, so the host throws".
Proposal
Add a second noreturn helper next to
NotImplemented_nid_no_patchinlibc/include/General.hpp. The name is open, for exampleGuestFault_nid_no_patch(name): it would throw the same way, but it is meant only for inputs where the console module faults or asserts, or where upstream behaviour is undefined. Then:tools/progress.pytreats it like a plainthrow, so an export whose only remaining throws are faults counts as implemented.CONTRIBUTING.mdandAGENTS.mdkeepNotImplemented_nid_no_patchfor unknown or unimplemented behaviour. The new helper needs a reason, such as "upstream asserts", "module dereferences null" or "unreadable guest pointer", either in the PR or in the library's technical debt, so it isn't used to hide real gaps.If you'd rather keep a single helper, an alternative is for
progress.pyto ignoreNotImplemented_nid_no_patchcalls whose condition is only null or guest-access checks. That's harder to get right and easier to game, so I'd prefer the explicit helper.If this is acceptable, I can do the helper and the
progress.pychange first, thenlibharfbuzzas the first library, with each call site checked against HarfBuzz 10.0.1.AI-assisted: yes (Claude Code); the counts and line references are from
mainat the time of writing.