patrick-kidger / patrick-kidger/jaxtyping

Can we check statement-level annotations?

Open
#7 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
1.9k
Forks
96
PR merge metrics
No merged PRs in 30d

Description

One of my dreams for this package was to turn code like this

  query = linear(head.query, t1)                  # L x Dk
  key = linear(head.key, t1)                      # L x Dk

into this

  query : LxDk = linear(head.query, t1)
  key   : LxDk = linear(head.key, t1)

where we have written

  LxDk = f32["L Dk"] 

earlier in the @jaxtyped function.

But it looks as if these annotations aren't checked?
I haven't looked into how hard that might be - is it a lot of work?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue centers on the @jaxtyped entry point and statement-level annotations; begin by tracing how @jaxtyped handles annotations inside a function. Use the shown LxDk example to establish the current behavior, and consider tests that verify whether those annotations are checked. Done means the intended statement-level checking behavior is implemented and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.