CodeSampleX

Beispiel

Configure joblib parallel execution with parallel_config and verify backend constraint resolution, nested context propagation, and failure modes on contradictory settings.

sha256:358ff91d26968481475e6fb33480225b3c25f6adba6d6bb2170118ee39c4a2de

Veröffentlichungsstatus. LOCAL_PASS bestand nur in der Umgebung des Autors; PUBLISHED ist öffentlich und wartet auf unabhängige Prüfung; CROSS_PASS wurde von einem anderen Prüfer reproduziert; MATRIX_PASS bestand in unterschiedlichen Umgebungen; STABLE hält unabhängige Erfolge ohne aktuelle Fehlschläge. Belegstärke. L0 bedeutet nur Quelltext; L1 aufgelöste Abhängigkeiten; L2 Kompilierung oder Laden; L3 einen bestandenen Vertragstest; L4 unabhängige Reproduktion; L5 Erfolge in unterschiedlichen Umgebungen. MIT-0

Ausführungsbelege

Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.

Beleggrundlage
Unabhängige Kreuzprüfung
Verifizierungsbelege
2
Verifizierungsstufe
L4_CROSS_PASS
Deklarierte Umgebung python linux x64 python python pip

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-19
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-19

Fall

HOW
Ziel
Configure joblib parallel execution with parallel_config and verify backend constraint resolution, nested context propagation, and failure modes on contradictory settings.
Pakete
Symbole
  • joblib.parallel_config
  • joblib.Parallel
  • joblib.delayed
  • joblib.parallel.get_active_backend
Umgebung
python
Erstellt
2026-08-19T13:42:06Z

Contract

  1. Setting prefer='threads' in parallel_config with n_jobs=4 switches to ThreadingBackend but silently resets implicit n_jobs in context to 1, while explicit backend='threading' preserves n_jobs=4.
  2. Explicitly passing n_jobs=4 to Parallel overrides the thread fallback reset back to 4.
  3. Setting require='sharedmem' without an explicit backend forces ThreadingBackend and resets implicit n_jobs to 1.
  4. Contradictory settings prefer='processes' and require='sharedmem' raise ValueError on Parallel instantiation.
  5. Instantiating Parallel(backend='multiprocessing', require='sharedmem') raises ValueError, whereas configuring the same settings under parallel_config silently downgrades to ThreadingBackend and resets n_jobs to 1.
  6. Nested parallel_config scopes override configuration parameters within their block and restore outer context settings upon exit.
  7. Passing backend constructor parameters such as inner_max_num_threads without an explicit backend raises ValueError at context entry.
  8. Passing an unregistered backend name to parallel_config raises ValueError immediately at context entry.

Dateien

  • NOTES.md
  • csx.json
  • requirements.txt
  • test/contract.py

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

csx-seed