Skip to content

Commit 8d7ccd9

Browse files
committed
Consolidate repository documentation
1 parent 89c35a8 commit 8d7ccd9

75 files changed

Lines changed: 1398 additions & 3110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
*.toml text eol=lf
66
*.txt text eol=lf
77
*.yml text eol=lf
8+
*.html text eol=lf

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ Thumbs.db
5959
.vscode/
6060
.idea/
6161
.ipynb_checkpoints/
62+
63+
# Local preserved docs and legacy scratch material
64+
/local_archive/

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
| 영역 | 변경 |
66
|---|---|
7-
| package | canonical package를 `graphfl_lab`으로 통일 |
7+
| package | canonical package를 `graphfl_lab` 통일 |
88
| Flower app | Flower app path를 `graphfl_lab` 기준으로 정리 |
9-
| legacy surface | `spectral_fl`, `run_general_*`, `general_*` facade 제거 |
10-
| vision artifact | 새 결과명을 `result_vision_*`, `vision_suite_*`로 표준화 |
9+
| legacy surface | `spectral_fl`, `run_general_*`, `general_*` facade 정리 |
10+
| vision artifact | 결과 이름을 `result_vision_*`, `vision_suite_*`로 표준화 |
1111
| compatibility | 과거 JSON/config 입력을 위한 read-only alias 유지 |
1212
| unified runner | `run_experiment.py --track vision|cora` surface 추가 |

MIGRATION.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# GraphFL Lab Migration
22

3-
`graphfl_lab`가 canonical package다. Gate 6 cleanup과 public rename은 release `1.0.0`에서 완료되었다.
3+
`graphfl_lab`가 canonical package다. Public rename과 cleanup은 release `1.0.0` 기준으로 정리되었다.
44

55
## Canonical Surface
66

7-
| 영역 | Canonical |
7+
| Area | Canonical |
88
|---|---|
99
| package | `graphfl_lab` |
10+
| Flower app | `graphfl_lab.flower_app:server_app`, `graphfl_lab.flower_app:client_app` |
1011
| vision runner | `run_vision_*` |
1112
| unified runner | `run_experiment.py --track vision|cora` |
1213
| vision result | `result_vision_*` |
@@ -16,24 +17,29 @@
1617

1718
## Compatibility Alias
1819

19-
| Legacy | Current |
20-
|---|---|
21-
| `configs/general/...` | `configs/vision/...` path alias |
22-
| `spectral_filter_strength` | JSON read alias for `graph_filter_strength` |
23-
| `spectral_filtered_*` | aggregation input alias |
24-
| `ours_spectral_filtered_*` | historical reporting tag |
20+
| Legacy | Current | Role |
21+
|---|---|---|
22+
| `configs/general/...` | `configs/vision/...` path alias | old config path read support |
23+
| `spectral_filter_strength` | JSON read alias for `graph_filter_strength` | old config key read support |
24+
| `spectral_filtered_*` | aggregation input alias | old target naming read support |
25+
| `ours_spectral_filtered_*` | historical reporting tag | old artifact/report parse support |
26+
| diagnostic trace key `spectral_filter_gain_*` | metric field name | old diagnostic field parse support |
2527

2628
## Removed Surface
2729

2830
| Removed | Replacement |
2931
|---|---|
3032
| `spectral_fl` package shim | `graphfl_lab` |
31-
| `run_general_*` | `run_vision_*` |
33+
| `run_general_*` root entrypoints | `run_vision_*` |
3234
| `graphfl_lab/experiments/general/` | `graphfl_lab/experiments/vision/` |
3335
| `graphfl_lab/experiments/suites/general/` | `graphfl_lab/experiments/suites/vision/` |
36+
| `graphfl_lab/strategies/spectral/` facade | `graphfl_lab/strategies/graphfl/` |
37+
| `graphfl_lab/general_*`, `graphfl_lab/cli/general_*` | vision modules and unified runner |
3438
| `general_suite_*` artifact readers/writers | `vision_suite_*` |
3539
| `result_general_*` artifact readers/writers | `result_vision_*` |
40+
| CLI `spectral_filtered_*` choices | `graph_filtered_*` |
41+
| `--spectral-filter-strength` | `--graph-filter-strength` |
3642

