Astra Pr2e Aggcache

Both prior findings are resolved within the stated scope:

  • Closed: Per-world entries prevent alternating PIE worlds from evicting each other’s cached aggregator.
  • Acceptably scoped: Lines 20–21 explicitly delegate detection of later duplicates to GMC. This does not promise continuous uniqueness validation.

One new low finding remains:

  • Low — Source/NarrativeGMC/Private/Framework/NarrativeGMCWorld.h:22: default weak-key equality is unsuitable after GC. When two cached worlds become stale, UE 5.7’s FWeakObjectPtr::operator== considers them equal, while their index/serial-based hashes can differ. This violates the map’s equality/hash contract. Pruning occurs after lookup and is skipped on cache hits. Current live-world lookups and iterator removal do not demonstrate a wrong-aggregator return, so impact is limited. Fix: Specify UE’s TWeakObjectPtrMapKeyFuncs, which compares original object identity even after collection:
    using FWorldKey = TWeakObjectPtr<UWorld>;
    using FAggregatorValue = TWeakObjectPtr<AGMC_Aggregator>;
    static TMap<FWorldKey, FAggregatorValue, FDefaultSetAllocator,
        TWeakObjectPtrMapKeyFuncs<FWorldKey, FAggregatorValue>> KnownAggregators;
    

Other checks:

  • Iterator removal: RemoveCurrent() followed by the loop’s increment is correct.
  • Static lifetime: Weak entries retain neither worlds nor aggregators. Deferred pruning leaves bookkeeping until a cache miss or static destruction; no demonstrated teardown defect.
  • Threading: Safe under the stated game-thread BeginPlay usage. Static initialization does not synchronize subsequent map access; worker-thread calls remain unsupported. An optional check(IsInGameThread()) would express that contract.

Read-only inspection included installed UE 5.7 implementations. No builds or runtime tests performed; reported successful compilation is acknowledged.

PASS WITH FIXES