Перейти к содержанию

Тесты

Тесты лежат по пакетам, которые проверяют. Группа запускается своим каталогом, без всего набора.

pytest tests/cnn_neat/evolution -q
pytest tests/cnn_neat/forward_cache -q
pytest tests/apps/neat_studio/progress -q
pytest tests/scripts/ablation -q

Корень: tests/cnn_neat/ (библиотека; gap/ — ещё не разнесённые coverage-файлы), tests/apps/neat_studio/, tests/apps/neat_lab/, tests/apps/study_bot/, tests/scripts/. Фикстуры Studio — только в tests/apps/neat_studio/conftest.py. Общие пути — tests/support.py.

NEAT Studio

pip install "cnn-neat[studio,dev]". Data-layer тесты headless; виджеты — @pytest.mark.qt + QT_QPA_PLATFORM=offscreen.

Порог: строго больше 90% и по строкам, и по ветвям (не комбинированный fail_under).

$env:QT_QPA_PLATFORM="offscreen"
pytest tests/apps/neat_studio --cov=apps.neat_studio --cov-branch --cov-report=term-missing --cov-report=json:coverage_studio.json --tb=short
python scripts/ci/check_coverage_thresholds.py coverage_studio.json --include-prefix apps/neat_studio/

Библиотека cnn_neat

pytest tests/cnn_neat tests/scripts -m "not slow and not qt" --cov=cnn_neat --cov-branch --cov-report=term-missing --cov-report=json:coverage_cnn_neat.json --tb=short
python scripts/ci/check_coverage_thresholds.py coverage_cnn_neat.json --include-prefix cnn_neat/

CI (лимит GitVerse — 15 минут на job, timeout-minutes: 15):

  • .gitverse/workflows/tests.yaml — группы tests/cnn_neat и tests/scripts, кроме @pytest.mark.slow и @pytest.mark.qt. Порог 90% печатается; ветви библиотеки пока ниже порога и шаг не роняет job.
  • .gitverse/workflows/studio.yaml — tests/apps/neat_studio, затем Lab, бот и общий GUI. Порог Studio 90% обязателен.
  • .gitverse/workflows/lint.yaml — ruff check cnn_neat apps. Правила в pyproject.toml: pycodestyle, pyflakes, isort, pyupgrade, bugbear, simplify, comprehensions, return, Ruff. Не проверяются длина строки, кириллица, zip(strict=), try/except/pass в горячих путях и ложные замыкания цикла.

Фикстуры: tests/fixtures/studio/.

Новые / исследовательские модули

Модуль Что проверяет
test_breeding_cone.py RAM cap, serve, prefetch, MP shards
test_mutation_candidates.py Легальные множества, output-last-layer
test_forward_cache.py / _planned / _reclaim_policy / _park_restore / _streaming_elite Merkle, уникальный промах (unique-miss), park, elite commit
test_structure_cache_budget.py 1 full copy
test_effective_topology_cache.py full vs effective hash
test_cache_capacity_analysis.py zero-sharing bound
test_gd_lineage_dual_track.py два пула после GD
test_hybrid_cpu_fwd_gpu_gd.py CPU eval + CUDA GD
test_atomic_io.py replace retry
test_studio_*.py / test_cascading_select.py / test_heatmaps.py / test_lineage_graph.py / test_live_progress.py Studio: реестр 05–16, status adapters, data/, Qt smoke
test_study_bot_status.py / test_study_bot_snapshots.py Telegram status + PNG-снапшоты
test_script10_* / test_script11_* / test_script12_gpu_ab.py Оркестраторы OVA CIFAR
test_multiclass_ova_merge.py / test_script13_14_infographic.py Merge OVA→многоклассовый режим (multiclass), выбор класса по максимуму на концах (tip-argmax), infographic
test_script15_mnist_gpu_only.py / test_script15_mnist_val_signature.py / test_mnist_dataset.py MNIST OVA + датасет
test_script16_mnist_multiclass.py MNIST многоклассовый режим queue
test_propose_batch_and_deferred_save.py / test_heavy_pop500_parallel.py Batch/MP мутации, deferred save
test_weight_stats.py Агрегаты весов epoch_*_weight_stats.json
test_dissolve_node.py Контракция скрытого узла
test_periodic_gd_adaptive_batch.py / test_periodic_gd_cv_protocol.py / test_periodic_gd_parallel.py Периодическое градиентное дообучение (adaptive batch, CV, параллель)
test_until_stagnation.py stagnation_patience
test_dynamic_population.py / test_script20_dynamic_pop.py / test_history_axis.py / test_eta_pace.py Occupancy pop + genome stagn + cache-drop→naive + графики по геномам + ETA по последним прогонам
test_eval_full_scores.py Метрика по полной score-матрице, не среднее батчей

Классика (binary head, VRAM, geometry, archive shards) тоже в tests/.