37-
## Canonical
43+
## Canonical Reference
3844

39-
세부 migration, compatibility, gate-check contract는 `docs/maintenance/migration-and-compatibility.md`에서 관리한다.
45+
상세 migration, compatibility, removed-surface, golden baseline, serialized asset policy는 `docs/maintenance.md`에서 관리한다.

README.md

Lines changed: 128 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,109 @@
11
# Graph-FL Design Lab
22

3-
Graph-FL Design Lab은 client update와 model state로 client graph를 만들고, matched control graph와 diagnostic metric으로 Graph-FL gain의 원인을 분해하는 실험 framework다.
3+
Graph-FL Design Lab는 Graph-FL gain이 실제 client relation graph에서 오는지 검증하기 위한 실험 framework다. 이 repository는 federated learning 실험, graph construction, matched controls, graph-free controls, diagnostics, Evidence artifact를 한 구조로 묶어 Graph-FL claim을 재현 가능한 표와 수치로 설명한다.
44

5-
핵심 질문:
5+
## Project Overview
6+
7+
Graph-FL 계열 방법은 client 사이의 relation graph를 이용해 aggregation 또는 personalization을 바꾼다. 그러나 성능 향상은 relation graph 자체가 아니라 smoothing, dominance correction, clustering, optimizer 차이에서도 생길 수 있다. 이 repository의 목적은 그 효과를 분리해서 측정하는 것이다.
8+
9+
| 질문 | Repository 기준 답 |
10+
|---|---|
11+
| Graph-FL gain은 어디서 오는가 | `graph_source`, `graph_mode`, `aggregation_target`, `correction_family`를 분리해 비교 |
12+
| real graph가 control보다 의미 있는가 | random, shuffled, uniform, identity, graph-free controls와 같은 artifact row에서 비교 |
13+
| prior work mechanism을 설명할 수 있는가 | FedAMP, SFL, pFedGraph, FedAGA mechanism을 component slot으로 매핑 |
14+
| metric이 해석 가능한가 | `DI`, `N_eff`, alignment, `LOO`, graph stats를 round/client/counterfactual artifact로 기록 |
15+
| framework로 확장 가능한가 | custom source, builder, preset, target이 trace와 artifact contract를 통과하는지 검증 |
16+
17+
핵심 claim:
618

719
```text
8-
Graph-FL gain이 실제 client relation structure에서 오는가,
9-
아니면 dominance, norm, smoothing, optimizer effect로 설명되는가?
20+
Graph-FL gain
21+
= relation-specific effect
22+
+ generic smoothing effect
23+
+ clustering effect
24+
+ dominance/norm correction effect
25+
+ optimizer effect
1026
```
1127

12-
## 핵심 구조
28+
## Repository Contents
29+
30+
| Area | Role | Main Paths |
31+
|---|---|---|
32+
| Graph-FL runtime | graph-aware aggregation과 diagnostics 실행 | `graphfl_lab/strategies/graphfl/`, `graphfl_lab/lifecycle/` |
33+
| graph construction | client state를 relation graph로 변환 | `graphfl_lab/graph/`, `graphfl_lab/designs/` |
34+
| diagnostics/artifacts | metric schema와 CSV/JSON row 작성 | `graphfl_lab/diagnostics/` |
35+
| experiment tracks | vision Non-IID, Cora graph ablation 실행 | `graphfl_lab/experiments/`, `run_experiment.py` |
36+
| Evidence pack | framework validity 검증 | `graphfl_lab/validation/`, `scripts/validation/` |
37+
| configs | tracked experiment presets | `configs/vision/`, `configs/cora/` |
38+
| tests | component, strategy, experiment, validation contract | `tests/` |
39+
| docs/demo | framework 설명, Evidence, repository layout, HTML demo | `docs/`, `docs/demos/graphfl-assembly-scratch.html` |
40+
41+
## Framework Flow
42+
43+
```text
44+
client local training
45+
├── graph_source client state -> representation z_i
46+
├── graph_mode relation score + topology -> adjacency A
47+
├── aggregation_target graph filtering -> update / EMA update / weight
48+
├── correction_family real graph vs matched controls
49+
├── diagnostics DI, N_eff, alignment, LOO, graph stats
50+
└── artifact contract round/client/graph/counterfactual/Evidence rows
51+
```
1352

1453
| Layer | 역할 |
1554
|---|---|
16-
| `graph_source` | client를 update, weight, EMA, classifier head 등으로 표현 |
17-
| `graph_mode` | relation score와 topology 구성 |
18-
| `aggregation_target` | graph를 update, EMA update, weight 등에 적용 |
19-
| `correction_family` | real graph, random, shuffled, uniform, identity, graph-free control 비교 |
55+
| `graph_source` | client를 update, weight, EMA update, classifier-head update로 표현 |
56+
| `graph_mode` | relation score와 topology를 adjacency로 구성 |
57+
| `aggregation_target` | graph filtering을 update, EMA update, weight에 적용 |
58+
| `correction_family` | real graph를 random, shuffled, uniform, identity, clustering-only, graph-free control과 비교 |
2059
| `diagnostics` | alignment, `DI`, `N_eff`, `LOO`, graph metric 기록 |
2160

22-
## Evidence Claim
61+
## Evidence Snapshot
62+
63+
| Evidence Axis | Verdict | Primary Artifact |
64+
|---|---|---|
65+
| construction drift | 18 graph modes pass, max abs diff `2.21e-12`, edge F1 `1.0` | `graph_parity_summary.csv` |
66+
| paper-mechanism alignment | pFedGraph, FedAMP, SFL, FedAGA mapping 5 / 5 rows pass | `external_mechanism_alignment.csv` |
67+
| diagnostic sensitivity | 60 framework diagnostic rows pass | `scenario_manifest.json`, `metric_validity_summary.csv` |
68+
| design-space coverage | 16 sources x 18 modes x 5 targets x 6 correction profiles = 8,640 / 8,640 checks pass | `design_space_matrix.csv`, `design_space_summary.csv` |
69+
| extensibility | custom source, builder, preset, target 4 / 4 contract checks pass | `extension_contract_summary.csv` |
70+
| measurement integrity | real/random/uniform measured nonzero, identity expected-zero control | `real_diagnostic_consistency.csv` |
71+
72+
Evidence의 의미:
2373

24-
| Claim | Evidence |
74+
| Claim | Repository Evidence |
2575
|---|---|
26-
| graph construction 재현성 | `graph_parity_summary.csv`, edge F1, drift |
27-
| paper mechanism 대응 | `external_mechanism_alignment.csv` |
28-
| diagnostic sensitivity | `scenario_manifest.json`, `metric_validity_summary.csv` |
29-
| design-space coverage | `design_space_matrix.csv`, `design_space_summary.csv` |
30-
| extensibility | `extension_contract_summary.csv` |
76+
| graph semantics 보존 | lifecycle assembly와 reference builder drift 비교 |
77+
| paper mechanism 대응 | prior work mechanism을 component slot으로 매핑 |
78+
| metric 해석 가능성 | synthetic expected-direction check와 real/control consistency |
79+
| framework 조합성 | built-in design space 전체 row-level calculation check |
80+
| 확장 가능성 | custom component가 trace, metadata, diagnostics, artifact contract를 보존 |
3181

32-
Framework-quality 근거는 `docs/framework/evidence.md`에 정리한다.
82+
## Primary Artifacts
3383

34-
## 문서 지도
84+
| Artifact | 내용 |
85+
|---|---|
86+
| `round_metrics.csv` | round-level pre/post aggregate, `DI`, `N_eff`, alignment, `LOO` |
87+
| `client_metrics.csv` | client contribution, update norm, alignment |
88+
| `graph_stats.csv` | density, degree, entropy, spectral graph metrics |
89+
| `counterfactual_metrics.csv` | real graph와 control graph gap |
90+
| `metric_validity_summary.csv` | synthetic expected-direction result |
91+
| `design_space_matrix.csv` | source/mode/target/control/diagnostic row validity |
92+
| `extension_contract_summary.csv` | custom component trace와 artifact preservation |
93+
94+
## Main Run Paths
3595

36-
| 문서 | 용도 |
96+
| 목적 | Command |
3797
|---|---|
38-
| `docs/framework/overview.md` | project claim, research position, experiment design |
39-
| `docs/framework/metrics.md` | metric 정의, 수식, diagnostic 해석 |
40-
| `docs/framework/components.md` | lifecycle, interface, extension guide, prior-work mapping |
41-
| `docs/framework/evidence.md` | framework-quality evidence와 provenance |
42-
| `docs/maintenance/migration-and-compatibility.md` | migration, compatibility, gate-check contract |
43-
| `docs/archive/README.md` | archive summary |
98+
| unified runner help | `python run_experiment.py --help` |
99+
| vision single run | `python run_vision_experiment.py --config configs/vision/smoke/default_similarity_knn.json` |
100+
| vision suite | `python run_vision_suite.py --config configs/vision/diagnostic/smoke/default.json` |
101+
| vision stress grid | `python run_vision_stress_grid.py --help` |
102+
| vision client-count sweep | `python run_vision_client_count_sweep.py --help` |
103+
| Cora graph ablation | `python run_graph_ablation.py --config configs/cora/ablations/graph/graph_ablation_smoke.json` |
104+
| Evidence report | `python scripts/validation/graph_evidence_report.py --profile smoke --include-external --out-dir <out-dir>` |
44105

45-
## 설치
106+
## Install
46107

47108
Repository root에서 실행한다.
48109

@@ -51,41 +112,57 @@ Repository root에서 실행한다.
51112
| dependency 설치 | `python -m pip install -r requirements.txt` |
52113
| editable install | `python -m pip install -e .` |
53114

54-
## 검증
115+
## Verification
55116

56117
| Check | Command |
57118
|---|---|
58119
| unit tests | `python -m unittest discover -s tests` |
59120
| vision CLI | `python run_vision_experiment.py --help` |
60121
| suite CLI | `python run_vision_suite.py --help` |
61-
| evidence report | `python scripts/validation/graph_evidence_report.py --profile smoke --include-external --out-dir <out-dir>` |
122+
| Evidence report | `python scripts/validation/graph_evidence_report.py --profile smoke --include-external --out-dir <out-dir>` |
62123

63-
## 주요 실행 경로
124+
## Documentation
64125

65-
| 목적 | Command |
126+
| Document | 내용 |
66127
|---|---|
67-
| vision single run | `python run_vision_experiment.py --config configs/vision/smoke/default_similarity_knn.json` |
68-
| vision suite | `python run_vision_suite.py --config configs/vision/diagnostic/smoke/default.json` |
69-
| Cora graph ablation | `python run_graph_ablation.py --config configs/cora/ablations/graph/graph_ablation_smoke.json` |
128+
| `docs/README.md` | 문서 index |
129+
| `docs/framework.md` | framework claim, lifecycle, components, metric |
130+
| `docs/evidence.md` | framework 정당성 실험, pass criteria, verdict, provenance |
131+
| `docs/research.md` | prior work positioning, design pattern survey |
132+
| `docs/repository.md` | repository tree, package/script/test layout, change routing |
133+
| `docs/maintenance.md` | migration, compatibility, removed surface, golden/asset policy |
134+
| `docs/history.md` | legacy experiment observation, migration phase 기록 |
135+
| `docs/demos/graphfl-assembly-scratch.html` | Graph-FL assembly scratch demo |
70136

71-
## Repository 구조
137+
## Repository Layout
72138

73139
```text
74-
graphfl_lab/
75-
├── designs/ GraphFLDesign registry and presets
76-
├── graph/ graph source, builder, control, diagnostics
77-
├── lifecycle/ lifecycle contracts and traces
78-
├── strategies/graphfl/ Graph-FL runtime strategy
79-
├── diagnostics/ result schema and artifact writers
80-
└── experiments/ vision and Cora orchestration
81-
82-
configs/
83-
├── vision/
84-
└── cora/
85-
86-
docs/
87-
├── framework/
88-
├── research/
89-
├── maintenance/
90-
└── archive/
140+
.
141+
├── graphfl_lab/
142+
│ ├── designs/ GraphFLDesign registry and presets
143+
│ ├── graph/ graph source, builder, control, diagnostics
144+
│ ├── lifecycle/ lifecycle contracts and traces
145+
│ ├── strategies/
146+
│ │ ├── baselines/ graph-free and baseline strategies
147+
│ │ └── graphfl/ Graph-FL runtime strategy modules
148+
│ ├── diagnostics/ result schema and artifact writers
149+
│ ├── experiments/
150+
│ │ ├── vision/ vision single run, suite, stress, sweeps
151+
│ │ ├── cora/ Cora single run and graph ablation
152+
│ │ └── suites/vision/ suite features, variants, reporting
153+
│ └── validation/ Evidence pack validation logic
154+
├── configs/
155+
│ ├── vision/ baseline, diagnostic, probe, smoke, stress, sweep configs
156+
│ └── cora/ graph ablation configs
157+
├── scripts/
158+
│ ├── checks/ preflight, evidence bundle, parity checks
159+
│ ├── validation/ Evidence pack entry points
160+
│ ├── reports/ plot and dashboard helpers
161+
│ └── smoke/ smoke command wrappers
162+
├── tests/ CLI, graph, lifecycle, strategy, experiment, validation tests
163+
└── docs/
164+
├── *.md canonical project documentation
165+
└── demos/ HTML demo artifacts
91166
```
167+
168+
상세 layout과 change routing은 `docs/repository.md`에서 관리한다.

configs/README.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
# Config
22

3+
`configs/`는 tracked experiment preset의 canonical 위치다. Vision track은 `configs/vision/`, Cora graph ablation은 `configs/cora/`를 사용한다.
4+
35
## Canonical Tree
46

57
```text
6-
configs/vision/
7-
configs/cora/
8+
configs/
9+
├── vision/
10+
│ ├── baselines/
11+
│ ├── diagnostic/
12+
│ │ ├── smoke/
13+
│ │ ├── core/
14+
│ │ └── extend/
15+
│ ├── probes/
16+
│ ├── smoke/
17+
│ ├── stress/
18+
│ └── sweeps/
19+
└── cora/
20+
└── ablations/
821
```
922

10-
## Vision Config Group
23+
## Vision Config Groups
1124

12-
| Folder | 용도 |
25+
| Folder | Purpose |
1326
|---|---|
14-
| `configs/vision/diagnostic/smoke/` | 빠른 diagnostic smoke |
15-
| `configs/vision/diagnostic/core/` | 핵심 diagnostic suite |
16-
| `configs/vision/diagnostic/extend/` | 확장 diagnostic 설정 |
17-
| `configs/vision/probes/` | graph/source/target probe |
18-
| `configs/vision/stress/` | Non-IID stress 설정 |
19-
| `configs/vision/sweeps/` | sweep 설정 |
27+
| `configs/vision/diagnostic/smoke/` | quick diagnostic smoke |
28+
| `configs/vision/diagnostic/core/` | core diagnostic suite |
29+
| `configs/vision/diagnostic/extend/` | extension diagnostic configs |
30+
| `configs/vision/probes/` | graph/source/target probes |
31+
| `configs/vision/stress/` | Non-IID stress configs |
32+
| `configs/vision/sweeps/` | sweep configs |
2033

21-
## Cora Config Group
34+
## Cora Config Groups
2235

23-
| Folder | 용도 |
36+
| Folder | Purpose |
2437
|---|---|
2538
| `configs/cora/ablations/` | Cora graph ablation |
2639

2740
## Compatibility
2841

29-
| Legacy | Current |
30-
|---|---|
31-
| `configs/general/...` | `configs/vision/...` path alias |
32-
| `general_suite_*` | `vision_suite_*` |
33-
| `result_general_*` | `result_vision_*` |
42+
| Legacy | Current | Role |
43+
|---|---|---|
44+
| `configs/general/...` | `configs/vision/...` path alias | old path read support |
45+
| `general_suite_*` | `vision_suite_*` | old suite artifact parse support |
46+
| `result_general_*` | `result_vision_*` | old result artifact parse support |
3447

35-
세부 compatibility 정책은 `docs/removed-materials.md`에 기록한다.
48+
상세 compatibility policy는 `docs/maintenance.md`에서 관리한다.

0 commit comments

Comments
 (0)