You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update AGENTS.md files with build instructions and formatting guidance
- 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>
Copy file name to clipboardExpand all lines: water/AGENTS.md
+42-11Lines changed: 42 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,26 +2,57 @@ Water is an optional MLIR layer in the Wave compiler stack that replaces IREE's
2
2
3
3
## Building
4
4
5
+
Water must be built with CMake first. `pip install` alone does not build Water — `WAVE_WATER_DIR` is required to point Wave at an existing Water build.
6
+
7
+
LLVM is pinned at `water/llvm-sha.txt`. CLI tool: `water-opt` (analogous to `mlir-opt`).
8
+
9
+
### Step 1: Build Water with CMake
10
+
11
+
Requires a pre-built LLVM/MLIR. Set `$BUILD_DIR` to your LLVM build or install tree.
12
+
5
13
```bash
6
-
# First build — builds LLVM from source, takes a while
`WAVE_WATER_DIR` tells the Wave build system to use an existing build directory instead of rebuilding from scratch. Without it, the full LLVM + Water CMake build runs on every `pip install`.
41
+
`WAVE_WATER_DIR` tells Wave where to find the Water build. Without it, Water is not included.
15
42
16
-
LLVM is pinned at `water/llvm-sha.txt`. CLI tool: `water-opt` (analogous to `mlir-opt`).
43
+
### Iterating on C++ changes
17
44
18
-
## Formatting
45
+
```bash
46
+
ninja -C water/build # rebuild changed C++ targets and Python bindings
47
+
```
19
48
20
-
C++ code is formatted with `clang-format`. Run via pre-commit or directly:
49
+
## Formatting
21
50
51
+
C++ code is formatted with `git clang-format` which formats only the lines changed relative to a commit (default: `HEAD`)
22
52
```bash
23
-
clang-format -i <file># format a single file in-place
24
-
pre-commit run clang-format # format all staged files
53
+
git clang-format # format staged changes
54
+
git clang-format HEAD~1 # also include most recent commit
55
+
git clang-format main # format everything touched on your branch
0 commit comments