Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
edf5a1c
Add Phase 0 instrumentation: counters, JSON perf report, generated he…
dougchansan Aug 12, 2026
51336ae
Add whole-title CFG and call-graph model
dougchansan Aug 12, 2026
94b0672
Infer function entries by elimination; add cfg_stats
dougchansan Aug 12, 2026
70a1777
Add deterministic region planner
dougchansan Aug 12, 2026
a42b885
Add llvm-aot backend driven by the region plan
dougchansan Aug 12, 2026
67153d1
Grow regions along addresses when the call graph runs dry
dougchansan Aug 12, 2026
3041e9b
Add title benchmark harness
dougchansan Aug 12, 2026
454ba4e
Record Luigi's Mansion runtime and build-cost baselines
dougchansan Aug 12, 2026
8735d5d
Record the benchmark metric decision and Phase 1c status
dougchansan Aug 12, 2026
c5a1b77
Add benchmark matrix driver
dougchansan Aug 12, 2026
3b8d84a
Record that the adjacency merge does not pay for itself
dougchansan Aug 12, 2026
b15a649
Gate benchmark measurement on real frame progress
dougchansan Aug 12, 2026
01b2cab
Measure a fixed frame count, and add environment fallbacks
dougchansan Aug 12, 2026
b69bf33
Record measurement methodology and the fixed-chunk runtime baseline
dougchansan Aug 12, 2026
ec347f9
Add DOLRECOMP_FORCE_BACKEND for callers that hardcode --backend
dougchansan Aug 12, 2026
01a5e25
Document the force-backend override and its precedence
dougchansan Aug 12, 2026
042338b
Fix manifest format broken for the module template
dougchansan Aug 12, 2026
e1493f4
Add arm comparison with a noise floor
dougchansan Aug 12, 2026
22d2cbe
Quantify where region compile time goes
dougchansan Aug 12, 2026
7274396
Refuse to compare arms that ran different guest work
dougchansan Aug 12, 2026
0b29088
Report counters per million guest cycles
dougchansan Aug 12, 2026
8b45fae
Record the moderngekko-port module cache hazard
dougchansan Aug 12, 2026
fe46dfe
Add build_module.sh: per-configuration output dirs and a backend check
dougchansan Aug 12, 2026
0e8c2d3
Establish Mario Kart as the primary benchmark title
dougchansan Aug 12, 2026
eef9d28
Choose the dispatch lookup from the plan's shape, not an env var
dougchansan Aug 12, 2026
4cfc434
Emit a coverage manifest alongside the page index
dougchansan Aug 12, 2026
846b835
Let the Dolphin user directory outlive the output tree
dougchansan Aug 12, 2026
3190d83
Point the matrix at a user directory outside the results tree
dougchansan Aug 12, 2026
cad2699
Record the Mario Kart same-scene head-to-head
dougchansan Aug 12, 2026
4f57213
Static crossings do not predict the runtime dispatcher rate
dougchansan Aug 12, 2026
596f35f
Seed PGO region accretion from the hottest functions, and fix the pro…
dougchansan Aug 12, 2026
465e840
Let cfg_stats load a region profile
dougchansan Aug 12, 2026
d69bbc5
Reload only live guest state after a cross-region call
dougchansan Aug 12, 2026
f9202bc
Bump the object cache version for the liveness change
dougchansan Aug 12, 2026
26af4d9
Region formation does not change the dispatcher rate
dougchansan Aug 12, 2026
b7f0234
Weight the terminator mix by profile: Phase 4 should target blr, not …
dougchansan Aug 12, 2026
10b7a00
Narrow materialize to slots a path to the barrier may have written
dougchansan Aug 12, 2026
f8cb669
Add the differential test suite, and it finds an stfs divergence
dougchansan Aug 12, 2026
3551fb7
Revert the liveness-narrowed reload: it hung Mario Kart
dougchansan Aug 12, 2026
da790ae
Record why the differential suite cannot cover calls yet
dougchansan Aug 12, 2026
96f634d
Record that dispatch helpers alone do not fix the call-path coverage
dougchansan Aug 12, 2026
90a557c
Rewrite the status section around what the measurements showed
dougchansan Aug 12, 2026
e885b52
Cover calls in the differential suite; it fails both barrier optimisa…
dougchansan Aug 12, 2026
8eba0cd
Teach reaching-writes about helper writes, conservatively
dougchansan Aug 12, 2026
ae18555
Record the barrier store narrowing result: -12% code, -23% build time
dougchansan Aug 12, 2026
fd6ccde
Move internal region bodies to fastcc
dougchansan Aug 12, 2026
d2d7ad8
Retract the store narrowing win: the module does not run
dougchansan Aug 12, 2026
2d373a4
Fix the third root cause: indirect-switch edges missing from both passes
dougchansan Aug 12, 2026
2b110c5
Gate barrier narrowing and region inlining behind flags, both off by …
dougchansan Aug 12, 2026
5e2676f
Cross-region inlining needs ThinLTO: measured, +0.017% module size
dougchansan Aug 13, 2026
7d27e40
Inline A/B: no readable result, and the rig is noisier than claimed
dougchansan Aug 13, 2026
d0f9021
Require 2x the baseline spread before reporting a delta
dougchansan Aug 13, 2026
263b1d5
Start ThinLTO: bitcode option declared, emission left unimplemented
dougchansan Aug 13, 2026
a01b53b
Emit ThinLTO bitcode via ThinLTOBitcodeWriterPass, from a clone
dougchansan Aug 13, 2026
1ef0fcd
Add --lto thin: emit per-region ThinLTO bitcode and link through it
dougchansan Aug 13, 2026
52a83fb
Keep dolrecomp.exe beside moderngekko-port current
dougchansan Aug 13, 2026
32f9af6
ThinLTO measured on Luigi's Mansion: -5.6% module, no readable fps ch…
dougchansan Aug 13, 2026
0586e79
ThinLTO on Mario Kart: -6.1% module, and the link needs a job cap
dougchansan Aug 13, 2026
d3d03b7
Phase 5: --memory-mode fast, with the assumptions checked at runtime
dougchansan Aug 13, 2026
a98fca1
Cover the MEM1 boundary, which nothing else tested
dougchansan Aug 13, 2026
4577246
Phase 5 measured: --memory-mode fast is +6.7% fps on both titles
dougchansan Aug 13, 2026
61ada5f
Composing thin LTO with fast memory: sizes add, the titles disagree o…
dougchansan Aug 13, 2026
42bb889
Make --memory-mode fast the default
dougchansan Aug 13, 2026
fed9df3
Confirm fast memory mode on Skyward Sword: three titles, both consoles
dougchansan Aug 13, 2026
00f95b6
Make the direct-call patchability policy explicit, and close phases 2-4
dougchansan Aug 13, 2026
5991b41
Pass GPR3-GPR10 in registers across the fastcc boundary, entry side only
dougchansan Aug 13, 2026
feb34fc
Register-passed guest state is measured and negative: -2.3% fps
dougchansan Aug 14, 2026
bde46dd
The C backend is 60% faster than llvm-aot on Mario Kart
dougchansan Aug 14, 2026
67c31d3
It is the LLVM backend, not region formation: C is 70% faster than fi…
dougchansan Aug 14, 2026
fef32b3
Root cause: the LLVM backend spills the guest register file
dougchansan Aug 14, 2026
3cc9e86
Prototype: not promoting guest state closes the whole gap to the C ba…
dougchansan Aug 14, 2026
88e4224
Make state-in-memory the default: validated on three titles
dougchansan Aug 14, 2026
f6192a0
Delete the machinery that existed to manage hoisted guest state
dougchansan Aug 14, 2026
cbe481a
Add the final engineering report
dougchansan Aug 14, 2026
7e37d33
Correct the post-deletion A/B in the report to the final sample
dougchansan Aug 14, 2026
fd98fd6
Stop emitting helpers that only exist in DolRecomp's own header
dougchansan Aug 14, 2026
4096e00
PGO measured on top of state-in-memory: +14.9% on Mario Kart
dougchansan Aug 14, 2026
1febd4d
PGO generalizes: held-out scenes bracket the same-scene result
dougchansan Aug 14, 2026
0f069ef
PGO validated on all three titles: 34 of 36 pairs, p = 1.9e-08
dougchansan Aug 14, 2026
9c7fdcc
Correct the report: the GXRuntime edit was replaced by an emitter fix
dougchansan Aug 14, 2026
85be12b
Trim the branch to what a reviewer needs
dougchansan Aug 14, 2026
14ef298
Drop the benchmark tooling from the branch
dougchansan Aug 14, 2026
f472719
Measure this branch's work on AArch64: parity, both core modes
dougchansan Aug 15, 2026
46672a7
Withdraw the AArch64 parity result: the module was not executing
dougchansan Aug 19, 2026
1f8ee67
Tell LLVM that guest RAM and CPUState are disjoint: +21.1% on AArch64
dougchansan Aug 19, 2026
8755ce3
Record the AArch64 results now that the module executes
dougchansan Aug 20, 2026
34c99a1
Put the AArch64 numbers in the headline, not only in section 7
dougchansan Aug 20, 2026
57f2cda
Load MEM1's base once per region instead of once per guest access
dougchansan Aug 20, 2026
d693f66
Record that both AArch64 changes generalise to a second title
dougchansan Aug 20, 2026
20cb163
Record PGO on AArch64 for both titles, and what dual core is worth
dougchansan Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ endif()

set(DOLRECOMP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src")

add_library(dr_common STATIC src/common/perf.c src/common/options.c)
target_include_directories(dr_common PUBLIC ${DOLRECOMP_SRC})

add_library(dr_cpu STATIC src/cpu/cpu.c)
target_include_directories(dr_cpu PUBLIC ${DOLRECOMP_SRC})
if(NOT WIN32)
Expand Down Expand Up @@ -99,7 +102,7 @@ if(DOLRECOMP_ENABLE_LLVM)
target_include_directories(dr_llvm SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
target_compile_definitions(dr_llvm PUBLIC DOLRECOMP_ENABLE_LLVM=1)
target_compile_definitions(dr_llvm PRIVATE ${LLVM_DEFINITIONS})
target_link_libraries(dr_llvm PUBLIC dr_ir)
target_link_libraries(dr_llvm PUBLIC dr_ir dr_common)
if(MINGW)
find_library(DOLRECOMP_LLVM_SHARED_IMPORT
NAMES LLVM-${LLVM_VERSION_MAJOR} LLVM
Expand All @@ -123,6 +126,8 @@ if(DOLRECOMP_ENABLE_LLVM)
endif()

add_library(dr_analysis STATIC
src/analysis/cfg.c
src/analysis/regions.c
src/analysis/embedded_data.c
src/analysis/smc.c
src/analysis/symbol_map.c
Expand All @@ -138,7 +143,7 @@ add_library(dr_backend STATIC
src/backend/symbols.c
)
target_include_directories(dr_backend PUBLIC ${DOLRECOMP_SRC})
target_link_libraries(dr_backend PUBLIC dr_frontend dr_analysis)
target_link_libraries(dr_backend PUBLIC dr_frontend dr_analysis dr_common)
if(NOT WIN32)
target_link_libraries(dr_backend PUBLIC Threads::Threads)
endif()
Expand All @@ -151,7 +156,7 @@ add_library(dr_app STATIC
src/app/pipeline.c
)
target_include_directories(dr_app PUBLIC ${DOLRECOMP_SRC})
target_link_libraries(dr_app PUBLIC dr_backend dr_analysis dr_frontend dr_platform dr_ir)
target_link_libraries(dr_app PUBLIC dr_backend dr_analysis dr_frontend dr_platform dr_ir dr_common)
if(DOLRECOMP_ENABLE_LLVM)
target_link_libraries(dr_app PUBLIC dr_llvm)
endif()
Expand All @@ -169,6 +174,9 @@ endif()
add_executable(dolir_stats tools/dolir_stats.c)
target_link_libraries(dolir_stats PRIVATE dr_ir dr_frontend dr_analysis)

add_executable(cfg_stats tools/cfg_stats.c)
target_link_libraries(cfg_stats PRIVATE dr_analysis dr_frontend)

enable_testing()

add_executable(test_opcodes tests/test_opcodes.c)
Expand Down Expand Up @@ -261,6 +269,18 @@ add_executable(test_dolir tests/test_dolir.c)
target_link_libraries(test_dolir PRIVATE dr_ir)
add_test(NAME dolir COMMAND test_dolir)

add_executable(test_cfg tests/test_cfg.c)
target_link_libraries(test_cfg PRIVATE dr_analysis)
add_test(NAME cfg COMMAND test_cfg)

add_executable(test_regions tests/test_regions.c)
target_link_libraries(test_regions PRIVATE dr_analysis)
add_test(NAME regions COMMAND test_regions ${CMAKE_CURRENT_BINARY_DIR}/regions_test)

add_executable(test_perf tests/test_perf.c)
target_link_libraries(test_perf PRIVATE dr_common)
add_test(NAME perf COMMAND test_perf ${CMAKE_CURRENT_BINARY_DIR}/perf_test)

if(DOLRECOMP_ENABLE_LLVM)
add_executable(test_llvm_backend tests/test_llvm_backend.cpp)
target_link_libraries(test_llvm_backend PRIVATE dr_llvm)
Expand All @@ -280,6 +300,42 @@ if(DOLRECOMP_ENABLE_LLVM)
add_executable(test_llvm_execute tests/test_llvm_execute.c ${DOLRECOMP_TEST_OBJECT})
target_link_libraries(test_llvm_execute PRIVATE dr_cpu)
add_test(NAME llvm_execute COMMAND test_llvm_execute)
# Differential harness: the same random guest code through both backends,
# emitted at different guest bases so the two sets of func_<address>
# symbols coexist in one comparing binary.
add_executable(gen_differential tests/differential/gen_differential.cpp)
target_link_libraries(gen_differential PRIVATE dr_llvm dr_backend dr_ir)
set(DIFF_C ${CMAKE_CURRENT_BINARY_DIR}/differential_generated.c)
set(DIFF_O ${CMAKE_CURRENT_BINARY_DIR}/differential_generated.o)
set(DIFF_H ${CMAKE_CURRENT_BINARY_DIR}/differential_manifest.h)
# DOLRECOMP_DIFF_SEED lets CI sweep seeds without editing anything; the
# default is fixed so an ordinary run is reproducible.
if(NOT DEFINED DOLRECOMP_DIFF_SEED)
set(DOLRECOMP_DIFF_SEED 20260812)
endif()
# Overridable so a failure can be shrunk to a minimal repro without editing.
if(NOT DEFINED DOLRECOMP_DIFF_FUNCTIONS)
set(DOLRECOMP_DIFF_FUNCTIONS 64)
endif()
if(NOT DEFINED DOLRECOMP_DIFF_LENGTH)
set(DOLRECOMP_DIFF_LENGTH 24)
endif()
add_custom_command(
OUTPUT ${DIFF_C} ${DIFF_O} ${DIFF_H}
COMMAND gen_differential ${DIFF_C} ${DIFF_O} ${DIFF_H}
${DOLRECOMP_DIFF_SEED} ${DOLRECOMP_DIFF_FUNCTIONS} ${DOLRECOMP_DIFF_LENGTH}
DEPENDS gen_differential
VERBATIM
)
set_source_files_properties(${DIFF_O}
PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
add_executable(test_differential
tests/test_differential.c ${DIFF_C} ${DIFF_O} ${DIFF_H})
target_include_directories(test_differential PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${DOLRECOMP_SRC})
target_link_libraries(test_differential PRIVATE dr_cpu)
add_test(NAME differential COMMAND test_differential)

add_executable(test_llvm_pipeline tests/test_llvm_pipeline.c)
target_include_directories(test_llvm_pipeline PRIVATE ${DOLRECOMP_SRC})
add_test(NAME llvm_pipeline COMMAND test_llvm_pipeline
Expand Down
Loading
Loading