Skip to content

Add codebase wiki - #264

Open
shaobohou wants to merge 1 commit into
mainfrom
wiki
Open

Add codebase wiki#264
shaobohou wants to merge 1 commit into
mainfrom
wiki

Conversation

@shaobohou

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a wiki/ directory: an LLM-maintained knowledge base following the Karpathy wiki pattern — persistent, interlinked markdown files that compile codebase knowledge once rather than re-deriving it on every question
  • 23 pages across overview, concepts, entities, and design sections
  • Covers architecture, core mechanisms, all key classes, and design proposals from a deep review session

Contents

Concepts — core mechanisms and patterns:

  • Conversion phases (build time vs run time, the 12 captured closure variables)
  • Op registry (two-level factory pattern, register_operation)
  • Graph evaluation (toposort, _EvaluationCache reference counting, named-arg protocol)
  • Variable semantics (TF variables → functional JAX params)
  • Custom gradients (IdentityN detection, subgraph extraction pipeline)
  • Library functions (_CachedBuilder lazy compilation, FunctionDefLibrary)
  • NumPy compat (dual np/jnp dispatch, polymorphic shapes)
  • jax2tf round-trip (what jax2tf does to graphs and how tf2jax handles it)

Entities — specific classes and functions:

  • Public API (convert, convert_functional, convert_from_restored)
  • _OpNode, _Subgraph, _TensorEdge, _LibraryFunction, _HigherOrderFunction, Variable
  • _GraphDef/_NodeDef synthetic types and the dual graph representation
  • jax2tf heuristics (_infer_relu_from_jax2tf, cumulative reduction inference)

Design — proposals and trade-off records:

  • 7 structural refactoring recommendations (with priority table)
  • Full design for lazy custom gradient evaluation using jax.custom_vjp

Test plan

  • Wiki is readable and links resolve correctly
  • No source files modified

🤖 Generated with Claude Code

@google-cla

google-cla Bot commented Apr 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

LLM-maintained wiki following the Karpathy wiki pattern: persistent,
interlinked markdown files that compile knowledge once rather than
re-deriving it on every query.

Covers architecture overview, core concepts (conversion phases, op
registry, graph evaluation, variable semantics, custom gradients,
library functions, numpy compat, jax2tf round-trip), entity pages for
all key classes, and design notes (structural refactoring proposals,
lazy custom gradient design).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant