Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5a46cd2
Drop Graphs from BBCode sorting
yebai Apr 3, 2026
44c3fdb
Introduce inline pullback CFG builder
yebai Apr 3, 2026
747b7e6
Migrate forwards pass onto CFG builder
yebai Apr 3, 2026
6749c17
Use CFG blocks in reverse-pass assembly
yebai Apr 3, 2026
d76bfd0
Move CFG utilities out of BBCode in reverse mode
yebai Apr 3, 2026
dbbd064
Lower reverse-mode CFG directly to IRCode
yebai Apr 3, 2026
c187fcc
Replace bbcode tests with cfg builder coverage
yebai Apr 3, 2026
fba6f23
Delete bbcode and lower reverse mode from IRCode
yebai Apr 3, 2026
35352ef
Simplify reverse-mode CFG conversion helpers
yebai Apr 3, 2026
e09f749
Reuse shared stmt accessor in CFG lowering
yebai Apr 3, 2026
e94220e
Tighten CFG phi-node extraction
yebai Apr 3, 2026
ab2d3c2
Clarify CFG canonicalization order
yebai Apr 3, 2026
80eae21
Remove duplicate Mooncake test imports
yebai Apr 3, 2026
d842958
Use direct comprehensions for CFG instruction flattening
yebai Apr 3, 2026
8daa77a
Simplify CFG double-edge rewrite
yebai Apr 3, 2026
5713114
Simplify CFG predecessor initialization
yebai Apr 3, 2026
5400fa1
Simplify CFG successor construction
yebai Apr 3, 2026
47f874c
Unify CFG IR lowering pipeline
yebai Apr 3, 2026
c31ff76
Share phi value remapping
yebai Apr 3, 2026
64c069a
Expand reverse-mode docs and import PR 459 docs
yebai Apr 4, 2026
7a486af
Tighten reverse-mode doc consistency
yebai Apr 4, 2026
9a8ca47
Reorganize reverse-mode source layout
yebai Apr 4, 2026
4d9b60e
Tighten reverse-mode docs flow
yebai Apr 4, 2026
412da6e
Polish reverse-mode doc consistency
yebai Apr 4, 2026
3552b63
Tighten reverse-mode robustness notes
yebai Apr 4, 2026
a1a0846
Clarify reverse-mode expr translation flow
yebai Apr 4, 2026
c91c070
Merge remote-tracking branch 'origin/main' into refactoring-rvs-mode
yebai Apr 4, 2026
3e1a56f
Simplify reverse-mode lowering and CFG inspection
yebai Apr 4, 2026
6862184
Merge remote-tracking branch 'origin/main' into refactoring-rvs-mode
yebai Apr 9, 2026
8df349c
Remove dead arg_types computation and fix roadmap comment ordering
yebai Apr 9, 2026
47b6bdb
Merge remote-tracking branch 'origin/main' into refactoring-rvs-mode
yebai Apr 20, 2026
5703604
Format skill utils
yebai Apr 20, 2026
5fde7fb
Merge origin/main into refactoring-rvs-mode
yebai Apr 28, 2026
3dcaa36
Merge remote-tracking branch 'origin/main' into refactoring-rvs-mode
yebai May 1, 2026
5cc1084
Rename CallADPlan to RuleSelection
yebai May 1, 2026
994126f
Tighten reverse-mode docstrings, helpers, and CFG tests
yebai May 3, 2026
050c49c
Restore jldoctest markers in ir_representation.md
yebai May 3, 2026
b17c84e
Match jldoctest outputs to Julia 1.12 IR printing
yebai May 3, 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
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DispatchDoctor = "8d63f2c5-f18a-4cf2-ba9d-b3f60fc568c8"
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MistyClosures = "dbe65cb8-6be2-42dd-bbc5-4196aaced4f4"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Expand Down Expand Up @@ -71,7 +70,6 @@ ExprTools = "0.1"
Flux = "0.16.3"
FunctionWrappers = "1.1.3"
GPUArraysCore = "0.1, 0.2"
Graphs = "1"
JET = "0.9, 0.10, 0.11"
LinearAlgebra = "1"
LogExpFunctions = "0.3"
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ makedocs(;
joinpath("understanding_mooncake", "introduction.md"),
joinpath("understanding_mooncake", "algorithmic_differentiation.md"),
joinpath("understanding_mooncake", "rule_system.md"),
joinpath("understanding_mooncake", "what_programme_are_you_differentiating.md"),
],
"Utilities" => [
joinpath("utilities", "defining_rules.md"),
Expand Down
Binary file added docs/src/assets/computation_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/src/developer_documentation/advanced_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ show_world_info(ins)

### Reverse mode stages

`:raw` → `:normalized` → `:bbcode` → `:fwd_ir` / `:rvs_ir` → `:optimized_fwd` / `:optimized_rvs`
`:raw` → `:normalized` → `:cfg_blocks` → `:fwd_ir` / `:rvs_ir` → `:optimized_fwd` / `:optimized_rvs`

### Forward mode stages

`:raw` → `:normalized` → `:dual_ir` → `:optimized`
`:raw` → `:normalized` → `:cfg_blocks` → `:dual_ir` → `:optimized`

!!! note
The inspection tool also shows a `:bbcode` stage for cross-mode comparison,
but forward mode does not use BBCode internally.
The inspection tool also shows a `:cfg_blocks` stage for cross-mode comparison,
but forward mode does not use `CFGBlock`s internally.

!!! note
Primitive signatures such as `sin` do not generate AD IR stages here. Mooncake
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer_documentation/forwards_mode_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Then, instead of propagating a "primal-tangent" pairs via `Dual`s, we propagate
The implementation of forwards-mode AD is quite dramatically simpler than that of reverse-mode AD.
Some notable technical differences include:
1. forwards-mode AD only makes use of the tangent system, whereas reverse-mode also makes use of the fdata / rdata system.
1. forwards-mode AD comprises only line-by-line transformations of the `IRCode`. In particular, it does not require the insertion of additional basic blocks, nor the modification of the successors / predecessors of any given basic block. Consequently, there is no need to make use of the `BBCode` infrastructure built up for reverse-mode AD -- everything can be straightforwardly done at the `Compiler.IRCode` level.
1. forwards-mode AD comprises only line-by-line transformations of the `IRCode`. In particular, it does not require the insertion of additional basic blocks, nor the modification of the successors / predecessors of any given basic block. Consequently, there is no need to make use of the builder-local CFG machinery used in reverse mode -- everything can be straightforwardly done at the `Compiler.IRCode` level.

## Comparison with ForwardDiff.jl

Expand Down
470 changes: 84 additions & 386 deletions docs/src/developer_documentation/ir_representation.md

Large diffs are not rendered by default.

Loading
Loading