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
47108Repository 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 ` 에서 관리한다.
0 commit comments