Skip to content

fix(rl_3,#2298): chemins machine committés — Monitor cell 18, truncate_last_traj cell 20, stdout relatif cell 25 (re-exec end-to-end) - #11097

Merged
myia-ai-01 merged 1 commit into
mainfrom
fix/rl3-machine-paths
Aug 15, 2026
Merged

myia-ai-01 merged 1 commit into
mainfrom
fix/rl3-machine-paths

Conversation

@jsboige

@jsboige jsboige commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Grain: MED/notebook-python — lane myia-po-2026:CoursIA-2 — prev: META/ledger #11044

Summary

Fix des chemins machine committés dans MyIA.AI.Notebooks/RL/rl_3_experience_replay_dqn.ipynb (finding DEFECT-ALIVE #2298 du triage #11044, suivi #11096). Source-fix + re-exec end-to-end (rule 6 — aucun hand-edit d'output).

  1. cell 18 : wrapper Monitor(env) sur l'environnement d'évaluation DDPG (pattern identique à la cellule 13 pour SAC) → le UserWarning SB3 evaluation.py:71 (chemin site-packages C:\ProgramData\...) disparaît.
  2. cell 20 : load_replay_buffer(..., truncate_last_traj=False) → le UserWarning her_replay_buffer.py:394 (chemin site-packages, apparu sous sb3 2.8.0a2) disparaît ; la dernière trajectoire du pkl est conservée entière.
  3. cell 25 : capture du stdout du logger VecVideoRecorder (contextlib.redirect_stdout) qui imprimait Saving video to D:\dev\CoursIA\... + affichage d'un chemin relatif reproductible (videos/sac-parking-step-0-to-step-500.mp4).

Validation (post-fix, relancée sur la branche)

  • Papermill end-to-end SUCCESS (35/35 cellules, kernel python3, sb3 2.8.0a2), 0 erreur.
  • 0 chemin machine (C:\ / D:\ / site-packages) dans les outputs (scan regex sur tout le notebook).
  • 0 erreur volontaire (grep raise NotImplementedError|assert False|1/0).
  • execution_count int sur les 13 cellules code + outputs cohérents (C.2) ; AST parse OK.
  • validate_pr_notebooks.py : 1/1 PASS. scan_cell_ordering.py : 0 finding.
  • Valeurs numériques fraîches (C.4-E, stochasticité non-seedée — le notebook ne porte aucune claim quantitative) : SAC -56.64 ± 22.18, DDPG -15.83 ± 2.29 (main : -52.48 ± 37.83 / -77.66 ± 93.37).

Tests

  • validate_pr_notebooks.py : 1/1 PASS
  • scan_cell_ordering.py : 0 finding (aucune cellule ajoutée/supprimée)
  • Scan chemins machine : 0 hit

See #11044 · See #11096

source-fix + re-exec end-to-end (rule 6, no output hand-edit):
- cell 18: Monitor wrapper on DDPG eval env (removes evaluation.py:71 UserWarning)
- cell 20: load_replay_buffer truncate_last_traj=False (removes her_replay_buffer.py:394 UserWarning)
- cell 25: capture VecVideoRecorder stdout, print relative video path

See #11044, See #11096

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NanoClaw] structural review — fix(rl_3,#2298) chemins machine committés — Monitor cell 18, truncate_last_traj cell 20, capture vidéo cell 25

Notebook au head lu firsthand (220 KB, 35 cells, 13 code). Re-exec réelle prouvée, pas un hand-edit : metadata papermill end_time 2026-08-15T18:40:05, duration 713.9s (~12 min — cohérent avec un entraînement DDPG+SAC+évals vidéo), exception: null, ec int sur les 13 cellules code [1..13] 0 null.

Les 3 fixes vérifiés cellule-par-cellule au head :

  1. cell 18 : eval_env = Monitor(env) avant evaluate_policy du DDPG — l'output contient bien « Wrapping the env with a Monitor wrapper » et 0 UserWarning site-packages (le fix cause-level élimine le warning evaluation.py:71 au lieu de le masquer). Pattern symétrique de la cellule 13 (SAC) confirmé.
  2. cell 20 : load_replay_buffer(..., truncate_last_traj=False) — 0 warning her_replay_buffer.py:394, et le commentaire in-source documente honnêtement le choix (conserver la dernière trajectoire entière).
  3. cell 25 : contextlib.redirect_stdout(io.StringIO()) autour de record_video + affichage d'un chemin relatif (videos/sac-parking-step-0-to-step-500.mp4) — la barre de progression frame_index survit (tqdm → stderr), le chemin machine D:\dev\… a disparu.

Outputs réels, pas falsifiés : rewards non-ronds et différenciés (DDPG -15.83 ± 2.29, SAC -56.64 ± 22.18), ep_rew_mean progressant de -48 à -37.5 sur ~31 épisodes avec fluctuations irrégulières (-51.7, -50.2, -48.8, -47.3…) — signature d'un vrai entraînement, impossible à fabriquer de façon plausible.

Leak scan notebook entier : 0 [A-Za-z]:\\, 0 site-packages, 0 C:\Users/C:\ProgramData/D:\dev, 0 secret-shaped, 0 CJK.

△ 1 nit (non-bloquant) : la barre tqdm frame_index 0%|…| 501/501 en output cell 25 reste du bruit visuel committé (5 lignes de progression) — le redirect_stdout capture stdout mais tqdm écrit sur stderr ; un disable_tqdm ou filtrage l'aurait aussi nettoyée. Cosmétique, pas un leak.

△ Caveat : pas de runtime SB3 local — vérification statique du notebook committé (sources + outputs + papermill) ; le body cite papermill 35/35 SUCCESS sb3 2.8.0a2, cohérent avec la metadata lue. Trust CI si divergence.

LGTM : les 3 chemins-machine éliminés à la source (rule 6 : source-fix + re-exec, 0 hand-edit d'output — les timestamps et duration papermill le prouvent), outputs d'entraînement authentiques, hygiène leak totale.

@github-actions github-actions Bot added pedagogy-density-below-threshold A modified notebook measures below the 1200 chars-of-prose-per-code-cell floor (#10479) machine-dep-timing-delta: 0 (1 files) labels Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

G-VAR-2/3 GENRE signals (advisory, non bloquant, #10020).
La lane `myia-po-2026:CoursIA-2` voit ces signaux actifs sur les mergees du jour (UTC 2026-08-15) :

G-VAR-2 plafonne a max(1, grains_mergees_du_jour // 3) LIGHT par lane et par jour, toutes categories LIGHT confondues -- un RATIO, pas un plafond plat ; le cap calcule du jour est dans le tally ci-dessus. G-VAR-3 interdit deux genres LIGHT consecutifs. Les signaux ci-dessus rendent le fait VISIBLE (labels variation-tier-inflation, `variation-genre-run`, `variation-genre-cap-exceeded`, `variation-genre-mismatch`) -- la decision de merge reste au coordinateur.

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 12
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@github-actions

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 5.7s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 4.3s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 3.9s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 5.0s
Search-1-StateSpace.ipynb ✅ SUCCESS 3.8s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.9s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 26.6s
GameTheory-4c-NashExistence-Python.ipynb ✅ SUCCESS 3.6s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@myia-ai-01
myia-ai-01 merged commit 28bf684 into main Aug 15, 2026
54 checks passed
@jsboige
jsboige deleted the fix/rl3-machine-paths branch September 2, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

machine-dep-timing-delta: 0 (1 files) pedagogy-density-below-threshold A modified notebook measures below the 1200 chars-of-prose-per-code-cell floor (#10479)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants