GiNaC term order of printed closed forms is not reproducible across processes

Aperta
#554 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start in LKlinke/prodigy-ginac-bindings at the closed-form printing path and use the distribution_header and Tracer.snapshot workarounds referenced from #553 to identify order-dependent behavior. Add or adapt a test that prints the same expression in two fresh processes with different PYTHONHASHSEED values and compares the text. The change is complete when output is independent of hash seed and prior computations, and the call-order workarounds are removed or reworded.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: engines priority: low topic: engine consistency

Found in #553 (exists on main).

GiNaC's term order in printed closed forms depends on the hash seed and on what the process computed before, since GiNaC's symbols are shared within a process. Two fresh runs of main print 17_die_even_invariant with different term orders. The values are the same; only the text of closed forms differs.

Consequences:

  • A byte comparison of GiNaC output (golden and JSON comparisons in refactoring PRs) needs PYTHONHASHSEED=0 and a fresh process per program.
  • Users can see the same result printed differently between runs.
  • A refactoring that only reorders engine calls changes the printed output (#553 had to restore the call order in distribution_header and Tracer.snapshot).

The fix belongs in LKlinke/prodigy-ginac-bindings (a canonical print order), not in Prodigy.

Done when

  • The printed form of a GiNaC closed form is the same across processes and hash seeds, and independent of earlier computations in the process.
  • A test in the bindings (or in Prodigy's engine tests) prints the same expression in two fresh processes with different hash seeds and compares the text.
  • Prodigy's workarounds that depend on the call order (the comments in distribution_header and Tracer.snapshot from #553) are removed or reworded.
Lingua principale
Python
Stelle
6
Fork
2
Merge medio
1h 52m
PR unite (30g)
187

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LKlinke/Prodigy

Tutte le issue di LKlinke/Prodigy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.