feat(libSceNpTrophy2,libSceNpUniversalDataSystem): record trophy unlocks and statistics #7335

Merged
EagleBearerYS merged 13 commits from upstream-pr/7335 into main 2026-10-18 02:58:23 +00:00
EagleBearerYS commented 2026-10-18 00:49:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T00:49:36Z.


What

Trophies now unlock the way a title defines them. This is the second half of the split asked for on #7262 (merged), which reports the title's trophy data with every trophy locked: this PR records unlocks and statistics and connects those queries to them. It is built on #7262's head 61e12c75fd, so with #7262 merged its diff shows only its own commits. The title's own sce_sys/uds/udsNN.ucp is read once per service label, on first use, like the trophy data.

  • Unlocks a title posts are recorded. _UnlockTrophy with an int32 _trophy_id unlocks that trophy for the title, user and service label. The unlock goes in a host file next to save data (/_trophy/<user id>_<service label>.txt) and survives restarts.
  • Unlocks through statistics. Every other event a title posts goes through the title's statistics rules (stats_extraction.json in udsNN.ucp). A rule sets a statistic from one of the event's properties. After each event that sets one, every trophy's unlockCondition is checked (ge, gt, le or lt against its target) on the values that event set and the stored values of the others, and reached trophies unlock the same way. Statistics keep their latest value in /_trophy/<user id>_<service label>.stats.txt, so progress also survives restarts.
  • Platinum unlocks once every trophy that names it in platinumTrophyId is unlocked, whichever way they were unlocked.
  • Posted unlocks follow the title's rules. With the title's trophy data loaded, _UnlockTrophy of an id that isn't in it, of the platinum, or of a progressive trophy is refused with one line ([trophy] ignored the posted unlock of trophy 0 for user 268435456: it is the platinum, which unlocks with the last trophy that names it), as KytyPS5 does; those unlock through their statistics and the platinum rule instead. Without trophy data, every posted id of 0 or more is recorded, and no platinum unlocks by itself, since the rule needs the data.
  • The queries report unlocks. A trophy reports whether it is unlocked and when, a progressive trophy its progress, and the game and its groups their unlocked counts and progress_percentage.
  • A new unlock logs [trophy] <title id> unlocked trophy <id> for user <user>. With APS5_TRACE_UDS=1, every post and every statistic it sets is printed too.

Planet of Lana (PPSA19450) earns its trophies this way. Its statistics rules are all of kinds this PR skips (see Not covered):

[trophy] /app0/sce_sys/uds/uds00.ucp: 0 stats, 0 rules for 0 events

Sneaking past the chef at the start of Chapter 1 posts the unlock of trophy 12, "Sneaky Sisters" ("Sneak past the chef" in the title's own data):

[uds] context 1 posted _UnlockTrophy {"_trophy_id":12}
[trophy] PPSA19450 unlocked trophy 12 for user 268435456

The unlock is stored as 12 63927864523936811 in _trophy/268435456_0.txt, next to the title's app0/.

Titles that ship no udsNN.ucp, or post no trophy events, behave as with #7262:

  • Every return code is the same.
  • A missing file is silent (a [uds] line with APS5_TRACE_UDS).
  • A malformed file logs one [trophy] <file> is malformed, so ...: <reason> line and turns off only its own feature: without statistics rules, events set no statistic. _UnlockTrophy keeps working either way.
  • One behaviour change: posting a null event pointer, one that CreateEvent didn't return, or one already destroyed now throws, as the library's other invalid arguments do. Before, it was ignored.

How:

  • Events and properties. libSceNpUniversalDataSystem's events and property objects get real contents: int32, uint32, int64, uint64, float, double, bool, string, bytes, nested objects and arrays, with keys kept in insertion order. A registry owns what the Create functions return; Destroy* on anything else, such as an event's own property object, does nothing, because its owner frees it.
  • From event to unlock. A rule picks its $.path property (nested objects give a.b paths). The value is used if it's a non-negative integer that fits the statistic's type and lies within its minValue/maxValue. Otherwise it's ignored with one [trophy] ignored <event> $.<path> for stat <id>: <reason> line. A statistic that was never set reaches nothing, so le and lt trophies don't unlock at a start value of 0. Well-formed entries this doesn't support (for example a sum aggregation) are skipped, each with one log line.
  • The store. One file per user and service label for unlocks and one for statistics, each rewritten through a temporary file and a rename, via RecordWrittenPath_nid_no_patch like other host writes. A statistic is written only when its value changes (StatStore::Set returns early otherwise, TrophyStore.cpp:173), so a statistic that changes with every event writes its file each time. A damaged file throws with its name and line (a debt entry, below).
  • Hook. An unlock listener hook (NpTrophy2AddUnlockListener_nid_no_patch) is there for a later pop-up. Removing a listener waits for an unlock callback that is running, so a removed listener is never called. sceNpTrophy2RegisterUnlockCallback is still not called, because its callback signature isn't public.

Choices the public data leaves open, each listed as debt:

  • A property of any integer width counts toward a statistic if it fits, so a title that sets a counter with SetInt32 still counts. The one public implementation requires the exact width.
  • A progressive trophy reports min(statistic, target), and its target once unlocked.
  • progress_percentage weighs gold 6, silver 2 and bronze 1 and leaves the platinum out, as KytyPS5 does; the console's formula is not known.
  • The platinum rule: whether the console needs exactly the trophies that name it, or every other trophy of the base group. The two agree when every base trophy names it.
  • Damaged records (the last commit): a line in _trophy/<user id>_<service label>.txt or .stats.txt that isn't a new <id> <value> pair (a blank line or one ending in a carriage return included) throws in every trophy query, posted unlock and statistic update that reads that record for its user and service label. The export doesn't return, which stops the title, and the record is read again each time, so it keeps failing until the file is fixed or deleted. On main these calls returned 0.

Sources. Interface facts only, no code, from KytyPS5 (GPL-2.0) at 9e41d8320a:

  • src/common/trophies.cpp: the stats_definition.json and stats_extraction.json keys, and the four comparators;
  • src/libs/libTrophy.cpp: the _UnlockTrophy event and its _trophy_id, CreateEvent's property ownership, and the platinum rule;
  • the percentage weights (gold 6, silver 2, bronze 1, platinum left out) match the PSN point values third parties document (15, 30 and 90).

KytyPS5's error codes aren't adopted, since no other public source confirms them. The return codes are unchanged.

Commits on #7262's head (each builds and passes the tests that exist at it):

  1. feat(libSceNpTrophy2): record trophy unlocks per title and user: the unlock store, the reported unlocks, the listener hook with its dispatch lock, the queries' connection to the store and the platinum, and np_trophy2_store.
  2. feat(libSceNpUniversalDataSystem): keep event properties and record posted trophy unlocks: events and properties with real contents, the _UnlockTrophy path, and np_uds_events, guest_np_trophy_unlocks and guest_np_trophy_data's posted unlocks.
  3. docs: describe trophy unlocks in USAGE.
  4. feat(libSceNpUniversalDataSystem): unlock trophies through the title's statistics: the statistics rules, their store and the unlock check, with guest_np_trophy_stats.
  5. docs: describe trophy statistics in USAGE.
  6. test(libSceNpUniversalDataSystem): check that a stat with a sum aggregation unlocks nothing: it pins the behaviour, so it passes before the next commit.
  7. fix(libSceNpTrophy2): refuse a posted unlock of an unknown, platinum or progressive trophy: refused when the title's trophy data is loaded; the statistics path and the platinum award keep recording.
  8. docs: say which posted trophy unlocks are refused and what stops a title.
  9. docs: say that a malformed trophy or stat record line fails the query: the damaged-records debt entry above.

Overlap (checked against main f1af6c5915 and the 38 open PRs that touch the same files; the ones that merge into main merge with this PR too):

  • #6361 (fogydes, export stubs for the remaining libraries) adds its own src/Export.cpp to libSceNpUniversalDataSystem's CMakeLists.txt, and lines to its debt file. None of its stubs is a function this PR defines, so whichever lands second keeps both lists.
  • Seventeen more PRs that conflict with main themselves weren't merged against this one. They share only SceTypes.hpp (#7081, #6977, #6138), USAGE.md (#6946, #6788, #6171, #6111, #5925, #4891, #3998) or libSceNpTrophy2's test registration in its CMakeLists.txt (#6044); #7201, #6947, #6447, #6248, #6222 and #5021 share none of this PR's files.

Tested

Every test builds its own synthetic .ucp files in a fresh directory; none uses a title's data. This PR's head is #7262's series split from the one reviewed there: with main 5361e69de3 merged into that series, the trees are the same apart from commit 9's debt entry, so the red runs below, measured on it before the split, are the same code.

  • np_trophy2_package (unit), on top of #7262's checks: progress, the platinum after the last trophy that names it and only once, counts and the percentage; the statistics rules kept and skipped, 7 bad input paths, each comparator below, at and above its target, and the statistics store across a restart with 8 damaged files.
  • guest_np_trophy_data, through the built libraries' exports only, on top of #7262's checks: direct unlocks giving counts, the percentage and the platinum with the last trophy that names it, in listener order.
  • guest_np_trophy_stats, through the exports only:
    • a statistics file from a previous run shows as progress before any event;
    • each comparator through posted events: ge 9 locked, 10 unlocks; gt 100 locked, 101 unlocks; le 6 locked, 5 unlocks; lt with −1 and a float ignored, 2 unlocks;
    • a nested player.steps progressive trophy at 4, then unlocked at 5, with the platinum after it;
    • the exact statistics file 10 3\n20 101\n30 2\n40 5\n and the unlock file;
    • no files, a malformed trophy file and a truncated uds03.ucp, each turning off only its own feature.
  • np_uds_events, np_trophy2_store and guest_np_trophy_unlocks cover the posted-unlock path: every property setter, ownership, unlock recognition and near-miss names, persistence, damaged records (a carriage return included), and _UnlockTrophy {"_trophy_id":12} through the exports. guest_nptrophy2 still passes unchanged.
  • Listener removal (np_trophy2_store's testListenerRemovalWaitsForItsCallback): removing a listener while its callback runs waits for the callback. Without the dispatch lock it fails 3 of 3 runs (a listener was removed while its callback was still running, so its context could be freed under it); with it, it passes 3 of 3.
  • The reader under sanitizers (ASan and UBSan): each input below is accepted or refused with a std::runtime_error. None reads out of bounds, leaks, or throws anything else: 48 malformed files and 2 valid packages, every truncation of both packages (1,190), 200,000 random byte mutations and 200,000 random JSON texts.
  • Posted unlock rules (np_trophy2_store's testPostedUnlockRules and guest_np_trophy_data, through the exports): with trophy data loaded, an unknown id, the platinum and a progressive trophy posted through UDS stay locked, record nothing, call no listener and log their line, and the counts don't move; the progressive trophy still unlocks through its statistic and the platinum with the last trophy that names it; without trophy data, any id is still recorded. Without the fix commit both fail: an unknown, platinum or progressive trophy posted through UDS was recorded and a progressive, platinum or unknown trophy posted through UDS unlocked, or changed the counts.
  • Other aggregations (guest_np_trophy_stats): a sum statistic logs stat 10 has aggregation "sum"; only "latest" is supported, stores nothing and unlocks nothing.
  • Mutations: gt read as ge, no platinum, statistics not saved, truncation not checked, and progress ignoring the statistic each turn np_trophy2_package red, and four of them guest_np_trophy_stats too.
  • Linux (Ubuntu 24.04, GCC 13.3, CI's configure flags, as an unprivileged user), on main 5361e69de3 with #7262: 1,411 tests, 1,338 passed, 68 skipped, 5 failed. main on the same machine gives 1,405, 1,332, 68 and 5.
    • Per test, the only difference is the 6 tests the two PRs add, all passing.
    • The 5 failures are the IPv6 tests (guest_datagram_* and guest_tcp), which fail on that machine on main too, and guest_sce_net skips there for the same reason.
    • Each of the 9 commits builds and passes the trophy, UDS and system-service tests that exist at it (6, then 8 and 9), and check_test_registration.py and check_conventions.py pass.
  • Windows, the Build workflow's Windows job on my fork, at 8e927be27f: 1,438 tests, 0 failed (run). The macOS and Ubuntu jobs pass too.
  • Planet of Lana (PPSA19450), Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42), with APS5_TRACE_UDS=1, played by hand into Chapter 1. It ran on our test tree for the title (not main; it carries the open fixes the title needs) with the whole trophy series before the split, at e06a4f2c7c, before the reviews' last fixes were folded in. Those fixes are off this path: the title registers no unlock listener (the dispatch lock), its trophy JSON is far below the value cap, and it has no statistics rule this PR reads (the statistics fix and the language message). The title unlocked "Sneaky Sisters" as shown under What. The log has no fatal error and no [trophy] or [uds] error or refused post.

Not covered, and why:

  • Statistics rules other than latest: other aggregations (sum, count, max, collection, eachLatest), data types other than uint32 and uint64, and rule conditions beyond the event name. No public source gives their meaning, and KytyPS5 skips them too. Each such rule logs one line naming it, and a trophy that depends on one doesn't unlock. Planet of Lana (PPSA19450) has only such statistics, so this PR reads none of them ([trophy] /app0/sce_sys/uds/uds00.ucp: 0 stats, 0 rules for 0 events). That doesn't stop its trophies: each of its 24 stat-linked trophies is non-progressive and unlocks when the title posts _UnlockTrophy with its _trophy_id, which this PR records directly. Its count statistics count those same posts, and its collection and eachLatest statistics feed activities.
  • _UpdateTrophyProgress: logged once per trophy and not interpreted, because its properties aren't public.
  • An unlock pop-up and sceNpTrophy2RegisterUnlockCallback: the callback's signature isn't public.

Checklist

  • Based on main 5361e69de3 and #7262's head 61e12c75fd (merged into main as 199e2ceb2f); no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none (#7262 is merged)
  • Unblocks: PPSA19450 (Planet of Lana: its trophies unlock when it posts them)
  • GPUs tested: not GPU-related
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4905254285 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7335). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T00:49:36Z. --- ### What Trophies now unlock the way a title defines them. This is the second half of the split asked for on #7262 (merged), which reports the title's trophy data with every trophy locked: this PR records unlocks and statistics and connects those queries to them. It is built on #7262's head 61e12c75fd, so with #7262 merged its diff shows only its own commits. The title's own `sce_sys/uds/udsNN.ucp` is read once per service label, on first use, like the trophy data. - **Unlocks a title posts** are recorded. `_UnlockTrophy` with an int32 `_trophy_id` unlocks that trophy for the title, user and service label. The unlock goes in a host file next to save data (`/_trophy/<user id>_<service label>.txt`) and survives restarts. - **Unlocks through statistics.** Every other event a title posts goes through the title's statistics rules (`stats_extraction.json` in `udsNN.ucp`). A rule sets a statistic from one of the event's properties. After each event that sets one, every trophy's `unlockCondition` is checked (`ge`, `gt`, `le` or `lt` against its target) on the values that event set and the stored values of the others, and reached trophies unlock the same way. Statistics keep their latest value in `/_trophy/<user id>_<service label>.stats.txt`, so progress also survives restarts. - **Platinum** unlocks once every trophy that names it in `platinumTrophyId` is unlocked, whichever way they were unlocked. - **Posted unlocks follow the title's rules.** With the title's trophy data loaded, `_UnlockTrophy` of an id that isn't in it, of the platinum, or of a progressive trophy is refused with one line (`[trophy] ignored the posted unlock of trophy 0 for user 268435456: it is the platinum, which unlocks with the last trophy that names it`), as KytyPS5 does; those unlock through their statistics and the platinum rule instead. Without trophy data, every posted id of 0 or more is recorded, and no platinum unlocks by itself, since the rule needs the data. - **The queries report unlocks.** A trophy reports whether it is unlocked and when, a progressive trophy its progress, and the game and its groups their unlocked counts and `progress_percentage`. - A new unlock logs `[trophy] <title id> unlocked trophy <id> for user <user>`. With `APS5_TRACE_UDS=1`, every post and every statistic it sets is printed too. **Planet of Lana (PPSA19450)** earns its trophies this way. Its statistics rules are all of kinds this PR skips (see Not covered): ``` [trophy] /app0/sce_sys/uds/uds00.ucp: 0 stats, 0 rules for 0 events ``` Sneaking past the chef at the start of Chapter 1 posts the unlock of trophy 12, "Sneaky Sisters" ("Sneak past the chef" in the title's own data): ``` [uds] context 1 posted _UnlockTrophy {"_trophy_id":12} [trophy] PPSA19450 unlocked trophy 12 for user 268435456 ``` The unlock is stored as `12 63927864523936811` in `_trophy/268435456_0.txt`, next to the title's `app0/`. Titles that ship no `udsNN.ucp`, or post no trophy events, behave as with #7262: - Every return code is the same. - A missing file is silent (a `[uds]` line with `APS5_TRACE_UDS`). - A malformed file logs one `[trophy] <file> is malformed, so ...: <reason>` line and turns off only its own feature: without statistics rules, events set no statistic. `_UnlockTrophy` keeps working either way. - **One behaviour change:** posting a null event pointer, one that `CreateEvent` didn't return, or one already destroyed now throws, as the library's other invalid arguments do. Before, it was ignored. How: - **Events and properties.** libSceNpUniversalDataSystem's events and property objects get real contents: int32, uint32, int64, uint64, float, double, bool, string, bytes, nested objects and arrays, with keys kept in insertion order. A registry owns what the Create functions return; `Destroy*` on anything else, such as an event's own property object, does nothing, because its owner frees it. - **From event to unlock.** A rule picks its `$.path` property (nested objects give `a.b` paths). The value is used if it's a non-negative integer that fits the statistic's type and lies within its `minValue`/`maxValue`. Otherwise it's ignored with one `[trophy] ignored <event> $.<path> for stat <id>: <reason>` line. A statistic that was never set reaches nothing, so `le` and `lt` trophies don't unlock at a start value of 0. Well-formed entries this doesn't support (for example a `sum` aggregation) are skipped, each with one log line. - **The store.** One file per user and service label for unlocks and one for statistics, each rewritten through a temporary file and a rename, via `RecordWrittenPath_nid_no_patch` like other host writes. A statistic is written only when its value changes (`StatStore::Set` returns early otherwise, TrophyStore.cpp:173), so a statistic that changes with every event writes its file each time. A damaged file throws with its name and line (a debt entry, below). - **Hook.** An unlock listener hook (`NpTrophy2AddUnlockListener_nid_no_patch`) is there for a later pop-up. Removing a listener waits for an unlock callback that is running, so a removed listener is never called. `sceNpTrophy2RegisterUnlockCallback` is still not called, because its callback signature isn't public. Choices the public data leaves open, each listed as debt: - A property of any integer width counts toward a statistic if it fits, so a title that sets a counter with `SetInt32` still counts. The one public implementation requires the exact width. - A progressive trophy reports `min(statistic, target)`, and its target once unlocked. - `progress_percentage` weighs gold 6, silver 2 and bronze 1 and leaves the platinum out, as KytyPS5 does; the console's formula is not known. - The platinum rule: whether the console needs exactly the trophies that name it, or every other trophy of the base group. The two agree when every base trophy names it. - **Damaged records** (the last commit): a line in `_trophy/<user id>_<service label>.txt` or `.stats.txt` that isn't a new `<id> <value>` pair (a blank line or one ending in a carriage return included) throws in every trophy query, posted unlock and statistic update that reads that record for its user and service label. The export doesn't return, which stops the title, and the record is read again each time, so it keeps failing until the file is fixed or deleted. On `main` these calls returned 0. **Sources.** Interface facts only, no code, from KytyPS5 (GPL-2.0) at 9e41d8320a: - `src/common/trophies.cpp`: the `stats_definition.json` and `stats_extraction.json` keys, and the four comparators; - `src/libs/libTrophy.cpp`: the `_UnlockTrophy` event and its `_trophy_id`, `CreateEvent`'s property ownership, and the platinum rule; - the percentage weights (gold 6, silver 2, bronze 1, platinum left out) match the PSN point values third parties document (15, 30 and 90). KytyPS5's error codes aren't adopted, since no other public source confirms them. The return codes are unchanged. Commits on #7262's head (each builds and passes the tests that exist at it): 1. `feat(libSceNpTrophy2): record trophy unlocks per title and user`: the unlock store, the reported unlocks, the listener hook with its dispatch lock, the queries' connection to the store and the platinum, and `np_trophy2_store`. 2. `feat(libSceNpUniversalDataSystem): keep event properties and record posted trophy unlocks`: events and properties with real contents, the `_UnlockTrophy` path, and `np_uds_events`, `guest_np_trophy_unlocks` and `guest_np_trophy_data`'s posted unlocks. 3. `docs: describe trophy unlocks in USAGE`. 4. `feat(libSceNpUniversalDataSystem): unlock trophies through the title's statistics`: the statistics rules, their store and the unlock check, with `guest_np_trophy_stats`. 5. `docs: describe trophy statistics in USAGE`. 6. `test(libSceNpUniversalDataSystem): check that a stat with a sum aggregation unlocks nothing`: it pins the behaviour, so it passes before the next commit. 7. `fix(libSceNpTrophy2): refuse a posted unlock of an unknown, platinum or progressive trophy`: refused when the title's trophy data is loaded; the statistics path and the platinum award keep recording. 8. `docs: say which posted trophy unlocks are refused and what stops a title`. 9. `docs: say that a malformed trophy or stat record line fails the query`: the damaged-records debt entry above. **Overlap** (checked against `main` f1af6c5915 and the 38 open PRs that touch the same files; the ones that merge into `main` merge with this PR too): - #6361 (fogydes, export stubs for the remaining libraries) adds its own `src/Export.cpp` to libSceNpUniversalDataSystem's `CMakeLists.txt`, and lines to its debt file. None of its stubs is a function this PR defines, so whichever lands second keeps both lists. - Seventeen more PRs that conflict with `main` themselves weren't merged against this one. They share only `SceTypes.hpp` (#7081, #6977, #6138), `USAGE.md` (#6946, #6788, #6171, #6111, #5925, #4891, #3998) or libSceNpTrophy2's test registration in its `CMakeLists.txt` (#6044); #7201, #6947, #6447, #6248, #6222 and #5021 share none of this PR's files. ### Tested Every test builds its own synthetic `.ucp` files in a fresh directory; none uses a title's data. This PR's head is #7262's series split from the one reviewed there: with `main` 5361e69de3 merged into that series, the trees are the same apart from commit 9's debt entry, so the red runs below, measured on it before the split, are the same code. - **`np_trophy2_package`** (unit), on top of #7262's checks: progress, the platinum after the last trophy that names it and only once, counts and the percentage; the statistics rules kept and skipped, 7 bad input paths, each comparator below, at and above its target, and the statistics store across a restart with 8 damaged files. - **`guest_np_trophy_data`**, through the built libraries' exports only, on top of #7262's checks: direct unlocks giving counts, the percentage and the platinum with the last trophy that names it, in listener order. - **`guest_np_trophy_stats`**, through the exports only: - a statistics file from a previous run shows as progress before any event; - each comparator through posted events: `ge` 9 locked, 10 unlocks; `gt` 100 locked, 101 unlocks; `le` 6 locked, 5 unlocks; `lt` with −1 and a float ignored, 2 unlocks; - a nested `player.steps` progressive trophy at 4, then unlocked at 5, with the platinum after it; - the exact statistics file `10 3\n20 101\n30 2\n40 5\n` and the unlock file; - no files, a malformed trophy file and a truncated `uds03.ucp`, each turning off only its own feature. - **`np_uds_events`**, **`np_trophy2_store`** and **`guest_np_trophy_unlocks`** cover the posted-unlock path: every property setter, ownership, unlock recognition and near-miss names, persistence, damaged records (a carriage return included), and `_UnlockTrophy {"_trophy_id":12}` through the exports. `guest_nptrophy2` still passes unchanged. - **Listener removal** (`np_trophy2_store`'s `testListenerRemovalWaitsForItsCallback`): removing a listener while its callback runs waits for the callback. Without the dispatch lock it fails 3 of 3 runs (`a listener was removed while its callback was still running, so its context could be freed under it`); with it, it passes 3 of 3. - **The reader under sanitizers** (ASan and UBSan): each input below is accepted or refused with a `std::runtime_error`. None reads out of bounds, leaks, or throws anything else: 48 malformed files and 2 valid packages, every truncation of both packages (1,190), 200,000 random byte mutations and 200,000 random JSON texts. - **Posted unlock rules** (`np_trophy2_store`'s `testPostedUnlockRules` and `guest_np_trophy_data`, through the exports): with trophy data loaded, an unknown id, the platinum and a progressive trophy posted through UDS stay locked, record nothing, call no listener and log their line, and the counts don't move; the progressive trophy still unlocks through its statistic and the platinum with the last trophy that names it; without trophy data, any id is still recorded. Without the fix commit both fail: `an unknown, platinum or progressive trophy posted through UDS was recorded` and `a progressive, platinum or unknown trophy posted through UDS unlocked, or changed the counts`. - **Other aggregations** (`guest_np_trophy_stats`): a `sum` statistic logs `stat 10 has aggregation "sum"; only "latest" is supported`, stores nothing and unlocks nothing. - **Mutations:** `gt` read as `ge`, no platinum, statistics not saved, truncation not checked, and progress ignoring the statistic each turn `np_trophy2_package` red, and four of them `guest_np_trophy_stats` too. - **Linux** (Ubuntu 24.04, GCC 13.3, CI's configure flags, as an unprivileged user), on `main` 5361e69de3 with #7262: 1,411 tests, 1,338 passed, 68 skipped, 5 failed. `main` on the same machine gives 1,405, 1,332, 68 and 5. - Per test, the only difference is the 6 tests the two PRs add, all passing. - The 5 failures are the IPv6 tests (`guest_datagram_*` and `guest_tcp`), which fail on that machine on `main` too, and `guest_sce_net` skips there for the same reason. - Each of the 9 commits builds and passes the trophy, UDS and system-service tests that exist at it (6, then 8 and 9), and `check_test_registration.py` and `check_conventions.py` pass. - **Windows**, the Build workflow's Windows job on my fork, at 8e927be27f: 1,438 tests, 0 failed ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39082401922/job/117541920853)). The macOS and Ubuntu jobs pass too. - **Planet of Lana (PPSA19450)**, Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42), with `APS5_TRACE_UDS=1`, played by hand into Chapter 1. It ran on our test tree for the title (not `main`; it carries the open fixes the title needs) with the whole trophy series before the split, at e06a4f2c7c, before the reviews' last fixes were folded in. Those fixes are off this path: the title registers no unlock listener (the dispatch lock), its trophy JSON is far below the value cap, and it has no statistics rule this PR reads (the statistics fix and the language message). The title unlocked "Sneaky Sisters" as shown under What. The log has no fatal error and no `[trophy]` or `[uds]` error or refused post. **Not covered, and why:** - **Statistics rules other than `latest`:** other aggregations (`sum`, `count`, `max`, `collection`, `eachLatest`), data types other than `uint32` and `uint64`, and rule conditions beyond the event name. No public source gives their meaning, and KytyPS5 skips them too. Each such rule logs one line naming it, and a trophy that depends on one doesn't unlock. Planet of Lana (PPSA19450) has only such statistics, so this PR reads none of them (`[trophy] /app0/sce_sys/uds/uds00.ucp: 0 stats, 0 rules for 0 events`). That doesn't stop its trophies: each of its 24 stat-linked trophies is non-progressive and unlocks when the title posts `_UnlockTrophy` with its `_trophy_id`, which this PR records directly. Its `count` statistics count those same posts, and its `collection` and `eachLatest` statistics feed activities. - **`_UpdateTrophyProgress`:** logged once per trophy and not interpreted, because its properties aren't public. - **An unlock pop-up and `sceNpTrophy2RegisterUnlockCallback`:** the callback's signature isn't public. ### Checklist - [x] Based on `main` 5361e69de3 and #7262's head 61e12c75fd (merged into `main` as 199e2ceb2f); no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none (#7262 is merged) - [x] Unblocks: PPSA19450 (Planet of Lana: its trophies unlock when it posts them) - [x] GPUs tested: not GPU-related - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-18 01:10:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T01:10:34Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6361 docs/dev/debt/libSceNpUniversalDataSystem.md

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3998 docs/user/USAGE.md
PR 4891 docs/user/USAGE.md
PR 5021 docs/user/USAGE.md
PR 5925 docs/user/USAGE.md
PR 6044 core/libs/prx/libSceNpTrophy2/CMakeLists.txt
PR 6111 docs/user/USAGE.md
PR 6138 core/libs/SceTypes.hpp
PR 6171 docs/user/USAGE.md
PR 6361 core/libs/prx/libSceNpUniversalDataSystem/CMakeLists.txt
docs/dev/debt/libSceNpUniversalDataSystem.md
PR 6788 docs/user/USAGE.md
PR 6924 docs/user/USAGE.md
PR 6946 docs/user/USAGE.md
PR 6947 docs/user/USAGE.md
PR 6977 core/libs/SceTypes.hpp
PR 7332 docs/user/USAGE.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244077327 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7335#issuecomment-6244077327). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T01:10:34Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6361](https://www.github.com/boykopovar/AnyPS5/pull/6361) | | | `docs/dev/debt/libSceNpUniversalDataSystem.md` | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 3998](https://www.github.com/boykopovar/AnyPS5/pull/3998) | `docs/user/USAGE.md` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `docs/user/USAGE.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/user/USAGE.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/user/USAGE.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceNpTrophy2/CMakeLists.txt` | | [PR 6111](https://www.github.com/boykopovar/AnyPS5/pull/6111) | `docs/user/USAGE.md` | | [PR 6138](https://www.github.com/boykopovar/AnyPS5/pull/6138) | `core/libs/SceTypes.hpp` | | [PR 6171](https://www.github.com/boykopovar/AnyPS5/pull/6171) | `docs/user/USAGE.md` | | [PR 6361](https://www.github.com/boykopovar/AnyPS5/pull/6361) | `core/libs/prx/libSceNpUniversalDataSystem/CMakeLists.txt`<br>`docs/dev/debt/libSceNpUniversalDataSystem.md` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `docs/user/USAGE.md` | | [PR 6924](https://www.github.com/boykopovar/AnyPS5/pull/6924) | `docs/user/USAGE.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/user/USAGE.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/user/USAGE.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/SceTypes.hpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `docs/user/USAGE.md` |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7335
No description provided.