Skip to content

ZIR-000: Add comprehensive architecture and development documentation#331

Open
zeroecco wants to merge 4 commits intomainfrom
docs-backfill/architecture-and-build
Open

ZIR-000: Add comprehensive architecture and development documentation#331
zeroecco wants to merge 4 commits intomainfrom
docs-backfill/architecture-and-build

Conversation

@zeroecco
Copy link
Copy Markdown

Summary

This PR adds comprehensive developer documentation to help contributors understand the Zirgen compiler architecture and development workflow. The new documentation complements the existing user-facing circuit language guides.

New Documentation Files

  • ARCHITECTURE.md: Comprehensive overview of compiler structure, MLIR dialects, codegen pipeline, and key technologies
  • docs/BAZEL_BUILD_GUIDE.md: Complete guide to the Bazel build system, including custom rules, build patterns, and troubleshooting
  • docs/SCRIPTS_REFERENCE.md: Detailed documentation for development scripts (copy_codegen_to_risc0.sh, setup-git-hooks.sh)
  • docs/CODE_NAVIGATION.md: Guide to navigating the codebase with quick reference tables and directory structure

Changes to Existing Files

  • README.md: Added Developer Documentation section with links to new docs
  • zirgen/docs/README.md: Added Developer Documentation section with links to new docs

Key Topics Covered

  • Compiler pipeline (parse → lower → typecheck → passes → codegen)
  • Seven MLIR dialects (Zll, ZStruct, ZHLT, ZHL, BigInt, R1CS, IOP)
  • Code generation for Rust, C++, and CUDA targets
  • GPU kernel optimization and register pressure management
  • Bazel build system configuration and custom rules
  • Development workflow and RISC Zero integration
  • Codebase navigation and finding specific functionality

Documentation Organization

The new docs are organized to support different use cases:

  • Quick reference tables for common tasks
  • Step-by-step guides for specific workflows
  • Architectural deep-dives for understanding system design
  • Troubleshooting sections for common issues

Test plan

  • Created four new comprehensive documentation files
  • Updated README.md with new documentation links
  • Updated zirgen/docs/README.md with developer documentation links
  • Verified all internal cross-references work correctly
  • Ensured documentation complements existing user guides

🤖 Generated with Claude Code

zeroecco added 4 commits April 6, 2026 02:02
Add comprehensive documentation for the ZIR-XXX: commit format standard.
This includes:
- CONTRIBUTING.md with quick reference and setup instructions
- docs/commit-guidelines.md with detailed guidelines and examples
- Documentation of existing commit-msg hook and template infrastructure

The repository already has validation tooling in place (.git/hooks/commit-msg
and .git/commit-msg-template). This commit adds missing documentation to help
all contributors understand and follow the standardized format.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Adds tracked versions of commit-msg hook and template in hooks/
directory, along with setup script to install them. Updates
documentation to guide contributors through setup process.

Changes:
- Add hooks/commit-msg and hooks/commit-msg-template
- Add scripts/setup-git-hooks.sh for automated setup
- Update CONTRIBUTING.md with setup instructions
- Update README.md with contributing section

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Make hooks/commit-msg executable (100755) to match setup script.
While the setup script does chmod +x after copying, tracking the
file as executable in git is better practice.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Create four new documentation files to help developers understand the
Zirgen compiler structure and development workflow:

- ARCHITECTURE.md: Compiler structure, MLIR dialects, and codegen pipeline
- docs/BAZEL_BUILD_GUIDE.md: Build system guide with common patterns
- docs/SCRIPTS_REFERENCE.md: Documentation for development scripts
- docs/CODE_NAVIGATION.md: Guide to navigating the codebase

Also updated README.md and zirgen/docs/README.md to link to the new
developer documentation.

These docs complement the existing user-facing circuit language
documentation by providing architectural overview and practical
development guidance for compiler contributors.

Nightshift-Task: docs-backfill
Nightshift-Ref: https://github.com/marcus/nightshift
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