Conversation
Water Code Coverage |
34428e7 to
a17c11e
Compare
|
Does it make sense to use AGENTS.md files instead to support different providers? e.g. cursor, copilot and so on? |
Looks like we'll need to add a CLAUDE.md containing I'll make the necessary changes. |
|
I have this in my global |
| requirements-pytorch-rocm-generated.txt | ||
|
|
||
| # Claude | ||
| CLAUDE.local.md |
There was a problem hiding this comment.
This gitignores a CLAUDE.local.md file, but I would like the main CLAUDE.md (or AGENTS.md) to explicitly reference and tell the model to also adhere to an AGENTS.local.md file -- from what I've read, most agent programs don't read an AGENTS.local.md, and it seems that claude doesn't use CLAUDE.local.md anymore either. I think this is a shame. Anyway, we will all have some personal workflow stuff in addition to any shared AGENTS.md stuff. There is the global ~/.claude/CLAUDE.md and similar for other agents, but that affects all repos, and I really want to have personal and repo-specific instructions for agents.
There was a problem hiding this comment.
Claude does still use CLAUDE.local.md:
❯ /context
⎿ Context Usage
⛁ ⛁ ⛀ ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ Claude-Sonnet-4.6 · 5k/200k tokens (3%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Estimated usage by category
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 3.9k tokens (1.9%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Memory files: 1.1k tokens (0.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Skills: 349 tokens (0.2%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Messages: 8 tokens (0.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Free space: 162k (80.9%)
⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ Autocompact buffer: 33k tokens (16.5%)
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝
Memory files · /memory
└ CLAUDE.md: 13 tokens
└ AGENTS.md: 1k tokens
└ CLAUDE.local.md: 19 tokens
└ ~/.claude/projects/-home-tgymnich-wave/memory/MEMORY.md: 39 tokens
Skills · /skills
So you should be able to still use per-repo configs.
I also added AGENTS.local.md to .gitignore.
|
|
||
| ### Gotchas | ||
| - **Always set `WAVE_CACHE_ON=0`** when testing code changes — stale cache entries hide the effect of edits: `WAVE_CACHE_ON=0 pytest ...` | ||
| - DCO sign-off required on commits: `git commit -s` |
There was a problem hiding this comment.
I would like to not have the agent sign off automatically. I know we need sign-off for CI, but I don't like the agent signing off for me. Lately I've been using a workflow where I have agents generate a bunch of stuff, and sometimes I push to run CI, knowing that the sign-off check will fail, but letting me do a full CI test to see if there is anything missing from a PR, then review the code and then add sign-off after I review. It's not hard to add sign-off after-the-fact. Eg. I have a git metadata script that lets me add sign-off to a range of commits: https://github.com/willghatch/dotfileswgh/blob/2331bbb8998668406b5f0d11e8c7b9fe3561a7ae/commands/git-commit-meta
There was a problem hiding this comment.
removed the sign-off part
|
I have mixed feelings about checking in a CLAUDE.md or AGENTS.md file. I DO want to share pieces of it, but I also want to always be able to inject my own repo-local config without conflicting with checked-in files, and I worry that over time the AGENTS.md check-in can become stale, or become large. I've personally been using a script that can pull in many snippets to build an AGENTS.md file, where I can add and remove default and non-default snippets, where some are global defaults (IE stuff about my workflow that I always use), some are per-project defaults, some non-default that I can manually trigger to add, etc (https://github.com/willghatch/dotfileswgh/blob/2331bbb8998668406b5f0d11e8c7b9fe3561a7ae/commands/agents-md-generate). I somewhat wish we would check in a directory of markdown files with instructions that we can pull in a la carte, but that's sort of an obtuse workflow if you're not using something like my script. I've been intending to make a |
Add top-level CLAUDE.md with project overview, build/test commands, compilation flow, runtime options, and architecture. Add water/CLAUDE.md and waveasm/CLAUDE.md covering each optional extension's build workflow, dialect design, and pass pipeline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Tim Gymnich <tim@gymni.ch>
@ imports always load at session start. Child CLAUDE.md files load on demand automatically when Claude works in those directories. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Tim Gymnich <tim@gymni.ch>
Signed-off-by: Tim Gymnich <tim@gymni.ch>
ftynse
left a comment
There was a problem hiding this comment.
Looks like a good start in general. My overall recommendation is to point to files/scripts whenever possible to prevent instruction bitrot
|
|
||
| ```bash | ||
| # First build — builds LLVM from source, takes a while | ||
| WAVE_WATER_DIR=water/build pip install -e ".[dev]" |
There was a problem hiding this comment.
Do we need to pre-build water for the dir to exist?
|
|
||
| ```bash | ||
| ninja -C water/build check-water # all lit tests | ||
| lit test/Dialect/Wave/<test>.mlir -vv # single test |
There was a problem hiding this comment.
Tell it where to find lit (in .venv or in LLVM build/install tree). Mine gets confused a lot.
|
|
||
| ### Dialects | ||
|
|
||
| **`wave.*`** — primary dialect. `wave.tensor` has symbolic shapes (unknown until inferred by passes) and an address space (`Global`, `Shared`, `Register`). Each op carries a `WaveIndexMappingAttr` encoding element distribution across device/workgroup/workitem/register dimensions as `(offset, count, step)` triples. |
There was a problem hiding this comment.
Point to WaveOps.td and co., it should be able to parse documentation from there.
| | Pass | Purpose | | ||
| |---|---| | ||
| | `water-wave-detect-normal-forms` | Detect satisfied invariants | | ||
| | `water-wave-infer-types` | Shape inference via dataflow | | ||
| | `water-wave-infer-index-exprs` | Forward/backward index expression propagation | | ||
| | `water-wave-propagate-elements-per-thread` | Replace register tensors with vector types | | ||
| | `water-wave-resolve-distributed-allocations` | Map distributed shapes to concrete memref layouts | | ||
| | `lower-wave-to-mlir` | Lower to arith/math/vector/memref dialects | | ||
| | `lower-normalform-module` | Remove the normalform wrapper | |
There was a problem hiding this comment.
Would be nice to point to the named pipeline in addition to this.
There was a problem hiding this comment.
water-middle-end-lowering is mentioned above
|
|
||
| ### Gotchas | ||
| - **Always set `WAVE_CACHE_ON=0`** when testing code changes — stale cache entries hide the effect of edits: `WAVE_CACHE_ON=0 pytest ...` | ||
| - DCO sign-off required on commits: `git commit -s` |
| ### Linting | ||
| ```bash | ||
| mypy # type check wave_lang | ||
| pre-commit run --all-files # Black, Ruff, clang-format |
There was a problem hiding this comment.
We don't necessarily want it to touch irrelevant files in a commit
There was a problem hiding this comment.
removed --all-files
ecb287e to
c8a0d8e
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Tim Gymnich <tim@gymni.ch>
- water/AGENTS.md: restructure Building section to clarify that Water must be built with CMake first, then pip install with WAVE_WATER_DIR; add full cmake configure/build commands and useful flags; note that ninja alone is sufficient for iterating after initial pip install; add git clang-format guidance; add lit location note; add Pipelines.cpp reference in Pass Pipeline section - waveasm/AGENTS.md: add git clang-format guidance - AGENTS.md: update pre-commit invocation; add AGENTS.local.md to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Tim Gymnich <tim@gymni.ch>
This should be even easier now, that the CLAUDE.local.md and AGENTS.local.md are in .gitignore, and as mentioned above claude is still reading these files and loads them into the context.
I share your concerns. Let's keep updating these files and keep them as small as possible. I am open to cutting the current set of files down even further. This is just a starting point.
This sounds a lot like progressive disclosure. We could have a directory like:
+1
Isn't this already the case, that AGENTS.md would appear in unstaged changes? |
|
I didn't know about |
|
Are you sure claude is still reading |
|
To be clear: I'm not asking for all of my grievances to be addressed before we move forward, I just want to put my thoughts and concerns out there. |
Add top-level CLAUDE.md with project overview, build/test commands,
compilation flow, runtime options, and architecture. Add water/CLAUDE.md
and waveasm/CLAUDE.md covering each optional extension's build workflow,
dialect design, and pass pipeline.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com