ancient-processor 4.1.1__tar.gz → 4.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/CHANGELOG.md +168 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/PKG-INFO +1 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/PKG-INFO +1 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/SOURCES.txt +23 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/scm_file_list.json +22 -0
- ancient_processor-4.2.0/src/ancient_processor.egg-info/scm_version.json +8 -0
- ancient_processor-4.2.0/src/super_processor/atomic_io.py +98 -0
- ancient_processor-4.2.0/src/super_processor/cancel.py +76 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/cli.py +12 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/gemini.py +63 -36
- ancient_processor-4.2.0/src/super_processor/output_versions.py +335 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/review.py +123 -35
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/segment_loop.py +166 -16
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/shot_plan.py +80 -15
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/shots.py +5 -3
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/upscale.py +224 -80
- ancient_processor-4.2.0/src/super_processor/wizard.py +4164 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/wizard_pages.py +94 -5
- ancient_processor-4.2.0/tests/test_atomic_io.py +197 -0
- ancient_processor-4.2.0/tests/test_cancel.py +140 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gemini.py +95 -0
- ancient_processor-4.2.0/tests/test_output_versions.py +307 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_review_server.py +24 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_loop.py +209 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_loop_wizard.py +450 -10
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_shot_plan.py +88 -3
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_stability.py +1 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_upscale.py +301 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_api.py +283 -2
- ancient_processor-4.2.0/tests/test_wizard_cancel.py +617 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_cli.py +60 -3
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_edges.py +141 -5
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_flow_steps.py +4 -2
- ancient_processor-4.2.0/tests/test_wizard_full_flow.py +557 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_hardening.py +184 -1
- ancient_processor-4.2.0/tests/test_wizard_jobs.py +591 -0
- ancient_processor-4.2.0/tests/test_wizard_media_routes.py +262 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_navigation.py +192 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_note_scale.py +1 -1
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_pages.py +48 -0
- ancient_processor-4.2.0/tests/test_wizard_prefetch.py +520 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_render_steps.py +136 -8
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_safety.py +226 -2
- ancient_processor-4.2.0/web/src/JobsHome.tsx +184 -0
- ancient_processor-4.2.0/web/src/LiveWizard.tsx +2583 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/src/api.ts +245 -2
- ancient_processor-4.2.0/web/src/jobView.ts +224 -0
- ancient_processor-4.2.0/web/src/jobsList.ts +169 -0
- ancient_processor-4.2.0/web/src/runNotify.ts +125 -0
- ancient_processor-4.2.0/web/src/runStates.ts +160 -0
- ancient_processor-4.2.0/web/src/sceneEdit.ts +301 -0
- ancient_processor-4.2.0/web/src/styles.css +1188 -0
- ancient_processor-4.2.0/web/src/versions.ts +102 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/tests/api.test.mjs +200 -0
- ancient_processor-4.2.0/web/tests/job-view.test.mjs +160 -0
- ancient_processor-4.2.0/web/tests/jobs-list.test.mjs +163 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/tests/proxy.test.mjs +6 -2
- ancient_processor-4.2.0/web/tests/run-notify.test.mjs +148 -0
- ancient_processor-4.2.0/web/tests/run-states.test.mjs +137 -0
- ancient_processor-4.2.0/web/tests/scene-edit.test.mjs +210 -0
- ancient_processor-4.2.0/web/tests/versions.test.mjs +125 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/vite.config.ts +1 -1
- ancient_processor-4.1.1/src/ancient_processor.egg-info/scm_version.json +0 -8
- ancient_processor-4.1.1/src/super_processor/wizard.py +0 -1972
- ancient_processor-4.1.1/tests/test_wizard_full_flow.py +0 -280
- ancient_processor-4.1.1/tests/test_wizard_media_routes.py +0 -106
- ancient_processor-4.1.1/web/src/LiveWizard.tsx +0 -1284
- ancient_processor-4.1.1/web/src/styles.css +0 -490
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.gitattributes +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.github/dependabot.yml +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.github/pull_request_template.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.github/workflows/ci.yml +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.github/workflows/pages.yml +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.github/workflows/release.yml +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/.gitignore +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/CONTRIBUTING.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/LICENSE +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/MANIFEST.in +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/README.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/THIRD_PARTY_NOTICES.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/docs/acceptance.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/docs/release-plan.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/docs/system-design.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/docs/ui-wizard.md +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/pyproject.toml +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/setup.cfg +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/setup.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/dependency_links.txt +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/entry_points.txt +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/requires.txt +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/top_level.txt +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/__init__.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/__main__.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/_core.pyi +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/_core.pyx +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/diagnose.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/doctor.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/encoders.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/estimators.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/file_dialog.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/gpu_heat.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/jobs.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/look.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/models.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/plan.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/plans.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/preview.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/probe.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/progress.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/py.typed +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/qa.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/recipe.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/reframe.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/regions.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/render.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/segments.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/span_sr.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/stability.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/templates.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/treatments.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/validator.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/super_processor/worker.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/conftest.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/loop_driver.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_api_key_store.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_audio_mux.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_cli.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_core.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_diagnose_plan.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_doctor.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_estimators.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_faults.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_frame_alignment.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gemini_live.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gemini_video.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gpu_blend.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gpu_codec.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gpu_heat.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_gpu_strength.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_hwdecode.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_job_cli.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_jobs.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_kept_duration.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_look.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_packaging.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_pass_through.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_plan_cli.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_plan_io.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_plan_pick.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_plan_revise.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_plan_score.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_preview_encode.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_preview_window.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_probe.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_product_flow.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_progress.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_recipe.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_reframe.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_regions.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_render_argv.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_render_choose.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_apply.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_bounds.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_cli.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_ffmpeg.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_groups.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_labels.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_merge.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_notes.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_review.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_sample.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_samples_io.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_score.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_segment_split.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_sentence.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_shots.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_span_gpu.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_templates.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_timing_safety.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_treatments.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_validator.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_vmaf.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_wizard_media.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/tests/test_worker.py +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/uv.lock +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/index.html +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/package-lock.json +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/package.json +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/scripts/a11y.mjs +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/src/App.tsx +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/src/StaticShell.tsx +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/src/main.tsx +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/src/vite-env.d.ts +0 -0
- {ancient_processor-4.1.1 → ancient_processor-4.2.0}/web/tsconfig.json +0 -0
|
@@ -7,6 +7,174 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.2.0] - 2026-11-21
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- The wizard's `/api/state` reports the last scan, preview or render as
|
|
15
|
+
`run` (its kind, job, start and end times, and whether it finished,
|
|
16
|
+
failed or was stopped), so a page can tell a crash from a success even
|
|
17
|
+
after the step has moved on.
|
|
18
|
+
- An approved scene can be opened again from a scene preview or from
|
|
19
|
+
"Ready to render" (`/api/scene` with its `index`), up to the first scene
|
|
20
|
+
not approved yet. Approving it goes back to the furthest scene reached,
|
|
21
|
+
so earlier approvals are not lost, and the overall progress bar does not
|
|
22
|
+
go back while it is looked at again. `/api/state` now has a `job`
|
|
23
|
+
summary for a stepper and scene strip: the job's title, each stage and
|
|
24
|
+
whether it is done, and each scene with its still, whether it is
|
|
25
|
+
approved, previewed, and can be reopened.
|
|
26
|
+
- Finding the segments and the render can be stopped: a Stop button on
|
|
27
|
+
their pages, or `/api/cancel`. The run stops within moments (the GPU
|
|
28
|
+
can take up to a minute) without waiting for Gemini to answer, and goes
|
|
29
|
+
back to where it started: the segments from before (or the pick screen),
|
|
30
|
+
"Ready to render" with every approved scene kept, or the previous result
|
|
31
|
+
with its settings. A stopped job is never marked failed. A render that
|
|
32
|
+
has started replacing its output can no longer be stopped. A stop asked
|
|
33
|
+
for just before the wizard was closed still applies when it restarts,
|
|
34
|
+
and a job left mid-step can be stopped without starting its work again.
|
|
35
|
+
`/api/state` has `cancellable`, `cancel_requested` and `stopped`.
|
|
36
|
+
- The scenes can be changed by hand on the Segments step: move the cut
|
|
37
|
+
after a scene, join a scene with the next one, or split one
|
|
38
|
+
(`/api/segments` with `action` `move`, `merge` or `split`, the scene's
|
|
39
|
+
`index`, and `at` in seconds). The limits are the same as for Gemini's
|
|
40
|
+
proposals: at least 3 seconds a scene and at most 10 scenes. Each change
|
|
41
|
+
sends the `revision` the page shows, so a second window showing older
|
|
42
|
+
scenes is refused instead of overwriting them. A change that leaves the
|
|
43
|
+
scenes as they were keeps their approval. `/api/state` shows the
|
|
44
|
+
segments' `revision`, `approved`, `duration_s`, `min_segment_s`,
|
|
45
|
+
`max_segments` and each scene's `index`.
|
|
46
|
+
- A list of every wizard job, newest first (`/api/jobs`): its title (the
|
|
47
|
+
name of the file as it was picked), a still from the video, whether it
|
|
48
|
+
has a result, was left mid-step, or is busy in another wizard window on
|
|
49
|
+
the same computer. `/api/jobs/open` with `job` opens one where it was
|
|
50
|
+
left. A job's result and stills can be fetched by its id
|
|
51
|
+
(`/jobs/<id>/output.mp4`, `/jobs/<id>/thumb.jpg`), and `output_url`
|
|
52
|
+
now names the job, so a page left open never plays another job's video.
|
|
53
|
+
A job is only shown as busy in another window while the process that
|
|
54
|
+
started its work still runs: a wizard that crashed, or a restart, never
|
|
55
|
+
leaves the job locked, even when its process id is later reused.
|
|
56
|
+
- Every result is kept. Each finished render, and the result a revise or
|
|
57
|
+
a "start over" replaces, is saved in the job's `outputs/` folder as
|
|
58
|
+
`v001.mp4`, `v002.mp4`, … with the note that asked for it, and listed
|
|
59
|
+
in `/api/state` as `versions` on the Result and Done steps (playable at
|
|
60
|
+
`/jobs/<id>/outputs/v001.mp4`). Nothing is deleted automatically. On
|
|
61
|
+
Linux and macOS a version takes no extra disk space; on Windows it is a
|
|
62
|
+
full copy, shown as "Keeping a copy of this version". A version that
|
|
63
|
+
cannot be kept (a full disk) is a warning on the result, never a failed
|
|
64
|
+
render; a "start over" that cannot keep the result is refused instead, so
|
|
65
|
+
the result is never deleted unkept. Each version lists the scale and
|
|
66
|
+
strength it was rendered with, and a render resumed after reopening the
|
|
67
|
+
job is kept with the note that asked for it.
|
|
68
|
+
- `super-processor review --prefetch` previews the next scene in the
|
|
69
|
+
background while you look at the current one, so approving a scene
|
|
70
|
+
usually shows the next preview at once. It is off by default, since it
|
|
71
|
+
spends GPU time and Gemini quota on scenes you may redo or never reach.
|
|
72
|
+
`/api/state` shows it as `segment_preview.next`, and a redo, leaving the
|
|
73
|
+
scenes, or a render drops it along with its files, without waiting for
|
|
74
|
+
a Gemini answer it was still expecting. It never uploads the video to
|
|
75
|
+
Gemini; it uses an upload only while one is still live.
|
|
76
|
+
- The web app has a Stop button while it finds the segments and while it
|
|
77
|
+
renders. It turns into a disabled "Stopping…" until the stop lands, and
|
|
78
|
+
the step it goes back to shows a plain note saying what was kept. A job
|
|
79
|
+
left interrupted asks Resume or Stop and says what each one does, and a
|
|
80
|
+
render that failed shows its error with a "Try the render again" button.
|
|
81
|
+
- The web app shows the job's title and a five-step stepper (Video,
|
|
82
|
+
Scenes, Previews, Render, Result) with a short line under each step,
|
|
83
|
+
such as "2 of 5 approved". From the previews on, a scene strip lists
|
|
84
|
+
every scene with its still, time range and state (Approved, Reviewing,
|
|
85
|
+
Waiting) below the step, scrolling sideways on a phone, and an approved
|
|
86
|
+
scene can be opened again with "Look again", which moves focus to the
|
|
87
|
+
scene's page. The job's percentage never goes back while a step runs,
|
|
88
|
+
nor when a scene is looked at again.
|
|
89
|
+
- The Scenes page has a timeline for changing the cuts yourself: drag a
|
|
90
|
+
cut, focus it and move it with the arrow keys (Enter saves it), or type
|
|
91
|
+
its time with "Move cut…"; merge a scene with the next one, or split one
|
|
92
|
+
at a time you type. A click or tap on a cut only selects it. It says at
|
|
93
|
+
once when a change would leave any scene under 3 seconds or make more
|
|
94
|
+
than 10 scenes. If another window changed the scenes first, the page
|
|
95
|
+
shows them as they are now and says why, even when that takes it to
|
|
96
|
+
another step.
|
|
97
|
+
- The web app has an "All jobs" page, "Your videos", reachable from the
|
|
98
|
+
top bar on every step and shown first when the wizard would open on the
|
|
99
|
+
file pick and jobs exist. Each job shows its still, title, file name,
|
|
100
|
+
when it last changed and where it is ("Result ready", "Scenes · waiting
|
|
101
|
+
for you", "Render · stopped partway", "Busy in another window"), with a
|
|
102
|
+
link to watch its result. Opening one switches the wizard to it where
|
|
103
|
+
it was left; a job stopped partway opens on the Resume or Stop choice
|
|
104
|
+
and never starts work by itself. A job another window is working on,
|
|
105
|
+
or any other job while a run works here, cannot be opened and says why.
|
|
106
|
+
"Restore a new video" keeps the open job where it was.
|
|
107
|
+
- The Result and Done pages list every kept version, newest first, with
|
|
108
|
+
when it was kept, its scale and size, the note that asked for it, and
|
|
109
|
+
Play and Download buttons; the one the result is now is marked
|
|
110
|
+
"Current". While the scenes are found or the render runs, "Notify me
|
|
111
|
+
when it's done" sends a desktop notification if the tab is in the
|
|
112
|
+
background when it finishes or fails (the browser asks permission only
|
|
113
|
+
when you tick it, and the choice is remembered). With `--prefetch`, a
|
|
114
|
+
scene preview says when the next scene is being prepared in the
|
|
115
|
+
background.
|
|
116
|
+
|
|
117
|
+
### Changed
|
|
118
|
+
|
|
119
|
+
- A job left mid-step (the wizard was closed while it found the segments,
|
|
120
|
+
looked at a scene or rendered, or the job was reopened from the list) no
|
|
121
|
+
longer starts that GPU or Gemini work again by itself. The page asks
|
|
122
|
+
first: Resume carries on, Stop goes back to the step before it.
|
|
123
|
+
`/api/state` says `interrupted`, `?run=1` waits until a POST to
|
|
124
|
+
`/api/resume`, and `/api/cancel` stops it instead.
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
|
|
128
|
+
- After new scenes are approved (a note to Gemini, a manual edit, or
|
|
129
|
+
starting over from the result), the previews no longer show the old
|
|
130
|
+
scenes' cached video: preview URLs now carry the plan's generation.
|
|
131
|
+
- Stopping the wizard server in the middle of a render or a scene scan now
|
|
132
|
+
ends its FFmpeg and SPAN work too, instead of leaving it writing to the
|
|
133
|
+
job's work files. The job keeps its step, and the next start asks
|
|
134
|
+
whether to resume it.
|
|
135
|
+
- "Ready to render" refuses to start while a scene has changes that have
|
|
136
|
+
not been previewed yet, and says which scene.
|
|
137
|
+
- A half-written or damaged `shot_plan.json` no longer breaks `/api/state`
|
|
138
|
+
on a scene preview or "Ready to render"; the error is shown instead.
|
|
139
|
+
- A render now replaces `output.mp4` once, with a finished file that
|
|
140
|
+
already has its audio. A render that failed while copying the audio (or
|
|
141
|
+
a whole-video revise that failed partway) used to leave a silent new
|
|
142
|
+
picture, or an old picture no longer marked for fast revises; the
|
|
143
|
+
previous output is now kept exactly as it was.
|
|
144
|
+
- The wizard's scene list, shot list, plan and Gemini chat are now saved
|
|
145
|
+
the same safe way as its state: through a temp file of their own that
|
|
146
|
+
replaces the old file in one step, retried while Windows briefly holds
|
|
147
|
+
the file open. A page refresh racing a save no longer fails the request
|
|
148
|
+
or reads a half-written file, and no `.tmp` file is left behind.
|
|
149
|
+
- Two Gemini calls on one job finishing at the same moment could drop
|
|
150
|
+
each other's turns from the saved chat, or leave a question without its
|
|
151
|
+
answer. Each question and answer are now saved together under one lock,
|
|
152
|
+
so the chat Gemini is shown on the next call is always complete.
|
|
153
|
+
- A wizard button pressed just as a scan, preview or render started (or
|
|
154
|
+
just as it finished) could be applied in the middle of that work and
|
|
155
|
+
be overwritten by it. Actions and background work now take turns, and
|
|
156
|
+
the wizard counts as busy until the work has fully wrapped up.
|
|
157
|
+
- A failed first render no longer throws the job away. The wizard goes
|
|
158
|
+
back to "Ready to render" with the error and every approved scene kept,
|
|
159
|
+
so pressing Render again retries it; the job is no longer marked failed.
|
|
160
|
+
A render started from the result screen's segments that fails now puts
|
|
161
|
+
back the settings the existing result was made with, and a failure after
|
|
162
|
+
the new video is already in place (such as the seam check) shows that
|
|
163
|
+
new video rather than the old settings.
|
|
164
|
+
- A page left open on an old job could change the job another window had
|
|
165
|
+
since opened. Such a request is now refused with "this job is no longer
|
|
166
|
+
open in this window".
|
|
167
|
+
- A stopped render or Gemini copy ends its FFmpeg (on Windows, the whole
|
|
168
|
+
process tree) within moments instead of leaving it encoding, removes its
|
|
169
|
+
half-written `.encoding.mp4` or part file, and releases the GPU, so the
|
|
170
|
+
next preview or render can start at once.
|
|
171
|
+
- The web app no longer waits forever on "Finding the segments", a scene
|
|
172
|
+
preview or the render when the step was saved but its work never began:
|
|
173
|
+
after two checks that show nothing working on it, it starts the work
|
|
174
|
+
again. A job left interrupted is never started this way; it still waits
|
|
175
|
+
for Resume or Stop. Every action from the web app now names the job the
|
|
176
|
+
page shows, so a tab left open on an old job cannot change another one.
|
|
177
|
+
|
|
10
178
|
## [4.1.1] - 2026-11-17
|
|
11
179
|
|
|
12
180
|
### Fixed
|
{ancient_processor-4.1.1 → ancient_processor-4.2.0}/src/ancient_processor.egg-info/SOURCES.txt
RENAMED
|
@@ -30,6 +30,8 @@ src/super_processor/__init__.py
|
|
|
30
30
|
src/super_processor/__main__.py
|
|
31
31
|
src/super_processor/_core.pyi
|
|
32
32
|
src/super_processor/_core.pyx
|
|
33
|
+
src/super_processor/atomic_io.py
|
|
34
|
+
src/super_processor/cancel.py
|
|
33
35
|
src/super_processor/cli.py
|
|
34
36
|
src/super_processor/diagnose.py
|
|
35
37
|
src/super_processor/doctor.py
|
|
@@ -41,6 +43,7 @@ src/super_processor/gpu_heat.py
|
|
|
41
43
|
src/super_processor/jobs.py
|
|
42
44
|
src/super_processor/look.py
|
|
43
45
|
src/super_processor/models.py
|
|
46
|
+
src/super_processor/output_versions.py
|
|
44
47
|
src/super_processor/plan.py
|
|
45
48
|
src/super_processor/plans.py
|
|
46
49
|
src/super_processor/preview.py
|
|
@@ -69,7 +72,9 @@ src/super_processor/worker.py
|
|
|
69
72
|
tests/conftest.py
|
|
70
73
|
tests/loop_driver.py
|
|
71
74
|
tests/test_api_key_store.py
|
|
75
|
+
tests/test_atomic_io.py
|
|
72
76
|
tests/test_audio_mux.py
|
|
77
|
+
tests/test_cancel.py
|
|
73
78
|
tests/test_cli.py
|
|
74
79
|
tests/test_core.py
|
|
75
80
|
tests/test_diagnose_plan.py
|
|
@@ -89,6 +94,7 @@ tests/test_job_cli.py
|
|
|
89
94
|
tests/test_jobs.py
|
|
90
95
|
tests/test_kept_duration.py
|
|
91
96
|
tests/test_look.py
|
|
97
|
+
tests/test_output_versions.py
|
|
92
98
|
tests/test_packaging.py
|
|
93
99
|
tests/test_pass_through.py
|
|
94
100
|
tests/test_plan_cli.py
|
|
@@ -135,16 +141,19 @@ tests/test_validator.py
|
|
|
135
141
|
tests/test_vmaf.py
|
|
136
142
|
tests/test_wizard.py
|
|
137
143
|
tests/test_wizard_api.py
|
|
144
|
+
tests/test_wizard_cancel.py
|
|
138
145
|
tests/test_wizard_cli.py
|
|
139
146
|
tests/test_wizard_edges.py
|
|
140
147
|
tests/test_wizard_flow_steps.py
|
|
141
148
|
tests/test_wizard_full_flow.py
|
|
142
149
|
tests/test_wizard_hardening.py
|
|
150
|
+
tests/test_wizard_jobs.py
|
|
143
151
|
tests/test_wizard_media.py
|
|
144
152
|
tests/test_wizard_media_routes.py
|
|
145
153
|
tests/test_wizard_navigation.py
|
|
146
154
|
tests/test_wizard_note_scale.py
|
|
147
155
|
tests/test_wizard_pages.py
|
|
156
|
+
tests/test_wizard_prefetch.py
|
|
148
157
|
tests/test_wizard_render_steps.py
|
|
149
158
|
tests/test_wizard_safety.py
|
|
150
159
|
tests/test_worker.py
|
|
@@ -155,11 +164,24 @@ web/tsconfig.json
|
|
|
155
164
|
web/vite.config.ts
|
|
156
165
|
web/scripts/a11y.mjs
|
|
157
166
|
web/src/App.tsx
|
|
167
|
+
web/src/JobsHome.tsx
|
|
158
168
|
web/src/LiveWizard.tsx
|
|
159
169
|
web/src/StaticShell.tsx
|
|
160
170
|
web/src/api.ts
|
|
171
|
+
web/src/jobView.ts
|
|
172
|
+
web/src/jobsList.ts
|
|
161
173
|
web/src/main.tsx
|
|
174
|
+
web/src/runNotify.ts
|
|
175
|
+
web/src/runStates.ts
|
|
176
|
+
web/src/sceneEdit.ts
|
|
162
177
|
web/src/styles.css
|
|
178
|
+
web/src/versions.ts
|
|
163
179
|
web/src/vite-env.d.ts
|
|
164
180
|
web/tests/api.test.mjs
|
|
165
|
-
web/tests/
|
|
181
|
+
web/tests/job-view.test.mjs
|
|
182
|
+
web/tests/jobs-list.test.mjs
|
|
183
|
+
web/tests/proxy.test.mjs
|
|
184
|
+
web/tests/run-notify.test.mjs
|
|
185
|
+
web/tests/run-states.test.mjs
|
|
186
|
+
web/tests/scene-edit.test.mjs
|
|
187
|
+
web/tests/versions.test.mjs
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"src/super_processor/__main__.py",
|
|
24
24
|
"src/super_processor/_core.pyi",
|
|
25
25
|
"src/super_processor/_core.pyx",
|
|
26
|
+
"src/super_processor/atomic_io.py",
|
|
27
|
+
"src/super_processor/cancel.py",
|
|
26
28
|
"src/super_processor/cli.py",
|
|
27
29
|
"src/super_processor/diagnose.py",
|
|
28
30
|
"src/super_processor/doctor.py",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"src/super_processor/jobs.py",
|
|
35
37
|
"src/super_processor/look.py",
|
|
36
38
|
"src/super_processor/models.py",
|
|
39
|
+
"src/super_processor/output_versions.py",
|
|
37
40
|
"src/super_processor/plan.py",
|
|
38
41
|
"src/super_processor/plans.py",
|
|
39
42
|
"src/super_processor/preview.py",
|
|
@@ -62,7 +65,9 @@
|
|
|
62
65
|
"tests/conftest.py",
|
|
63
66
|
"tests/loop_driver.py",
|
|
64
67
|
"tests/test_api_key_store.py",
|
|
68
|
+
"tests/test_atomic_io.py",
|
|
65
69
|
"tests/test_audio_mux.py",
|
|
70
|
+
"tests/test_cancel.py",
|
|
66
71
|
"tests/test_cli.py",
|
|
67
72
|
"tests/test_core.py",
|
|
68
73
|
"tests/test_diagnose_plan.py",
|
|
@@ -82,6 +87,7 @@
|
|
|
82
87
|
"tests/test_jobs.py",
|
|
83
88
|
"tests/test_kept_duration.py",
|
|
84
89
|
"tests/test_look.py",
|
|
90
|
+
"tests/test_output_versions.py",
|
|
85
91
|
"tests/test_packaging.py",
|
|
86
92
|
"tests/test_pass_through.py",
|
|
87
93
|
"tests/test_plan_cli.py",
|
|
@@ -128,16 +134,19 @@
|
|
|
128
134
|
"tests/test_vmaf.py",
|
|
129
135
|
"tests/test_wizard.py",
|
|
130
136
|
"tests/test_wizard_api.py",
|
|
137
|
+
"tests/test_wizard_cancel.py",
|
|
131
138
|
"tests/test_wizard_cli.py",
|
|
132
139
|
"tests/test_wizard_edges.py",
|
|
133
140
|
"tests/test_wizard_flow_steps.py",
|
|
134
141
|
"tests/test_wizard_full_flow.py",
|
|
135
142
|
"tests/test_wizard_hardening.py",
|
|
143
|
+
"tests/test_wizard_jobs.py",
|
|
136
144
|
"tests/test_wizard_media.py",
|
|
137
145
|
"tests/test_wizard_media_routes.py",
|
|
138
146
|
"tests/test_wizard_navigation.py",
|
|
139
147
|
"tests/test_wizard_note_scale.py",
|
|
140
148
|
"tests/test_wizard_pages.py",
|
|
149
|
+
"tests/test_wizard_prefetch.py",
|
|
141
150
|
"tests/test_wizard_render_steps.py",
|
|
142
151
|
"tests/test_wizard_safety.py",
|
|
143
152
|
"tests/test_worker.py",
|
|
@@ -147,14 +156,27 @@
|
|
|
147
156
|
"web/package.json",
|
|
148
157
|
"web/scripts/a11y.mjs",
|
|
149
158
|
"web/src/App.tsx",
|
|
159
|
+
"web/src/JobsHome.tsx",
|
|
150
160
|
"web/src/LiveWizard.tsx",
|
|
151
161
|
"web/src/StaticShell.tsx",
|
|
152
162
|
"web/src/api.ts",
|
|
163
|
+
"web/src/jobView.ts",
|
|
164
|
+
"web/src/jobsList.ts",
|
|
153
165
|
"web/src/main.tsx",
|
|
166
|
+
"web/src/runNotify.ts",
|
|
167
|
+
"web/src/runStates.ts",
|
|
168
|
+
"web/src/sceneEdit.ts",
|
|
154
169
|
"web/src/styles.css",
|
|
170
|
+
"web/src/versions.ts",
|
|
155
171
|
"web/src/vite-env.d.ts",
|
|
156
172
|
"web/tests/api.test.mjs",
|
|
173
|
+
"web/tests/job-view.test.mjs",
|
|
174
|
+
"web/tests/jobs-list.test.mjs",
|
|
157
175
|
"web/tests/proxy.test.mjs",
|
|
176
|
+
"web/tests/run-notify.test.mjs",
|
|
177
|
+
"web/tests/run-states.test.mjs",
|
|
178
|
+
"web/tests/scene-edit.test.mjs",
|
|
179
|
+
"web/tests/versions.test.mjs",
|
|
158
180
|
"web/tsconfig.json",
|
|
159
181
|
"web/vite.config.ts"
|
|
160
182
|
]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""Small disk helpers that survive another thread or program holding a file.
|
|
2
|
+
|
|
3
|
+
On Windows, replacing a file that another thread has open (a page refresh
|
|
4
|
+
reading the wizard state while the render worker saves it) fails with
|
|
5
|
+
PermissionError, and so does opening it mid-replace. Both clear within
|
|
6
|
+
milliseconds, so reads and replaces retry briefly instead of failing.
|
|
7
|
+
|
|
8
|
+
Every write goes through its own temp file next to the target, named with a
|
|
9
|
+
fresh uuid, so two threads saving the same file at once never share one, and
|
|
10
|
+
a reader only ever sees the old file or the new one, never half of either.
|
|
11
|
+
|
|
12
|
+
This module imports only the standard library, so any module may use it.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import shutil
|
|
18
|
+
import time
|
|
19
|
+
import uuid
|
|
20
|
+
from contextlib import suppress
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
RETRIES = 20
|
|
24
|
+
RETRY_S = 0.025
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def write_text_atomic(path: Path, text: str) -> Path:
|
|
28
|
+
"""Write ``text`` to ``path`` through a uuid temp file and one replace.
|
|
29
|
+
|
|
30
|
+
A PermissionError on the replace is retried :data:`RETRIES` times; the
|
|
31
|
+
last one is raised, with the old file untouched and no temp file left.
|
|
32
|
+
"""
|
|
33
|
+
tmp = path.with_name(f"{path.name}.{uuid.uuid4().hex}.tmp")
|
|
34
|
+
tmp.write_text(text, encoding="utf-8")
|
|
35
|
+
try:
|
|
36
|
+
for attempt in range(RETRIES):
|
|
37
|
+
try:
|
|
38
|
+
tmp.replace(path)
|
|
39
|
+
return path
|
|
40
|
+
except PermissionError:
|
|
41
|
+
if attempt == RETRIES - 1:
|
|
42
|
+
raise
|
|
43
|
+
time.sleep(RETRY_S)
|
|
44
|
+
finally:
|
|
45
|
+
tmp.unlink(missing_ok=True)
|
|
46
|
+
raise AssertionError("unreachable") # pragma: no cover
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def read_text_retrying(path: Path) -> str:
|
|
50
|
+
"""Read ``path`` as UTF-8, retrying a PermissionError.
|
|
51
|
+
|
|
52
|
+
The last error is raised as it is; callers turn it into their own error
|
|
53
|
+
only after this gives up. Other errors (a missing file, bad UTF-8) are
|
|
54
|
+
raised at once.
|
|
55
|
+
"""
|
|
56
|
+
for attempt in range(RETRIES):
|
|
57
|
+
try:
|
|
58
|
+
return path.read_text(encoding="utf-8")
|
|
59
|
+
except PermissionError:
|
|
60
|
+
if attempt == RETRIES - 1:
|
|
61
|
+
raise
|
|
62
|
+
time.sleep(RETRY_S)
|
|
63
|
+
raise AssertionError("unreachable") # pragma: no cover
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def unlink_retrying(path: Path) -> None:
|
|
67
|
+
"""Remove a file if it is there, retrying a PermissionError.
|
|
68
|
+
|
|
69
|
+
The last error is raised as it is, so a file that must go and will not
|
|
70
|
+
is never mistaken for one that went.
|
|
71
|
+
"""
|
|
72
|
+
for attempt in range(RETRIES):
|
|
73
|
+
try:
|
|
74
|
+
path.unlink(missing_ok=True)
|
|
75
|
+
return
|
|
76
|
+
except PermissionError:
|
|
77
|
+
if attempt == RETRIES - 1:
|
|
78
|
+
raise
|
|
79
|
+
time.sleep(RETRY_S)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def unlink_quietly(path: Path) -> None:
|
|
83
|
+
"""Remove a file if it is there; a file that will not go is left."""
|
|
84
|
+
with suppress(OSError):
|
|
85
|
+
path.unlink(missing_ok=True)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def rmtree_quietly(path: Path) -> None:
|
|
89
|
+
"""Remove a folder and what is in it, as far as the disk lets us.
|
|
90
|
+
|
|
91
|
+
A symlink is removed as a link and never followed, so a link to a folder
|
|
92
|
+
elsewhere cannot empty that folder.
|
|
93
|
+
"""
|
|
94
|
+
with suppress(OSError):
|
|
95
|
+
if path.is_symlink():
|
|
96
|
+
path.unlink()
|
|
97
|
+
elif path.is_dir():
|
|
98
|
+
shutil.rmtree(path, ignore_errors=True)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""The stop signal for a wizard run, and stopping the program a run started.
|
|
2
|
+
|
|
3
|
+
:class:`Cancelled` is a BaseException on purpose: the wizard catches
|
|
4
|
+
``GeminiError``, ``UpscaleError``, ``ShotError`` and ``OSError`` around its
|
|
5
|
+
steps to show the user a message, and a stop must pass through all of those
|
|
6
|
+
untouched until the run's own landing code catches it.
|
|
7
|
+
|
|
8
|
+
:func:`stop_process` ends an ffmpeg (or any other) child that a stopped run
|
|
9
|
+
leaves behind. On Windows it ends the whole process tree with ``taskkill``,
|
|
10
|
+
because ffmpeg started through a wrapper would otherwise keep encoding after
|
|
11
|
+
its parent is gone.
|
|
12
|
+
|
|
13
|
+
This module imports only the standard library, so any module may use it.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import os
|
|
19
|
+
import subprocess
|
|
20
|
+
from contextlib import suppress
|
|
21
|
+
from typing import Any
|
|
22
|
+
|
|
23
|
+
TASKKILL_TIMEOUT_S = 10.0
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Cancelled(BaseException): # noqa: N818 - a signal, not an error
|
|
27
|
+
"""The user stopped the run; unwind and let the run land the stop."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _is_windows() -> bool:
|
|
31
|
+
"""True on Windows. Tests patch this, never ``os.name``."""
|
|
32
|
+
return os.name == "nt"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def stop_process(proc: subprocess.Popen[Any], grace_s: float = 1.0) -> None:
|
|
36
|
+
"""End ``proc`` and wait until it is gone.
|
|
37
|
+
|
|
38
|
+
On POSIX it is asked to stop first (SIGTERM) and killed if it is still
|
|
39
|
+
running after ``grace_s`` seconds. On Windows the process and every
|
|
40
|
+
child it started are ended with ``taskkill /T /F``; if taskkill cannot
|
|
41
|
+
run or fails, the process itself is killed. A process that has already
|
|
42
|
+
exited is only reaped.
|
|
43
|
+
"""
|
|
44
|
+
if proc.poll() is not None:
|
|
45
|
+
return
|
|
46
|
+
if _is_windows():
|
|
47
|
+
_taskkill_tree(proc)
|
|
48
|
+
else:
|
|
49
|
+
with suppress(OSError):
|
|
50
|
+
proc.terminate()
|
|
51
|
+
try:
|
|
52
|
+
proc.wait(timeout=grace_s)
|
|
53
|
+
return
|
|
54
|
+
except subprocess.TimeoutExpired:
|
|
55
|
+
pass
|
|
56
|
+
with suppress(OSError):
|
|
57
|
+
proc.kill()
|
|
58
|
+
proc.wait()
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _taskkill_tree(proc: subprocess.Popen[Any]) -> None:
|
|
62
|
+
"""End ``proc`` and its children on Windows, falling back to a kill."""
|
|
63
|
+
try:
|
|
64
|
+
completed = subprocess.run( # noqa: S603 - argv list, no shell
|
|
65
|
+
["taskkill", "/T", "/F", "/PID", str(proc.pid)], # noqa: S607
|
|
66
|
+
capture_output=True,
|
|
67
|
+
check=False,
|
|
68
|
+
timeout=TASKKILL_TIMEOUT_S,
|
|
69
|
+
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),
|
|
70
|
+
)
|
|
71
|
+
ended = completed.returncode == 0
|
|
72
|
+
except (OSError, subprocess.SubprocessError):
|
|
73
|
+
ended = False
|
|
74
|
+
if not ended and proc.poll() is None:
|
|
75
|
+
with suppress(OSError):
|
|
76
|
+
proc.kill()
|
|
@@ -250,6 +250,14 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
250
250
|
default=None,
|
|
251
251
|
help="optional job id; omit to start the wizard",
|
|
252
252
|
)
|
|
253
|
+
review_cmd.add_argument(
|
|
254
|
+
"--prefetch",
|
|
255
|
+
action="store_true",
|
|
256
|
+
help=(
|
|
257
|
+
"preview the next scene in the background while you look at "
|
|
258
|
+
"this one (uses GPU time and Gemini quota on scenes you may skip)"
|
|
259
|
+
),
|
|
260
|
+
)
|
|
253
261
|
|
|
254
262
|
plans_cmd = subparsers.add_parser(
|
|
255
263
|
"plans",
|
|
@@ -529,16 +537,19 @@ def run_review_command(arguments: argparse.Namespace) -> int:
|
|
|
529
537
|
"""Serve the Gemini wizard or a job review page until interrupted."""
|
|
530
538
|
store = _store_from_args(arguments)
|
|
531
539
|
job_id = getattr(arguments, "job_id", None)
|
|
540
|
+
# Off unless asked for: it spends GPU time and Gemini quota ahead.
|
|
541
|
+
prefetch = bool(getattr(arguments, "prefetch", False))
|
|
532
542
|
if job_id:
|
|
533
543
|
store.load(str(job_id))
|
|
534
544
|
server: ReviewServer | WizardServer = ReviewServer(
|
|
535
545
|
store.job_dir(str(job_id)),
|
|
536
546
|
jobs_dir=store.root,
|
|
537
547
|
job_id=str(job_id),
|
|
548
|
+
prefetch=prefetch,
|
|
538
549
|
)
|
|
539
550
|
else:
|
|
540
551
|
store.ensure_root()
|
|
541
|
-
server = WizardServer(store.root)
|
|
552
|
+
server = WizardServer(store.root, prefetch=prefetch)
|
|
542
553
|
print(server.start(), flush=True)
|
|
543
554
|
if server.token:
|
|
544
555
|
# For scripts: send it as X-Wizard-Token on posts and ?run=1 requests.
|