HTP is a Python-AST-centric compiler framework for heterogeneous tile programs, kernel programs, and workload/dataflow programs.
Its primary goal is not only retargetability. It is to build a compiler stack that is both human-friendly and LLM-friendly, with AST all the way as the core discipline.
The repository has three active responsibilities:
- implement the current framework in
htp/andhtp_ext/ - document landed behavior in
docs/design/ - track active feature work through
docs/in_progress/and reopendocs/todo/only when new concrete gaps appear
That top-level goal has two strict consequences:
- human-friendly: intermediate compiler artifacts must still unparse into readable native Python that a person can inspect and edit
- LLM-friendly: mutated intermediate artifacts must still unparse into runnable Python with an executor/interpreter path so tools and agents can replay them
Implemented today:
- staged replayable compilation artifacts under
ir/stages/ - compact staged state bundles rooted at
program.py,stage.json, andstate.json ProgramModule-first lowering from the current public frontend set (kernel,routine,wsp, andcsp)- registry-driven passes, pipeline templates, solver preflight, and machine-visible pass traces
- human-first programming surfaces for kernels, WSP, CSP, and Arknife-style NV-GPU annotation
- MLIR CSE and AIE extension participation
- PTO
a2a3simanda2a3contracts, NV-GPU CUDA profiling/Blackwell profile plans, AIE reference toolchain paths, and a CPU reference backend - agent-facing replay, verify, diff, explain, bisect, minimize, promote-plan, policy-check, and workflow-state tooling
- machine-enforced edit-corridor and PR policy checks
Current TODO status:
docs/todo/README.mdis authoritative for future work- the currently reopened topic is
docs/todo/alignment_and_product_gaps.md - the remaining open work is now mainly:
- programming-surface quality,
- flagship example realism,
- backend-depth widening,
- and keeping top-level docs/status claims honest
docs/story.md— final intended framework storydocs/design/— implemented feature documents and code-backed architecturedocs/todo/README.md— current future-work summarydocs/in_progress/— active feature-sized PR tasksdocs/reference/— referencesdocs/research/— research notes and supporting reports
Implemented architecture:
docs/design/README.mddocs/design/compiler_model.mddocs/design/programming_surfaces.mddocs/design/pipeline_and_solver.mddocs/design/artifacts_replay_debug.mddocs/design/backends_and_extensions.mddocs/design/agent_product_and_workflow.mddocs/design/status_and_alignment.md- example-local walkthroughs under
examples/**/README.md
Supporting analysis:
docs/research/retargetable_extensibility_report.md
Primary Python entrypoints:
htp.compile_program(...)htp.bind(...)
CLI surface:
python -m htp replay <package>python -m htp verify <package>python -m htp diff --semantic <left> <right>python -m htp explain <diagnostic-code>python -m htp bisect <left> <right>python -m htp minimize <package> <output-dir>python -m htp policy-check <changed-file> ...python -m htp workflow-state
The authoritative development and CI environment is pixi.toml.
Preferred verification:
pixi run verify
Fallback when Pixi is unavailable:
python -m pip install --user --upgrade pip setuptools wheelpython -m pip install -e '.[dev]'pytestpre-commit run --all-files
htp/dev is the stable branch.
Feature work must follow this loop:
- if there is open future work, choose it from
docs/todo/README.md - create
htp/feat-<topic> - create a task file in
docs/in_progress/as the first commit - open a PR to
htp/dev - implement through more commits
- before merge, update
docs/design/, updatedocs/todo/README.mdif future-work state changed, and remove the task file fromdocs/in_progress/
Repo-level operating rules live in AGENTS.md.