junidude14 commited on
Commit
1c1f651
·
verified ·
1 Parent(s): edf9c7c

Archive 4 checkpoints (1-4)

Browse files
.gitattributes CHANGED
@@ -87,3 +87,5 @@ paper-releases/pbisc-diffusion/updates/20261003T224927Z-deck-appendix-scsemi-rea
87
  paper-releases/pbisc-diffusion/updates/20261003T224927Z-deck-appendix-scsemi-readout/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
88
  paper-releases/pbisc-diffusion/updates/20261005T133325Z-deck-scratch-samepairs-tracking/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf filter=lfs diff=lfs merge=lfs -text
89
  paper-releases/pbisc-diffusion/updates/20261005T133325Z-deck-scratch-samepairs-tracking/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
 
 
 
87
  paper-releases/pbisc-diffusion/updates/20261003T224927Z-deck-appendix-scsemi-readout/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
88
  paper-releases/pbisc-diffusion/updates/20261005T133325Z-deck-scratch-samepairs-tracking/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf filter=lfs diff=lfs merge=lfs -text
89
  paper-releases/pbisc-diffusion/updates/20261005T133325Z-deck-scratch-samepairs-tracking/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
90
+ paper-releases/pbisc-diffusion/updates/20261005T175437Z-deck-supplementary-other-tissues-review/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf filter=lfs diff=lfs merge=lfs -text
91
+ paper-releases/pbisc-diffusion/updates/20261005T175437Z-deck-supplementary-other-tissues-review/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
paper-releases/pbisc-diffusion/updates/20261005T175437Z-deck-supplementary-other-tissues-review/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:639738f9789b548729b8016fed0c3718d2e78930b4ec1be612861f6d9dacefbf
3
+ size 7341318
paper-releases/pbisc-diffusion/updates/20261005T175437Z-deck-supplementary-other-tissues-review/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21d18b0734f41dd6fefaf7fe837d64c6fe98c23dfab85a251383fb6d4e29e607
3
+ size 8156023
paper-releases/pbisc-diffusion/updates/20261005T175437Z-deck-supplementary-other-tissues-review/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/README.md ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PBISC-Diffusion paper summary deck (2026-09-30, r00; restructured 2026-10-02)
2
+
3
+ 45-slide English summary of the PBISC-Diffusion (Model 8) paper experiments: title, outline, 10 sections, a
4
+ Supplementary block (divider + 3 slides) and an Appendix block (divider + 1 slide). There is no Backup section: every
5
+ main slide sits in the section it supports.
6
+ - The Supplementary block (user decision 2026-10-06) holds the from-scratch (no pretraining) results, which the paper
7
+ puts in its Supplementary. The Discussion framing (a route to other tissues) is the section 10 slide 'Next: other
8
+ tissues from a few dozen pairs'.
9
+ - The Appendix (user decision 2026-10-04) holds only supplementary results that use a modified method and must not be
10
+ read as main evidence. Short keyword lines
11
+ only; the figures carry the results. Every slide that uses a published method, metric or baseline has a one-line
12
+ "References:" footer; full citations are in the speaker notes. Section 10 is planned work.
13
+
14
+ - `PBISC-Diffusion_paper_summary_20260930.pptx`: the deck
15
+ - `PBISC-Diffusion_paper_summary_20260930.pdf`: LibreOffice PDF of the deck
16
+ - `data/slides_spec.json`: slide order, titles, keywords, footnotes, references, speaker-note text
17
+ - `generate_deck.py`: builds the pptx from `data/slides_spec.json` only (python-pptx)
18
+ - `figures/`: exactly the figures the slides show (PNG + PDF), made by `tools/sec*.py`. Intermediate panels go to a
19
+ temporary folder; superseded figures are deleted, not kept (2026-10-02, user request; every deleted file was
20
+ checked to be in the paper archive by sha256 first).
21
+ - `data/sec*.csv` and `data/*_slide_text.json`: every plotted or quoted number with its source path
22
+ - `render/`: PDF and 70-dpi slide JPGs for checking
23
+
24
+ ## Slide order
25
+
26
+ | section | slides |
27
+ |---|---|
28
+ | 1 Model overview | bulk in, cells out; denoiser |
29
+ | 2 Backbone | SDD → PBISC-Diffusion; bulk conditioning |
30
+ | 3 Architecture ablation | width & context (loss, benchmark); gene panel |
31
+ | 4 Metrics + SLE benchmark | **how we score generated cells** (metric table with references); SLE benchmark; per cell type; bulk broadcast baseline |
32
+ | 5 Real bulk vs pseudobulk | input shift; same shift in three cohorts; cells off-manifold; disease direction flips |
33
+ | 6 Paired fine-tuning | method; evaluation design |
34
+ | 7 LoRA ablations | full vs LoRA vs cond.-encoder-only; LoRA rank r = 4 / 16 / 64; K diversification |
35
+ | 8 Pairs needed | composition / coverage / steps (with scSemiProfiler at the same n); donor and disease signal; pairs from other cohorts; longer training on them (with training minutes) |
36
+ | 9 Paired validation | cohorts; 5 donors: cells, realism beyond P/C, P/C at k = 3 / 5 / 10, scSemiProfiler copies its representative, disease signal, CAT curves, time to apply; 5-fold CV (with scSemiProfiler on the same pairs); same training pairs: LoRA vs scSemiProfiler; 5-fold realism metrics |
37
+ | 10 Next steps | paired-subset cohorts (planned); other tissues from a few dozen pairs (Discussion framing of the from-scratch results) |
38
+ | Supplementary | no pretraining: same cohort, from scratch (pilot); no pretraining: other cohorts, from scratch (pilot); rare states: from scratch vs pretrained |
39
+ | Appendix | scSemiProfiler without its output threshold (sensitivity; modified read-out, not the official output) |
40
+
41
+ ## Rebuild
42
+
43
+ Everything is CPU only; no GPU or checkpoint is touched.
44
+
45
+ ```bash
46
+ # prerequisites (plan folder plans/paired_finetune_intradataset_20260927/, CPU):
47
+ # scsemi/tools/representative_dependence.py -> scsemi/analysis/representative_dependence_20261002/
48
+ # tools/contrast_extra.py (+ tools/contrast_extra_tables.py) -> scores_contrast/ (Spearman, ceiling, limma, CAT, RBO)
49
+ # tools/build_tpm_zeroshot.py + tools/score_tpm_zeroshot.sh -> scores/<ds>/zeroshot_tpm_20261002/pooled/
50
+ # (the length-corrected zero-shot arm needs one GPU sampling step: tools/sample_lockwait.sh, coordinator only)
51
+ cd /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00
52
+ # shared helpers, not run directly: style.py, sec03_common.py, scsemi_results.py, fold_sizes.py
53
+ for f in sec01_overview sec02_backbone sec03_width_loss sec03_width_bench sec03_panel \
54
+ sec04_metrics_overview sec04_sle_benchmark sec05_condition_space sec05_cells_offmanifold \
55
+ sec05_behcet_direction sec05_shift_cohorts sec06_finetune_method sec07_ft_modes \
56
+ sec07_k_aug sec07_rank_sweep sec08_pairs_needed sec08_cross_cohort sec09_paired_validation sec09_extra_metrics \
57
+ sec09_time_to_apply sec09_scsemi_representative sec09_cat_curves sec10_paired_subset_cohorts \
58
+ secA_scsemi_readout sec07_no_pretraining sec08_cross_scratch sec09_same_pairs \
59
+ secS_scratch_rare_states sec10_other_tissues; do # sec10_other_tissues reads secS output: keep the order
60
+ python3 "tools/$f.py" || break
61
+ done
62
+ python3 tools/sync_sec09_text.py # copy every generated slide text (sec09_index / text_source) into the spec
63
+ python3 generate_deck.py # -> PBISC-Diffusion_paper_summary_20260930.pptx
64
+ soffice --headless --convert-to pdf --outdir render PBISC-Diffusion_paper_summary_20260930.pptx
65
+ pdftoppm -jpeg -r 70 render/PBISC-Diffusion_paper_summary_20260930.pdf render/slide
66
+ cp render/PBISC-Diffusion_paper_summary_20260930.pdf .
67
+ ```
68
+
69
+ `generate_deck.py` stops with an error if a figure is missing, a title does not fit on one line, a footnote needs
70
+ more than 2 lines (1 line when the slide has references), the reference line needs more than 1 line, or any text
71
+ contains Korean or placeholder words. `tools/restructure_20261002.py` is the one-off script that produced the current
72
+ slide order and the references (it refuses to run twice).
73
+
74
+ ## Notes
75
+
76
+ - **No "all" label (2026-10-02).** The 5-fold arm trains each fold model on the other four folds minus 7–8
77
+ inner-validation donors; its test fold is never trained on (RUN.json `test_rows_never_loaded_for_training`). Figures
78
+ label it "5-fold CV (other 4 folds)" and learning-curve ticks show the training-pair count per fold (78–79 ImMicro,
79
+ 58–59 sepsis), read by `tools/fold_sizes.py`.
80
+ - **Learning curve x = 0 uses no pairs (2026-10-02).** It shows the zero-shot model fed the real bulk as measured
81
+ and after exon-length correction (counts / Ensembl union-exon kb, then the same fixed-depth arithmetic;
82
+ `plans/.../tools/build_tpm_zeroshot.py`, scored in `scores/<ds>/zeroshot_tpm_20261002/pooled`). The old x = 0
83
+ calibration point, whose alpha used every training pair of the fold, is gone; calibration appears only fitted on the
84
+ same n pairs as the LoRA point (squares; `cal_budget_20261001`).
85
+ - **Disease metrics (2026-10-02).** Next to Pearson logFC r and the Welch top-50 DEG overlap: Spearman r, the
86
+ split-half ceiling (observed vs observed, Spearman–Brown), limma-voom top-50 DEG, each arm's chance overlap, and
87
+ CAT curves with the k / 2G chance line (`plans/.../scores_contrast/`, tools/contrast_extra.py; every Pearson r and
88
+ Welch count reproduced exactly). Repeated samples of one patient (Imperial, Giroux, Ji) count as separate samples in
89
+ both DE tests, as in the scorer (footnote).
90
+ - Section 9 text is generated: `tools/sec09_paired_validation.py`, `sec09_extra_metrics.py`, `sec07_rank_sweep.py`,
91
+ `sec09_time_to_apply.py`, `sec09_scsemi_representative.py`, `sec09_cat_curves.py` write slide text JSON; sync copies
92
+ it. Hand-written: the keywords of the two "Pairs needed" slides (section 8) and of every slide in sections 1–7 and 10.
93
+ - Giroux's disease metrics exclude 196 sex-linked genes (severity is confounded with sex), from
94
+ `plans/.../scores_nosex/`. The calibration comparator is "Zero-shot + calibration" (user decision 2026-10-01).
95
+ - Story rule (user decision 2026-09-30): no PBISC-VAE and no reference calibration (refcal). The exon-length-corrected
96
+ input is used only as the no-pair x = 0 point of the learning curve (user decision 2026-10-02).
97
+ `tools/sec04_immicro.py` (refcal vs scSemiProfiler on ImMicro) is kept but is not part of the deck or the rebuild.
98
+ - scSemiProfiler 5-fold and equal-budget results are picked up automatically when they appear (`tools/scsemi_results.py`;
99
+ arm `scsemi__raw` in `scores/<cohort>/scsemi_cv_20261002/pooled*/`, `scsemi_n{5,10,20,40}__raw` in
100
+ `scores/<cohort>/scsemi_budget_20261002/pooled*/`; same donors and reference cells as the main pooled call only).
101
+ Then rerun sections 8 and 9, sync, recheck the section 8 keywords and rebuild.
102
+ - Earlier versions: `_archive/2026-09-30_before_no_vae_refcal/`, `_archive/2026-10-01_before_extra_metrics/`,
103
+ `_archive/2026-10-02_before_time_to_apply/`, `_archive/2026-10-02_before_restructure/` (pptx, PDF, spec; their
104
+ figures are in the paper archive). `DRAFT_1150_*`: the copy shown at the 2026-09-30 12:00 meeting.
105
+
106
+ - Added 2026-10-03 (user decision: the cross-cohort experiment is reported at K = 1000 only and is the figure that explains
107
+ why PBISC fits LoRA on a few pairs of each cohort): slides 25-26 in section 8, `tools/sec08_cross_cohort.py`.
108
+ - Slide 25 "Pairs from other cohorts do not transfer": per held-out cohort, composition L1 / coverage / disease logFC r of
109
+ zero-shot, calibration fitted on the other cohorts, LoRA r16 / r64 / full fine-tune trained on the other cohorts
110
+ (+ Liu 2021) at step saturation, and LoRA on the cohort's own pairs (5-fold pooled).
111
+ - Slide 26 "Longer training on other cohorts" (": gap stays" since 2026-10-06): the same metrics at every 20k-step
112
+ milestone.
113
+ - Source plan: `plans/paired_crosscohort_20261002/` (README; same-reference and same-sample checks in the script).
114
+ Agenda item 8 now reads "How many pairs, and do other cohorts' pairs transfer". The deck has 37 slides.
115
+ Pre-update copy: `_archive/2026-10-03_before_cross_cohort/`.
116
+
117
+ ## Sources
118
+
119
+ Final model: `runs/f01_6k_1x_seed20260627` (epoch 16, EMA). Scores and receipts come from
120
+ `plans/utility_studies_final6k_20260925/`, `plans/paired_finetune_intradataset_20260927/`,
121
+ `plans/immicro_scsemi_comparison_20260927/`, `plans/floor01_campaign_20260923/`,
122
+ `analysis/scsemi_benchmark_diffusion_20260913/` and the run folders named in each `data/sec*.csv`. Reference PDFs:
123
+ `/home/sj_server_1/PBISC/paper-release-20260928/reference-papers/` (INDEX.md). Manuscript:
124
+ `/home/sj_server_1/PBISC/paper-release-20260928/manuscript/`.
125
+ - 2026-10-04 appendix (user decision: supplementary, appendix only, because it changes scSemiProfiler's official
126
+ output). Slide 38 is the divider "Appendix" and slide 39 is "Appendix: scSemiProfiler without output threshold"
127
+ (`tools/secA_scsemi_readout.py`, `data/secA_scsemi_readout{.csv,_slide_text.json}`).
128
+ - Inputs: `plans/paired_finetune_intradataset_20260927/scsemi/analysis/output_variants_20261003/`. The script checks
129
+ that its LoRA-5 and official scSemiProfiler values equal the section 9 slide data draw by draw.
130
+ - Result: without upstream's output threshold, scSemiProfiler's coverage rises in 5/5 cohorts, and 23/23 LoRA-5
131
+ comparisons (coverage, precision, composition, logFC r, DEG) keep their winner.
132
+ - The outline keeps its 10 sections (the builder requires 10). The pre-change copy is in
133
+ `_archive/2026-10-04_before_appendix/`. The deck has 39 slides.
134
+ - 2026-10-05 update (user request: put the results so far into the deck). Pre-change copy: `_archive/2026-10-05_before_scratch_cv/`.
135
+ - New slide 23, "No pretraining: same cohort, from scratch" (`tools/sec07_no_pretraining.py`). Pilot on sepsis fold 0
136
+ (17 donors). Reads `fold0_scratch_20261005/` and the runs' RUN.json. The donor composition r is recomputed from
137
+ per_donor.csv and reproduces ablation_extra_donor.csv.
138
+ - New slide 28, "No pretraining: other cohorts, from scratch" (`tools/sec08_cross_scratch.py`). Held-out sepsis pilot.
139
+ Every arm is read from `paired_crosscohort_20261002/scores_masked/`: genes no training cohort measured are zeroed
140
+ in all arms, because the unmasked scratch arm puts 91–94 % of its UMI there (read from the generated_masked logs
141
+ since 2026-10-06).
142
+ - New slide 38, "Same training pairs: LoRA vs scSemiProfiler" (`tools/sec09_same_pairs.py`). scSemiProfiler 5-fold
143
+ CV with LoRA's own training pairs, plus GPU hours per fold from the receipts on either host. Cohorts that are still
144
+ running show "in progress"; rerun the script as they finish.
145
+ - These two slides now draw the scSemiProfiler CV / budget runs automatically:
146
+ - Slide 24, "Pairs needed" (diamonds; ImMicro so far): keyword 2 reworded, footnote extended.
147
+ - Slide 37, "5-fold CV" (yellow bar; ImMicro and Ji so far).
148
+ - `tools/sec09_paired_validation.py` reads the scSemiProfiler CV arm's Spearman / limma values from
149
+ `scores_contrast/<cohort>/scsemi_cv_20261002/pooled/` (contrast_extra.py --design scored). Pearson r and the Welch
150
+ DEG must match the scorer; the values stay blank until computed. Cohorts not yet run say "in progress".
151
+ - Agenda item 7 now reads "LoRA: compute, rank, K; training from scratch". The deck has 42 slides.
152
+ - New helper: `tools/grouped_bars.py`.
153
+ - 2026-10-06 update (user request: check that the cross-cohort LoRA / full FT, cross-cohort from-scratch and
154
+ same-cohort from-scratch (+ recipes) results, with benchmarks and training times, and the scratch-vs-pretrained rare
155
+ states are in the deck; user decision: the from-scratch results go to the paper's Supplementary and the Discussion
156
+ presents them as a route to other tissues). Pre-change copy: `_archive/2026-10-06_before_supplementary/`.
157
+ - **Supplementary block (new divider, slides 40-43).**
158
+ - "No pretraining: same cohort, from scratch" and "No pretraining: other cohorts, from scratch" moved here from
159
+ sections 7 and 8. Their content is unchanged; slide 42's notes now name the cross-cohort slides by title.
160
+ - New "Rare states: from scratch vs pretrained" (`tools/secS_scratch_rare_states.py`).
161
+ - It reads the rare-state screen (`plans/rare_states_screen_20261004/out/sepsis_fold0_*` and
162
+ `sepsis_loco_masked_*`).
163
+ - The cross-cohort arms use the masked scoring (46 never-measured genes zeroed in every arm).
164
+ - The donor bootstrap reproduces the verified analysis in `out/scratch_vs_lora_20261005/REPORT.md`.
165
+ - **Section 10 "Next steps".**
166
+ - New "Next: other tissues from a few dozen pairs" (`tools/sec10_other_tissues.py`): a comparison table, pretrained
167
+ + LoRA vs from scratch.
168
+ - Every value is read from the deck's own source tables. The say text is the user's Discussion framing.
169
+ - **Slide 26 "Longer training on other cohorts".** The first keyword is now training minutes to saturation (RUN.json
170
+ wall seconds), with per-cohort minutes and steps in the notes (`tools/sec08_cross_cohort.py`).
171
+ - **Slide 34 "5 donors: time to apply".**
172
+ - The pretraining hours are read from `data/sec06_ft_method.csv`, no longer hard-coded.
173
+ - The note names the 'Fine-tuning with paired bulk + sc' slide by title. Its old "slide 15" pointed at the wrong
174
+ slide.
175
+ - Agenda items 7 and 10 updated. Spec change: `tools/restructure_20261006.py` (refuses to run twice). The deck has 45
176
+ slides; no Korean text.
177
+ - **Review pass (same day).** An independent 5-agent review of the changed slides confirmed 39 issues; all are
178
+ fixed. Pre-review copies of the touched scripts and the spec: `_archive/2026-10-06_before_supplementary/*.pre_review`.
179
+ - Slide 39: pretraining now reads 33.1 M train cells (`train_split_cells`; the 41.4 M corpus includes val/test).
180
+ The rare-state row follows the bootstrap verdicts on both sides (closer on ISG-high T / on DN2 B; labels and
181
+ states both arms miss by > 4-fold are not counted). "No corpus" became "come close": the scratch runs still took
182
+ the panel, value scaler and z-score constants from the PBMC checkpoint (RUN.json `kept_from_checkpoint`, now in
183
+ the notes). The say text carries the one-fold pilot qualifier; the footnote names both pilots.
184
+ - Slide 43: "no significant difference on average" (not "no difference"). Keyword 2 is the cycling T/NK count
185
+ (8 of 8 comparisons). The notes add the ISG-high T split by panel, the scratch-closer states (DN2 B, MS1), the
186
+ 52-call tally, the fold-0 caveat (fold 0 is the own-pair LoRA's best fold for C1Q-high and cycling T/NK,
187
+ computed from `folds.csv`), label states unthinned, and "8 of 13 states shown".
188
+ - Slide 26: title "...: gap stays" and "drifts in Sepsis and Ji" are computed from the milestones (gap = no milestone
189
+ reaches the own-cohort coverage; drift = full fine-tune L1 up by >= 0.05). Minutes are in
190
+ `data/sec08_cross_cohort.csv` (wall_seconds, minutes, run_receipt) and in the numbers list.
191
+ - Slide 42: UMI share (94 %, 91–94 % across milestones), the observed share (0.014 %, from `cells_panel6k.npz`)
192
+ and both arms' stopping settings are read from the receipts; the "none" label sits inside the axes.
193
+ - Slide 34: keywords use the cohort means of the figure (17–59×, 57 min–4.1 h); the per-draw range 11–63× is in the
194
+ notes. The right panel shares the bars' rows and has a title.
195
+ - Talk text and pointers: slides 23, 25, 26, 45 (say), 22 (recipes description), 32 and 36 (slide pointers by
196
+ title), slide 1 subtitle "updated 2026-10-06".
paper-releases/pbisc-diffusion/updates/20261005T175437Z-deck-supplementary-other-tissues-review/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/tools/build_archive_request.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Archive-maintenance request for the paper summary deck (PBISC-Diffusion paper, pbisc-diffusion).
3
+
4
+ Follows paper-release-20260928/maintenance/POLICY.md. Payloads: the deck (pptx + PDF, final and the frozen
5
+ 12:00 draft), its builder, section figure scripts, figures, the number tables every figure and quoted value
6
+ reads, the slide spec and the copied server_2 run-status snapshots used for the loss curves.
7
+ Not uploaded: data/refs (third-party paper text and upstream SDD code kept only for checking the backbone
8
+ table) and render/ (contact-sheet JPGs; the PDF is the rendered record).
9
+
10
+ Optionally merges another request (for example the paired fine-tuning request) so both go out as one delta.
11
+ usage: build_archive_request.py OUT.json [OTHER_REQUEST.json]
12
+ """
13
+ from __future__ import annotations
14
+
15
+ import glob
16
+ import json
17
+ import sys
18
+ from pathlib import Path
19
+
20
+ D = Path(__file__).resolve().parents[1]
21
+
22
+
23
+ def files(patterns):
24
+ out = set()
25
+ for p in patterns:
26
+ for f in glob.glob(str(D / p), recursive=True):
27
+ q = Path(f)
28
+ if q.is_file() and not q.is_symlink() and "__pycache__" not in q.parts:
29
+ out.add(str(q))
30
+ return sorted(out)
31
+
32
+
33
+ def main(out: str, other: str | None = None) -> int:
34
+ assets = []
35
+
36
+ def add(paths, kind):
37
+ for p in paths:
38
+ assets.append({"host": "server_1", "source": p, "kind": kind, "state": "completed"})
39
+
40
+ add(files(["*.pptx", "*.pdf"]), "report")
41
+ add(files(["README.md"]), "document")
42
+ add(files(["generate_deck.py", "tools/*.py"]), "code")
43
+ add(files(["figures/*.png", "figures/*.pdf", "figures/*.svg"]), "figure")
44
+ add(files(["data/*.csv"]), "table")
45
+ add(files(["data/*.json"]), "config")
46
+ add(files(["data/sec03_server2_snapshots/**/*.json"]), "log")
47
+ req = {
48
+ "project_id": "pbisc-diffusion",
49
+ "summary": (
50
+ "Paper summary deck 2026-09-30 (presentations/2026-09-30--paper-summary--r00): English slides over the ten "
51
+ "paper sections plus Supplementary and Appendix blocks (slide list in README.md). Deck, PDF, frozen 12:00 "
52
+ "draft, builder, figure scripts, figures and every plotted/quoted number table. CPU only; no new "
53
+ "checkpoint or inference."),
54
+ "assets": assets,
55
+ "inference_locations": [],
56
+ }
57
+ if other:
58
+ o = json.loads(Path(other).read_text())
59
+ assert o["project_id"] == "pbisc-diffusion"
60
+ req["summary"] = req["summary"] + " || " + o["summary"]
61
+ req["assets"] += o["assets"]
62
+ req["inference_locations"] += o.get("inference_locations", [])
63
+ Path(out).write_text(json.dumps(req, indent=1))
64
+ kinds = {}
65
+ for a in req["assets"]:
66
+ kinds[a["kind"]] = kinds.get(a["kind"], 0) + 1
67
+ print(json.dumps({"assets": len(req["assets"]), "by_kind": kinds,
68
+ "locations": len(req["inference_locations"])}, indent=1))
69
+ return 0
70
+
71
+
72
+ if __name__ == "__main__":
73
+ sys.exit(main(*sys.argv[1:3]))