You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI Knowledge Base - Prosper Diagnostics Verified Findings
Project Purpose
Why Diagnostics Plugins Were Created
The Prosper Diagnostics Plugin Collection was developed to address a critical gap in PS4 emulator development: the lack of structured, AI-consumable debugging information. When debugging emulator issues, developers (and AI assistants) need answers to questions like:
"Which boot phase failed?"
"What imports are unresolved?"
"Where did the crash occur and what were the register values?"
These plugins capture that information systematically.
Primary Goal: Improve AI Coder Debugging Ability
AI-Optimized Output: All reports generated in JSON format with LLM-friendly structure
Automated Analysis: AI Report Generator plugin produces Markdown summaries specifically for LLM consumption
Evidence-Based Debugging: Every claim in reports is traceable to source events
Observer-Only Design Philosophy
CORE PRINCIPLE: ZERO IMPACT ON EMULATION
├── No behavior modification
├── No state changes
├── No performance impact when disabled (~1ns overhead)
└── Pure observation and recording only
Code Evidence: plugin_interface.hpp:8-11 — Enforced by design comments and compile-time no-op macros.
Verified Architecture
EventBus Design (CONFIRMED ✅)
Implementation: Singleton PluginRegistry with publish/subscribe pattern
Coverage: Edge cases, invalid inputs, boundary conditions Test Categories:
Empty/null payload values
Missing required keys
Duplicate events
Out-of-order events
Extreme values (max uint64, empty strings)
Events not in subscribed list (should ignore)
AI Debugging Simulation Result ✅
Scenario: AI agent receives crash report + import data, must diagnose issue Result: AI correctly identified unresolved import as root cause Confidence Score: High (structured data enables reliable AI reasoning)
Knowledge Evidence Verification Result ✅ (Phase 8.8)
⚠️ Severity: Medium (long sessions may consume significant memory)
AI Coder Rules (Permanent Guidelines)
Rule 1: Evidence Before Assumptions
BEFORE claiming anything, verify against source code:
✅ "plugin_interface.hpp:284 shows ((void)0) macro"
❌ "I assume the overhead is negligible"
Source: Phase 8.8 verification found 14% of claims were unverified assumptions.
Rule 2: Never Claim Runtime Behavior Without Measurement
❌ "This handler runs in <100ns"
✅ "Benchmark shows avg 87ns ±12ns over 10K iterations (see benchmarks.md)"
Exception: Design goals can state targets if marked as [TARGET].
Rule 3: Keep Diagnostics Separate From Runtime Logic
PROHIBITED in on_event():
❌ Modifying game state
❌ Changing execution flow
❌ Throwing exceptions
❌ Blocking for I/O
REQUIRED:
✅ Only record observations
✅ Use default values for missing data
✅ Catch all exceptions internally
Evidence: plugin_interface.hpp:9-11 — Observer-only rule enforced by design.
Current Status: 84+ tests passing across 4 suites.
Rule 6: Document Uncertainty Explicitly
Use these tags for unverified claims:
[ASSUMPTION] → Based on external knowledge, not code
[NEEDS_SOURCE] → Requires Prosper upstream source
[UNCONFIRMED] → Not yet verified
[ARTIFACT_BASED] → Inferred from PS4 game files
[TARGET] → Design goal, not measured
Rationale: Phase 8.8 found 10 items (11%) are pure assumptions.
Known Limitations
CONFIRMED (Verified by Code or Tests)
These items have direct source code evidence:
Item
Evidence
Location
Zero-overhead disabled mode works
((void)0) macro
plugin_interface.hpp:284
Observer-only design enforced
Comments + architecture
plugin_interface.hpp:8-11
45+ EventType values defined
Enum counted
plugin_interface.hpp:37-105
String conversion complete
Switch statement
plugin_interface.hpp:108-158
Type-safe payload extraction
get<T>() with default
plugin_interface.hpp:171-181
Singleton Registry pattern
static instance()
plugin_interface.hpp:224-226
Thread-safe helpers available
mutable std::mutex
plugin_base.hpp:135,204
TimelineRecorder functional
Start/end/duration methods
plugin_base.hpp:151-206
EventCounter thread-safe
Mutex-protected counts
plugin_base.hpp:107-137
Integer division bug fixed
static_cast<double>
import_resolution_plugin.hpp:163
Multiple crash recording
vector<CrashRecord>
crash_context_plugin.hpp:138
Signal name resolution
get_signal_name() switch
crash_context_plugin.hpp:244-258
Register extraction (24 regs)
Loop over reg_names[]
crash_context_plugin.hpp:212-217
AI Report Gen universal sub
Empty vector = all
ai_report_generator_plugin.hpp:75-77
4 output files generated
save_report override
ai_report_generator_plugin.hpp:99-137
84+ tests passing
Test executables
build_direct/ directory
MIT License applied
Header comments
All .hpp files
C++17 features used
std::any, structured bindings
Throughout codebase
NEEDS_SOURCE (Requires Actual Prosper Source Code)
These items CANNOT be verified without access to Prosper repository:
Item
Impact if Wrong
Source Needed
Integration points location
Events fire at wrong time
Prosper main loop, loader, HLE dispatcher
Exact HLE function count (~298)
Pre-allocation sizing off
Prosper HLE table definition
Thread state machine (8 states)
Wrong states recorded
Prosper thread scheduler
GPU backend type (Vulkan?)
GPU events may not apply
Prosper renderer initialization
<100ns overhead achievable
Performance claims wrong
Profiling in actual Prosper build
Action Required: Mark with [REQUIRES_PROSPER_SOURCE] tags. Create INTEGRATION_GUIDE.md with assumed points once available.
ASSUMPTION (Not Yet Proven)
These items are based on external knowledge or conventions:
Item
Source
Risk Level
PS4 uses /app0/ paths for games
PS4 documentation
Low (standard convention)
eboot.bin is main executable
PS4 boot process
Low (artifact-confirmed: 32MB file exists)
Vulkan is common GPU backend
General emulator knowledge
Medium (could be OpenGL/proprietary)
Emulator is multi-threaded
System design assumption
Low (virtually certain)
74MB Il2cppUserAssemblies.prx explains memory hot path
Artifact size observation
Low (reasonable inference)
Thread states match PS4 kernel spec
OS documentation
Medium (Prosper may differ)
File system uses VFS layer
Common emulator pattern
Low (standard approach)
Action Required: Mark with [ASSUMPTION] tags. Verify during integration.
Summary Statistics
Metric
Value
Confidence
Total Plugins
10
✅ Confirmed
Total Event Types
45+
✅ Code-counted
Total Test Cases
84+
✅ Passing
Lines of Plugin Code
~3,400
✅ Approximate
High-Value Plugins (9.0+)
4
✅ Ranked
Ready for Integration
8/10
✅ Assessed
Deferred (P5)
1 (Performance Marker)
✅ Documented
Known Bugs to Fix
2
✅ Identified
Verification Confidence
86%
✅ Phase 8.8 result
Document Generated: 2026-08-12 Source: Phase 8.8 Knowledge Evidence Verification Repository: prosper-diagnostics-plugins Status: ✅ READY FOR GITHUB TRANSFER
AI Knowledge Base - Prosper Diagnostics Verified Findings
Project Purpose
Why Diagnostics Plugins Were Created
The Prosper Diagnostics Plugin Collection was developed to address a critical gap in PS4 emulator development: the lack of structured, AI-consumable debugging information. When debugging emulator issues, developers (and AI assistants) need answers to questions like:
These plugins capture that information systematically.
Primary Goal: Improve AI Coder Debugging Ability
Observer-Only Design Philosophy
Code Evidence:
plugin_interface.hpp:8-11— Enforced by design comments and compile-time no-op macros.Verified Architecture
EventBus Design (CONFIRMED ✅)
Implementation: Singleton
PluginRegistrywith publish/subscribe patternKey Facts (Code-Verified):
plugin_interface.hppplugin_interface.hppplugin_interface.hppplugin_interface.hpp+plugin_registry.cppPlugin Lifecycle (CONFIRMED ✅)
Critical Rule:
initialize()returnsbool— ALWAYS check return value!Plugin Registration (CONFIRMED ✅)
Evidence:
ai_report_generator_plugin.hpp:75-77— Empty vector means universal subscriptionJSON Reporting (CONFIRMED ✅)
Standard Report Structure (All plugins follow this):
{ "plugin_name": "string", "plugin_version": "string", "description": "string", "is_enabled": boolean, "generated_at": "timestamp_ns", "plugin_type": "string", "data": { ... }, "summary": { ... } }Base Helper:
create_base_report()provides common fields automatically (plugin_base.hpp:86-94)Test Validation Results (CONFIRMED ✅)
plugin_tests.cppintegrated_event_chain_test.cppnegative_data_tests.cppai_debugging_simulation.cppValidation Evidence
Unit Tests Result ✅
Coverage: Plugin identity, enable/disable behavior, core functionality, JSON generation
Key Tests:
ReportsCorrectName/Version/DescriptionRespectsDisabledState(events ignored when disabled)TracksExpectedData(domain-specific)ProducesValidJson(never null, always valid)Integration Tests Result ✅
Coverage: Multi-plugin event chains, registry operations, report collection
Scenarios Tested:
Negative Tests Result ✅
Coverage: Edge cases, invalid inputs, boundary conditions
Test Categories:
AI Debugging Simulation Result ✅
Scenario: AI agent receives crash report + import data, must diagnose issue
Result: AI correctly identified unresolved import as root cause
Confidence Score: High (structured data enables reliable AI reasoning)
Knowledge Evidence Verification Result ✅ (Phase 8.8)
Verification Date: 2026-08-12
Method: Systematic evidence-based code review against source files
Plugin Knowledge Map
1. Boot Timeline Plugin
boot_timeline_plugin.hpp(~282 lines)Subscribed Events: PROCESS_START → LOADER_START → ELF_LOADING → ELF_LOADED → PRX_LOADING → PRX_LOADED → RELOCATION_START → RELOCATION_COMPLETE → MEMORY_MAPPING → HLE_REGISTRATION_START → HLE_REGISTRATION_COMPLETE → GUEST_INITIALIZATION → BOOT_COMPLETE
AI Questions Answered:
Known Limitations (Documented):
2. Module Load Plugin
module_load_plugin.hpp(~242 lines)Subscribed Events: MODULE_LOAD, MODULE_UNLOAD, ELF_LOADED, PRX_LOADED
AI Questions Answered:
Real Artifact Validation:
Known Limitations:
base_addressfield is placeholder (0x0) until integrated with Prosper3. Import Resolution Plugin ⭐
import_resolution_plugin.hpp(~194 lines)Subscribed Events: IMPORT_RESOLUTION
AI Questions Answered:
Unique Value:
Bug Fixed (Phase 7):
4. Memory Map Plugin
memory_map_plugin.hpp(~259 lines)Subscribed Events: MEMORY_MAP, MEMORY_UNMAP, MEMORY_PROTECT_CHANGE, ALLOCATION, DEALLOCATION
AI Questions Answered:
Performance Concerns (Documented):
5. Crash Context Plugin ⭐
crash_context_plugin.hpp(~290 lines)Subscribed Events: CRASH_DETECTED, EXCEPTION_THROWN, SIGNAL_RECEIVED
AI Questions Answered:
Strengths (Code-Verified):
Known Limitations:
6. Thread Activity Plugin
thread_activity_plugin.hpp(~316 lines)Subscribed Events: THREAD_CREATE, THREAD_DESTROY, THREAD_STATE_CHANGE
AI Questions Answered:
Overlap Analysis:
info threadsAssumption (Unverified):
7. File Access Plugin
file_access_plugin.hpp(~299 lines)Subscribed Events: FILE_OPEN, FILE_CLOSE, FILE_READ, FILE_WRITE
AI Questions Answered:
Real Artifact Support:
Overlap Analysis:
8. HLE Call Statistics Plugin
hle_call_stats_plugin.hpp(~280 lines)Subscribed Events: SYSCALL_ENTRY, SYSCALL_EXIT
AI Questions Answered:
Unique Value:
Integration Challenge:
9. Performance Marker Plugin
performance_marker_plugin.hpp(~328 lines)Subscribed Events: PHASE_START, PHASE_END, MARKER_RECORD, FRAME_PRESENT
AI Questions Answered:
Known Issues (Must Fix Before Commit):
line 232):static uint64_t frame_count = 0persists across sessionsRecommendation: Defer to post-integration. Fix static counter bug first. Consider if Tracy/RenderDoc suffices for most use cases.
10. AI Report Generator Plugin ⭐
ai_report_generator_plugin.hpp(~379 lines)Subscribed Events: ALL (empty vector = universal subscription)
Output Files Generated:
AI Questions Answered:
Unique Position:
Known Issue (Should Fix Before Commit):
timeline_vector grows forever (line 140)max_buffer_sizeconfig optionAI Coder Rules (Permanent Guidelines)
Rule 1: Evidence Before Assumptions
Source: Phase 8.8 verification found 14% of claims were unverified assumptions.
Rule 2: Never Claim Runtime Behavior Without Measurement
Exception: Design goals can state targets if marked as [TARGET].
Rule 3: Keep Diagnostics Separate From Runtime Logic
Evidence:
plugin_interface.hpp:9-11— Observer-only rule enforced by design.Rule 4: Small Independent Commits
Each commit must compile independently and pass tests.
Rule 5: Test Every Plugin Independently
Current Status: 84+ tests passing across 4 suites.
Rule 6: Document Uncertainty Explicitly
Rationale: Phase 8.8 found 10 items (11%) are pure assumptions.
Known Limitations
CONFIRMED (Verified by Code or Tests)
These items have direct source code evidence:
((void)0)macroplugin_interface.hpp:284plugin_interface.hpp:8-11plugin_interface.hpp:37-105plugin_interface.hpp:108-158get<T>()with defaultplugin_interface.hpp:171-181static instance()plugin_interface.hpp:224-226mutable std::mutexplugin_base.hpp:135,204plugin_base.hpp:151-206plugin_base.hpp:107-137static_cast<double>import_resolution_plugin.hpp:163vector<CrashRecord>crash_context_plugin.hpp:138crash_context_plugin.hpp:244-258crash_context_plugin.hpp:212-217ai_report_generator_plugin.hpp:75-77ai_report_generator_plugin.hpp:99-137build_direct/directoryNEEDS_SOURCE (Requires Actual Prosper Source Code)
These items CANNOT be verified without access to Prosper repository:
Action Required: Mark with
[REQUIRES_PROSPER_SOURCE]tags. Create INTEGRATION_GUIDE.md with assumed points once available.ASSUMPTION (Not Yet Proven)
These items are based on external knowledge or conventions:
/app0/paths for gamesAction Required: Mark with
[ASSUMPTION]tags. Verify during integration.Summary Statistics
Document Generated: 2026-08-12
Source: Phase 8.8 Knowledge Evidence Verification
Repository: prosper-diagnostics-plugins
Status: ✅ READY FOR GITHUB TRANSFER