File size: 3,931 Bytes
9f7b9b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
de46a3c
 
 
9f7b9b2
 
 
 
 
 
 
 
 
 
 
 
70ee5cc
 
 
 
 
 
 
 
 
 
9f7b9b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70ee5cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f7b9b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70ee5cc
 
 
 
9f7b9b2
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# GNN4Colliders agent workflow

This runbook is the shared operational reference for Codex and Claude when
working in this repository.

## Start here

Before a non-trivial change, read:

```text
AGENTS.md
docs/architecture.md
docs/migration.md
```

Production Python belongs under `src/gnn4colliders/`. Keep collider physics
features in `features/`, graph topology in `graphs/`, architecture code in
`models/`, and lifecycle code in `training/`. Use the frozen parity fixtures
and compatibility adapters for historical behavior; do not add historical
implementation imports.

## Environment

The normal development environment is:

```bash
uv sync --dev --extra root-gnn
```

Use the `root-gnn` extra for DGL-backed tests and ROOT-GNN workflows. ONNX
checks additionally need the `onnx` extra.

For the shortest end-to-end check, use the repository's temporary ROOT
fixture:

```bash
uv run python scripts/dev/smoke_end_to_end.py
```

This creates a temporary ROOT file, prepares a graph cache, trains one CPU
epoch, evaluates, predicts, and removes its temporary files.

## Public data and configurations

The supported public source is the pinned `HWresearch/Delphes` dataset. The
Hub resolver caches files locally and verifies configured checksums before ROOT
ingestion.

Use the small deterministic fixture first:

```bash
uv run gnn4colliders prepare --config-name config_hf_smoke
uv run gnn4colliders train --config-name config_hf_smoke
```

For the full 12-process pretraining source:

```bash
uv run gnn4colliders prepare --config-name config_hf_delphes
```

The full configuration can download a large dataset. Do not use it for an
ordinary smoke check. See [configuration.md](../configuration.md) for source
fields, cache behavior, labels, and split semantics.

The CLI has five subcommands:

```bash
uv run gnn4colliders prepare ...
uv run gnn4colliders train ...
uv run gnn4colliders evaluate ...
uv run gnn4colliders predict ...
uv run gnn4colliders export ...
```

Use semantic Hydra overrides such as `model=root_gnn/edge_network` and
`task=binary_classification`; keep implementation module paths out of user
configuration. A run writes its resolved configuration and checkpoints below
`environment.output_root`.

## Validation and testing

Run the portable scientific regression before claiming a data or physics
change is correct:

```bash
uv run python -m validation.run_public_validation
```

Focused checks should run before broad checks:

```bash
uv run pytest tests/unit/<relevant-area> -q
uv run pytest -q
GNN4COLLIDERS_REQUIRE_ROOT_GNN=1 uv run pytest tests/parity -q
uv run ruff check .
uv run ruff format --check .
```

The strict parity command must fail when DGL is unavailable; do not replace it
with a command that permits parity tests to skip. A CUDA-only skip is expected
on CPU hosts and must be reported.

## Change discipline

- Preserve event ordering, feature ordering, tensor shapes, dtypes, labels,
  weights, fold semantics, and graph topology unless the change explicitly
  updates a documented contract.
- Use named metadata fields; do not introduce new public APIs based on
  positional tracking columns.
- Keep CLI modules thin. Put reusable behavior in the package or validation
  modules.
- Avoid private filesystem paths, hidden global state, and untracked generated
  validation output.
- Do not import or recreate a historical runtime backend. The old behavior is
  represented by frozen reference fixtures and the `root-gnn-parity-baseline`
  tag; compatibility code is limited to explicit checkpoint/metadata/output
  boundaries.
- For a parity difference, characterize it with a deterministic test and state
  whether it is intentional.

## Reporting

At handoff, report files changed, behavior implemented, exact checks run,
passed/failed/skipped counts, parity status, intentional deviations, and
unresolved questions. Never describe a check as passed unless it was executed.