Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs([issue-8867]): validate H3 scene continuity on Apple hardware (#8949)
[._.]/4621f13bb067
diff --git a/client/src/components/videoGen/ModelWorkflowHelp.jsx b/client/src/components/videoGen/ModelWorkflowHelp.jsxindex 2f1de4d80f..10d91b7fda 100644--- a/client/src/components/videoGen/ModelWorkflowHelp.jsx+++ b/client/src/components/videoGen/ModelWorkflowHelp.jsx@@ -8,6 +8,13 @@ export default function ModelWorkflowHelp({ model, mode, models = [], onResolutireturn (<>+ {mode === 'image' && model.runtime === 'minimax_h3' && (+ <p className="mt-2 text-xs text-gray-400" role="note">+ MiniMax H3 can replace the source scene when the prompt describes a different environment.+ Start with a motion-only prompt and a model-native resolution, then inspect the whole clip.+ Image conditioning does not guarantee scene continuity.+ </p>+ )}{mode === 'image' && models.some((entry) => entry.runtime === 'fastvideo' && !entry.supportedModes?.includes('image')) && (<p className="mt-2 text-xs text-gray-400" role="note">Image mode lists models with image conditioning in their installed runtime. The shipped FastMetaldiff --git a/docs/features/apple-video-options.md b/docs/features/apple-video-options.mdindex b82d207261..23f95652ce 100644--- a/docs/features/apple-video-options.md+++ b/docs/features/apple-video-options.md@@ -45,6 +45,14 @@ The original H3 quantizations share the same conditioner and VAE downloads.They retain the conservative 128 GB memory requirement until end-to-endmeasurements justify a lower floor. Transformer file size is not peak RAM.+For MiniMax H3 image-to-video, start with a motion-only prompt and a model-native+resolution, then inspect the whole clip. A prompt describing a different+environment can replace the source scene: image conditioning does not guarantee+continuity. In a controlled synthetic comparison, motion-only clips retained+the scene through five seconds, while a conflicting snowy-forest prompt replaced+it. These observations cover one source and seed, not a guarantee for arbitrary+images. See the [sampled frames and validation details](../research/minimax-h3-continuity.md#hardware-validation-on-2026-09-27).+Animation presets now include **Rotoscope cinematic** and **Unreal stylizedcinema**. These describe a visual treatment in the generation prompt; they donot run an Unreal renderer or perform literal tracing of source footage.diff --git a/docs/research/assets/minimax-h3-continuity/before-geometry.png b/docs/research/assets/minimax-h3-continuity/before-geometry.pngnew file mode 100644index 0000000000..43802a927eBinary files /dev/null and b/docs/research/assets/minimax-h3-continuity/before-geometry.png differdiff --git a/docs/research/assets/minimax-h3-continuity/ltx-motion.png b/docs/research/assets/minimax-h3-continuity/ltx-motion.pngnew file mode 100644index 0000000000..3dd671df47Binary files /dev/null and b/docs/research/assets/minimax-h3-continuity/ltx-motion.png differdiff --git a/docs/research/assets/minimax-h3-continuity/native-conflict.png b/docs/research/assets/minimax-h3-continuity/native-conflict.pngnew file mode 100644index 0000000000..74f710ba44Binary files /dev/null and b/docs/research/assets/minimax-h3-continuity/native-conflict.png differdiff --git a/docs/research/assets/minimax-h3-continuity/native-motion.png b/docs/research/assets/minimax-h3-continuity/native-motion.pngnew file mode 100644index 0000000000..3b042089edBinary files /dev/null and b/docs/research/assets/minimax-h3-continuity/native-motion.png differdiff --git a/docs/research/assets/minimax-h3-continuity/results.json b/docs/research/assets/minimax-h3-continuity/results.jsonnew file mode 100644index 0000000000..84b0844a6f--- /dev/null+++ b/docs/research/assets/minimax-h3-continuity/results.json@@ -0,0 +1,541 @@+{+ "date": "2026-09-27",+ "hardware": {+ "chip": "Apple M5 Max",+ "unified_memory_gib": 128+ },+ "source_sha256": "3ad8536953318e5640992eb4158bb5f810b33c733445faa470488cc1a03faed4",+ "runtime_revision": "fcd9e9b79a1d6018d91ac477c0968de1fa067e49",+ "transformer_revision": "3ac52081470b0488921c3ec3ba84a39097bf2361",+ "reference_checkpoint_revision": "6818f6c32d12b210915e44ad56a4228c2608f160",+ "frames": 124,+ "fps": 24,+ "seed": 42,+ "sigma_entries": 9,+ "cases": [+ {+ "case": {+ "id": "small-motion",+ "width": 576,+ "height": 1024,+ "prompt": "The camera slowly moves forward. Objects remain stationary."+ },+ "status": "rendered",+ "continuity": "not_assessed",+ "timings": {+ "setup_seconds": 30.05009924992919,+ "decode_video_seconds": 100.01749629084952,+ "decode_audio_seconds": 4.226935749873519,+ "mux_seconds": 1.22965395799838,+ "inference_and_conditioning_seconds": 900.8566145012155,+ "total_seconds": 1036.3821530418936+ },+ "vision_conditioning": {+ "embedding_shape": [+ 1,+ 594,+ 5120+ ],+ "token_tag_counts": {+ "1": 16,+ "0": 578+ }+ },+ "vision_processor": {+ "class": "Qwen2VLImageProcessorPil",+ "input_sizes": [+ [+ 576,+ 1024+ ]+ ]+ },+ "vae_conditioning_shape": [+ 576,+ 96+ ],+ "packed_conditioning": {+ "video_shape": [+ 1,+ 21888,+ 96+ ],+ "audio_shape": [+ 1,+ 414,+ 32+ ],+ "position_shape": [+ 22896,+ 3+ ],+ "token_tag_counts": {+ "1": 16,+ "0": 22466,+ "2": 414+ },+ "video_indices": 21888,+ "audio_indices": 414,+ "text_indices": 594+ },+ "assessment": {+ "assessment": "synthetic scene preserved in all five sampled frames",+ "sampled_frames": [+ 0,+ 1,+ 12,+ 60,+ 123+ ],+ "last_sample_seconds": 5.125,+ "scene_score_frame_count": 124,+ "max_adjacent_scene_score": 0.002499,+ "scope": "one synthetic flat-color source, one seed, motion-only prompt; not a general guarantee",+ "timing_note": "CPU-only parity checks overlapped this render; no competing GPU work detected"+ }+ },+ {+ "case": {+ "id": "native-motion",+ "width": 768,+ "height": 1344,+ "prompt": "The camera slowly moves forward. Objects remain stationary."+ },+ "status": "rendered",+ "continuity": "not_assessed",+ "timings": {+ "setup_seconds": 23.242611082969233,+ "decode_video_seconds": 136.38077312498353,+ "decode_audio_seconds": 1.9117730830330402,+ "mux_seconds": 4.415671749971807,+ "inference_and_conditioning_seconds": 1800.1286432088818,+ "total_seconds": 1966.0811641248874+ },+ "vision_conditioning": {+ "embedding_shape": [+ 1,+ 1026,+ 5120+ ],+ "token_tag_counts": {+ "1": 16,+ "0": 1010+ }+ },+ "vision_processor": {+ "class": "Qwen2VLImageProcessorPil",+ "input_sizes": [+ [+ 768,+ 1344+ ]+ ]+ },+ "vae_conditioning_shape": [+ 1008,+ 96+ ],+ "packed_conditioning": {+ "video_shape": [+ 1,+ 38304,+ 96+ ],+ "audio_shape": [+ 1,+ 414,+ 32+ ],+ "position_shape": [+ 39744,+ 3+ ],+ "token_tag_counts": {+ "1": 16,+ "0": 39314,+ "2": 414+ },+ "video_indices": 38304,+ "audio_indices": 414,+ "text_indices": 1026+ },+ "assessment": {+ "assessment": "synthetic scene preserved in all five sampled frames",+ "sampled_frames": [+ 0,+ 1,+ 12,+ 60,+ 123+ ],+ "last_sample_seconds": 5.125,+ "scene_score_frame_count": 124,+ "max_adjacent_scene_score": 0.001892,+ "scope": "one synthetic flat-color source, one seed, motion-only prompt; not a general guarantee",+ "timing_note": "No competing GPU work; brief CPU-only rotary-index comparison overlapped this run"+ }+ },+ {+ "case": {+ "id": "native-conflict",+ "width": 768,+ "height": 1344,+ "prompt": "The camera slowly moves forward through a snowy pine forest at night."+ },+ "status": "rendered",+ "continuity": "not_assessed",+ "timings": {+ "setup_seconds": 25.22124429210089,+ "decode_video_seconds": 135.06349049997516,+ "decode_audio_seconds": 1.4691117501351982,+ "mux_seconds": 1.8167351251468062,+ "inference_and_conditioning_seconds": 1936.5200263746083,+ "total_seconds": 2100.092080875067+ },+ "vision_conditioning": {+ "embedding_shape": [+ 1,+ 1029,+ 5120+ ],+ "token_tag_counts": {+ "1": 19,+ "0": 1010+ }+ },+ "vision_processor": {+ "class": "Qwen2VLImageProcessorPil",+ "input_sizes": [+ [+ 768,+ 1344+ ]+ ]+ },+ "vae_conditioning_shape": [+ 1008,+ 96+ ],+ "packed_conditioning": {+ "video_shape": [+ 1,+ 38304,+ 96+ ],+ "audio_shape": [+ 1,+ 414,+ 32+ ],+ "position_shape": [+ 39747,+ 3+ ],+ "token_tag_counts": {+ "1": 19,+ "0": 39314,+ "2": 414+ },+ "video_indices": 38304,+ "audio_indices": 414,+ "text_indices": 1029+ },+ "assessment": {+ "assessment": "Source colored scene remains at sampled frame 12 (0.5s); snowy forest replaces it by sampled frame 60 (2.5s) and remains at frame 123. Onset between samples not established.",+ "sampled_frames": [+ 0,+ 1,+ 12,+ 60,+ 123+ ],+ "scene_score_frames": 124,+ "maximum_adjacent_scene_score": 0.027388,+ "limitations": "One synthetic source and seed; does not establish original private-image root cause. Scene scores are not semantic continuity metrics."+ }+ },+ {+ "case": {+ "id": "before-geometry",+ "width": 576,+ "height": 1024,+ "prompt": "The camera slowly moves forward. Objects remain stationary."+ },+ "status": "rendered",+ "continuity": "not_assessed",+ "timings": {+ "setup_seconds": 21.9472612910904,+ "decode_video_seconds": 87.34187975013629,+ "decode_audio_seconds": 3.517863875022158,+ "mux_seconds": 2.2113041249103844,+ "inference_and_conditioning_seconds": 803.5369179998524,+ "total_seconds": 918.5559624580201+ },+ "vision_conditioning": {+ "embedding_shape": [+ 1,+ 1026,+ 5120+ ],+ "token_tag_counts": {+ "1": 16,+ "0": 1010+ }+ },+ "vision_processor": {+ "class": "Qwen2VLImageProcessorPil",+ "input_sizes": [+ [+ 768,+ 1344+ ]+ ]+ },+ "vae_conditioning_shape": [+ 576,+ 96+ ],+ "packed_conditioning": {+ "video_shape": [+ 1,+ 21888,+ 96+ ],+ "audio_shape": [+ 1,+ 414,+ 32+ ],+ "position_shape": [+ 23328,+ 3+ ],+ "token_tag_counts": {+ "1": 16,+ "0": 22898,+ "2": 414+ },+ "video_indices": 21888,+ "audio_indices": 414,+ "text_indices": 1026+ },+ "assessment": {+ "assessment": "Synthetic colored scene remains in all five sampled frames with gradual motion; no environment replacement observed.",+ "sampled_frames": [+ 0,+ 1,+ 12,+ 60,+ 123+ ],+ "limitations": "One source and seed; does not establish cause of original report or prove correction unnecessary."+ }+ }+ ],+ "numerical_comparisons": {+ "vision": [+ {+ "output": "0",+ "max_abs": 0.0014982223510742188,+ "relative_rmse": 2.023839442699682e-05+ },+ {+ "output": "1",+ "max_abs": 9.250640869140625e-05,+ "relative_rmse": 3.238409817640786e-06+ },+ {+ "output": "2",+ "max_abs": 0.00018334388732910156,+ "relative_rmse": 8.40186567074852e-06+ },+ {+ "output": "3",+ "max_abs": 0.0001586228609085083,+ "relative_rmse": 1.3319862773641944e-05+ }+ ],+ "vae": [+ {+ "component": "moments",+ "max_abs": 0.005196571350097656,+ "relative_rmse": 2.1912352167419158e-05+ },+ {+ "component": "mean",+ "max_abs": 0.005196571350097656,+ "relative_rmse": 6.197461334522814e-05+ },+ {+ "component": "logvar",+ "max_abs": 0.0007638931274414062,+ "relative_rmse": 9.48718297877349e-06+ }+ ],+ "posterior": {+ "noise": "shared numpy seed 42, not a cross-runtime RNG equivalence claim",+ "max_abs": 0.0030596256256103516,+ "relative_rmse": 0.00012927301577292383+ },+ "rope": [+ {+ "canvas": [+ 576,+ 1024+ ],+ "tokens": 594,+ "position_ids_equal": true,+ "deltas_equal": true+ },+ {+ "canvas": [+ 768,+ 1344+ ],+ "tokens": 1026,+ "position_ids_equal": true,+ "deltas_equal": true+ }+ ],+ "metal": {+ "metal_float32": [+ {+ "max_abs": 0.3889617919921875,+ "relative_rms": 0.0069098739116641465+ },+ {+ "max_abs": 0.04294848442077637,+ "relative_rms": 0.002098090206525768+ },+ {+ "max_abs": 0.08061069250106812,+ "relative_rms": 0.0032742631563013893+ },+ {+ "max_abs": 0.053698569536209106,+ "relative_rms": 0.004997893632723004+ }+ ],+ "metal_bfloat16": [+ {+ "max_abs": 7.328125,+ "relative_rms": 0.13479805751930615+ },+ {+ "max_abs": 0.21875,+ "relative_rms": 0.02156601681498212+ },+ {+ "max_abs": 1.56640625,+ "relative_rms": 0.05828240321293385+ },+ {+ "max_abs": 0.84375,+ "relative_rms": 0.08963928003822243+ }+ ],+ "mlx_precision": [+ {+ "max_abs": 8.266490936279297,+ "relative_rms": 0.15616737397070132+ },+ {+ "max_abs": 0.29004907608032227,+ "relative_rms": 0.022790525684840923+ },+ {+ "max_abs": 1.357074350118637,+ "relative_rms": 0.06249168497483737+ },+ {+ "max_abs": 0.8177890777587891,+ "relative_rms": 0.09388500972561217+ }+ ],+ "vae_metal_float32": {+ "max_abs": 9.131431579589844e-05,+ "relative_rms": 6.772480071158134e-07+ },+ "torch_precision": [+ {+ "max_abs": 6.10191535949707,+ "relative_rms": 0.12328615186624371+ },+ {+ "max_abs": 0.22001886367797852,+ "relative_rms": 0.017396198896349118+ },+ {+ "max_abs": 1.1477556228637695,+ "relative_rms": 0.04867614398458959+ },+ {+ "max_abs": 0.8314730525016785,+ "relative_rms": 0.0753154150934945+ }+ ]+ },+ "definitions": {+ "relative_rms": "norm(actual-reference)/norm(reference); ratios, not percentages",+ "vision_outputs": [+ "merged",+ "deepstack0",+ "deepstack1",+ "deepstack2"+ ],+ "metal_float32": "MLX Metal float32 versus PyTorch CPU float32",+ "metal_bfloat16": "MLX Metal bfloat16 versus PyTorch MPS bfloat16",+ "mlx_precision": "MLX Metal bfloat16 versus MLX Metal float32",+ "torch_precision": "PyTorch MPS bfloat16 versus PyTorch CPU float32",+ "vae_metal_float32": "MLX Metal float32 versus PyTorch CPU float32",+ "limitations": "Component measurements on one synthetic image. No assertion of full language-model equivalence or precision-related scene causality."+ }+ },+ "ltx": {+ "status": "rendered",+ "model": "dgrauet/ltx-2.3-mlx-q8",+ "model_revision": "6671a7572a530862d1d60ce393b5d93491e3f76b",+ "encoder": "mlx-community/gemma-3-12b-it-4bit",+ "encoder_revision": "86cc6a8dedbc456dd0e4af01a9d09f396f77e558",+ "runtime_revision": "1192051fd380e0501adb5f3c0e9a216e679cb123",+ "mlx_version": "0.31.1",+ "pipeline_version": "0.14.19",+ "canvas": [+ 768,+ 1344+ ],+ "frames": 121,+ "fps": 24,+ "steps": [+ 8,+ 3+ ],+ "cfg": 3,+ "seed": 42,+ "prompt": "The camera slowly moves forward. Objects remain stationary.",+ "distilled_adapter": "ltx-2.3-22b-distilled-lora-384-1.1.safetensors",+ "timings": {+ "text_encoder_load_seconds": 2.3,+ "prompt_encoding_seconds": 2.8,+ "transformer_load_seconds": 1.7,+ "stage1_denoise_seconds": 272,+ "stage2_denoise_seconds": 156,+ "decoders_load_seconds": 0.1,+ "video_audio_decode_mux_seconds": 40.3,+ "supervisor_wall_seconds": 480.68088041688316+ },+ "timing_provenance": "Rounded phase times from runtime log, including tqdm elapsed values. Supervisor wall time includes interpreter startup and up to five seconds of polling delay. Runner os._exit bypassed wrapper finally; no separate audio or mux duration is available.",+ "assessment": {+ "sampled_frames": [+ 0,+ 1,+ 12,+ 60,+ 120+ ],+ "observation": "Base colored layout remains but substantial new cartoon figures and markings appear by frame 60 (2.5s) and persist at frame 120. Motion-only prompt does not preserve source content faithfully.",+ "limitations": "One source and seed at PortOS shipped eight-step setting; different denoiser and schedule from H3. No claim that thirty-step upstream defaults or another LTX variant behave identically."+ }+ },+ "portos_revision": "585330fba8724f11daf6d5ea26876987ce7a9e0c"+}diff --git a/docs/research/assets/minimax-h3-continuity/small-motion.png b/docs/research/assets/minimax-h3-continuity/small-motion.pngnew file mode 100644index 0000000000..2c46ba1824Binary files /dev/null and b/docs/research/assets/minimax-h3-continuity/small-motion.png differdiff --git a/docs/research/minimax-h3-continuity.md b/docs/research/minimax-h3-continuity.mdindex b7e6ec4c82..489b85160a 100644--- a/docs/research/minimax-h3-continuity.md+++ b/docs/research/minimax-h3-continuity.md@@ -1,8 +1,15 @@# MiniMax H3 scene-continuity comparison-Issue #8867 remains an investigation. Native image-mode canvas selection landed-in commits `95b864cd1` and `1aba4b504`. It removes a confounding factor; it does-not establish that conditioning is correct or that scene continuity is fixed.+Controlled validation for #8867 found that H3 preserves the tested synthetic+scene with a motion-only prompt at both canvases, while a conflicting prompt+replaces it. The geometry correction follows the reference contract but does+not explain this fixture's continuity: both before and after preserve it.+LTX adds substantial new content even with the motion-only prompt. These are+bounded observations, not a claim that the original private-image failure is+fixed. Production vision-precision differences remain tracked in #8948.++Native image-mode canvas selection landed in commits `95b864cd1` and+`1aba4b504`; it removes a confounding factor without guaranteeing continuity.## Controlled H3 runs@@ -77,11 +84,12 @@ before. The vision features now follow the reference contract. Prompt-embeddingcache keys follow the prepared pixels, so older raw-image entries age out.This fixes a real integration defect, but it is **not a confirmed root cause**-of the scene change: no render has compared the two inputs. The synthetic source-from the diagnostic is already 768×1344, so its native cases never took this-path. VAE normalization/posterior sampling, packed tags and rotary positions+of the scene change: the before/after render below preserves the scene in+both cases. The synthetic source from the diagnostic is already 768×1344,+so its native cases never took this path. VAE normalization/posterior sampling,+packed tags and rotary positionsmatched the reference in structure and are covered by the runtime's own parity-tests. The only other difference found was the image-processor backend,+tests. Another difference found was the image-processor backend,examined next.## Reference parity finding: image-processor backends@@ -134,24 +142,212 @@ The continuity harness now records the backend class and keyframe input sizes as`vision_processor` in each `report.json`. A render can then show which processorread its keyframes and whether they arrived canvas-sized.-## What remains to establish--No real render results accompany this harness. `continuity: not_assessed` stays-explicit even after rendering: inspect the sampled frames and full clip, looking-for the colored room and objects beyond frame 12. Record whether a scene change-occurs and when; first-frame resemblance alone cannot pass the comparison.--Image-processor features are now established as matching on the production-path; see above. VAE normalization/posterior sampling, vision-tower features,-token tags and rotary positions still need a numerical comparison against the-pinned FL2VA reference. That needs the reference's PyTorch weights on a-CUDA or large-memory host. Matching shapes cannot prove those contracts. The-`small-motion` case stretches the 768×1344 source onto 576×1024, so it-exercises the vision-geometry correction. For a before/after comparison, render-it once from this tree and once with `place_keyframes_on_canvas` reverted. Repeat the synthetic-source and motion prompt on an installed image-capable LTX model, with its native-canvas, frame grid and stock encoder; record that model's pins and separate phase-timings. The H3 script intentionally does not imply that an LTX run occurred.-Only the resulting evidence can distinguish model/prompt limitations from an-integration defect and justify either a runtime correction or a user-facing-limitation.+## Hardware validation on 2026-09-27++The controlled motion-only cases now have real renders on Apple M5 Max hardware+with 128 GiB unified memory, using the pinned runtime and checkpoints above.+The PortOS runner source was commit `585330fba8724f11daf6d5ea26876987ce7a9e0c`;+the relevant H3/LTX runners remained unchanged on the final synchronized base.+The production adapter was used without a substitute encoder, LoRA, preview+VAE, or source-frame compositing. Both cases preserve the synthetic scene in+frames 0, 1, 12, 60 and 123 (the last sample is at 5.125 seconds).++| Case | Setup | Conditioning + inference | Video decode | Audio decode | Mux | Total |+| --- | ---: | ---: | ---: | ---: | ---: | ---: |+| 576×1024 motion-only | 30.1 s | 900.9 s | 100.0 s | 4.2 s | 1.2 s | 1036.4 s |+| 768×1344 motion-only | 23.2 s | 1800.1 s | 136.4 s | 1.9 s | 4.4 s | 1966.1 s |+| 768×1344 conflicting prompt | 25.2 s | 1936.5 s | 135.1 s | 1.5 s | 1.8 s | 2100.1 s |+| 576×1024 motion-only, before geometry correction | 21.9 s | 803.5 s | 87.3 s | 3.5 s | 2.2 s | 918.6 s |++These are observed diagnostic wall times, not isolated performance benchmarks.+No competing GPU process was detected. CPU-only numerical reference checks+ran alongside the smaller case, and a brief rotary-index check overlapped the+native case. A short CPU vision-diagnostic reproduction check overlapped the+before-correction run. An earlier attempt was stopped after its API-based exclusivity+monitor timed out; it produced no clip and is excluded from this table. The+successful sequence used a local process monitor instead.++The smaller case had 576 VAE conditioning rows, 594 prompt/vision rows and+22,896 packed rows. The native case had 1,008 VAE conditioning rows, 1,026+prompt/vision rows and 39,744 packed rows. Both recorded canvas-sized keyframes+at the PIL image processor. Across all 124 decoded frames, FFmpeg's largest+adjacent-frame scene score was 0.002499 and 0.001892 respectively. Those scores+support the visual observation of gradual motion; they are not a general+semantic-continuity test.++++++The conflicting prompt preserves the colored scene at 0.5 seconds but replaces+it with snowy pine trees by 2.5 seconds; the final sample is a forest. Thus the+native canvas and valid image-conditioning rows do not prevent prompt-driven+scene replacement. This demonstrates a limitation on this synthetic input,+not the root cause or precise onset of the original private-image report.++++### Before/after geometry correction++A separate 576×1024 run changed only the in-process+`place_keyframes_on_canvas` function to return the original images. The same+source, motion prompt, seed, weights and schedule were used. Its vision encoder+received 768×1344 pixels (1,026 prompt/vision rows), while the VAE still supplied+576 conditioning rows; the packed sequence had 23,328 rows. Thus the test+actually exercised the earlier geometry mismatch.++The colored scene persists in every sampled frame before and after the+correction. Motion differs, but neither clip changes environments. Keep the+correction because it follows the reference's geometry contract; do not call+it a demonstrated continuity fix. Reproduce this diagnostic in a fresh process+by importing `diagnose_minimax_h3` and `generate_minimax_h3` from `scripts`,+setting `generate_minimax_h3.place_keyframes_on_canvas = lambda images, width,+height: images`, then invoking the harness's `run_worker` for `small-motion`+in a fresh directory containing its synthetic `source.ppm`. This is a local+experiment override, never a production setting.++++### Numerical conditioning observations++The actual cached vision and VAE encoder weights were compared on the same+576×1024 canvas-prepared synthetic keyframe, with transformers 5.14.1,+mlx-vlm 0.6.10, MLX 0.32.0 and PyTorch 2.12.0. The reference VAE and its weight+conversion came from the pinned runtime's vendored FL2VA reference. The CPU+float32 comparisons observed:++| Boundary | Maximum absolute difference | Relative RMS difference |+| --- | ---: | ---: |+| Merged vision features | 0.0014983 | 0.002024% |+| Three deepstack feature outputs | ≤0.0001834 | ≤0.001332% |+| VAE posterior mean | 0.0051966 | 0.006198% |+| VAE posterior log variance | 0.0007639 | 0.000949% |+| Sampled, float16-rounded, normalized latents with shared noise | 0.0030597 | 0.012928% |++The shared-noise comparison uses the same NumPy draw for both sets of moments;+it does **not** assert that MLX and PyTorch generate the same noise from seed 42.+Qwen3-VL image/text rotary positions and deltas matched exactly at both tested+canvases (594 and 1,026 tokens). The runtime's packing/scheduler parity checks+also passed against its vendored reference on CPU, including tags, indices,+rotary coordinates and the denoising schedule. These observations narrow the+investigation but do not prove parity of the full conditioning language model+or all production Metal arithmetic.++The Metal float32 VAE moments differ from the CPU reference by at most+0.0000914 (relative RMS 0.000068%). Vision arithmetic is more sensitive:++| Vision comparison | Merged features relative RMS difference | Largest deepstack relative RMS difference |+| --- | ---: | ---: |+| MLX Metal float32 versus PyTorch CPU float32 | 0.6910% | 0.4998% |+| MLX Metal bfloat16 versus PyTorch MPS bfloat16 | 13.4798% | 8.9639% |+| MLX Metal bfloat16 versus its float32 output | 15.6168% | 9.3885% |+| PyTorch MPS bfloat16 versus its CPU float32 output | 12.3286% | 7.5315% |++These are measured differences, **not a passing production-precision parity+claim**. The reference uses eager attention and the MLX implementation uses+fused attention. Both bfloat16 paths differ materially from float32; the test+does not isolate kernel, accumulation, interpolation or rounding effects, nor+show that the difference causes a scene change. No precision correction is+applied on this evidence alone.+The layer-level investigation is tracked in [#8948](https://github.com/atomantic/PortOS/issues/8948).++Reproduce vision outputs with `scripts/diagnose_minimax_h3_vision.py`, using+an interpreter containing the versions above plus torchvision 0.27.0 and+safetensors. Generate the synthetic PPM with the continuity harness first.+Each invocation loads only the actual vision weights, applies the production+MLX weight sanitizer, prepares the same 576×1024 canvas, and saves four arrays+(merged features followed by three deepstack outputs). It enforces offline+loading and refuses to overwrite an output. Run GPU cases sequentially while+other GPU work is stopped:++```sh+<python> scripts/diagnose_minimax_h3_vision.py torch --dtype float32 --device cpu \+ --checkpoint-dir <cached-FL2VA> --source /tmp/h3-continuity-plan/source.ppm \+ --output /tmp/h3-vision-torch-float32.npz+<python> scripts/diagnose_minimax_h3_vision.py mlx --dtype bfloat16 --device gpu \+ --checkpoint-dir <cached-FL2VA> --source /tmp/h3-continuity-plan/source.ppm \+ --output /tmp/h3-vision-mlx-bfloat16.npz+```++Repeat with `mlx/float32/gpu` and `torch/bfloat16/gpu` for the table. For each+array pair, relative RMS is `norm(actual-reference) / norm(reference)`; the+reference is the right-hand side named in the comparison. CPU bfloat16 was+stopped because of slow emulation and supplies no result.++### LTX comparison++The installed `dgrauet/ltx-2.3-mlx-q8` model at+`6671a7572a530862d1d60ce393b5d93491e3f76b` used stock Gemma+`mlx-community/gemma-3-12b-it-4bit` at+`86cc6a8dedbc456dd0e4af01a9d09f396f77e558`, runtime+`1192051fd380e0501adb5f3c0e9a216e679cb123`, pipeline/core 0.14.19 and MLX 0.31.1.+The production adapter rendered the same synthetic source and motion-only+prompt at 768×1344, 121 frames (its 8n+1 frame grid), 24 fps and seed 42.+It used PortOS's shipped eight-step stage-one setting, CFG 3, and three finishing+steps with the pack's `ltx-2.3-22b-distilled-lora-384-1.1.safetensors` adapter.+No user LoRA, preview decoder, streaming or source-frame compositing was used.+This is a different denoiser/schedule from H3, not an equal-quality benchmark.++The original colored layout remains, but the clip adds cartoon figures and+markings by frame 60 (2.5 seconds), persisting at frame 120 (5 seconds). It does+not faithfully preserve the input content under this motion-only prompt.+This shows drift is possible in the installed LTX path too; it does not prove+a shared cause with H3's conflicting-prompt transition, nor characterize other+LTX variants or the upstream thirty-step default.++++| Logged LTX phase | Wall time |+| --- | ---: |+| Text encoder load | 2.3 s |+| Prompt encoding | 2.8 s |+| Transformer load | 1.7 s |+| Stage-one denoising | 272 s |+| Stage-two denoising | 156 s |+| Decoder load | 0.1 s |+| Video/audio decode and mux combined | 40.3 s |+| Supervisor-observed process duration | 480.7 s |++These phase times are rounded runtime-log observations. The supervisor total+includes interpreter startup and up to five seconds of polling delay; unlisted+setup/upscale work is not separately timed. The runner's deliberate `os._exit`+bypassed the wrapper's final timing writer, so no separate audio-decode or mux+duration is claimed. The video was saved successfully and its samples inspected.++Reproduce the LTX render with the installed runtime interpreter and the pinned+model/encoder snapshots above, converting the harness's synthetic PPM to PNG:++```sh+<ltx-python> scripts/generate_ltx2.py --mode image \+ --model <cached-LTX-snapshot> --gemma <cached-Gemma-snapshot> \+ --image <synthetic-source.png> \+ --prompt 'The camera slowly moves forward. Objects remain stationary.' \+ --width 768 --height 1344 --num-frames 121 --fps 24 \+ --steps 8 --stage2-steps 3 --cfg-scale 3 --seed 42 --output <new-video.mp4>+```++## Interpretation and limits++The native-resolution motion-only acceptance case passed on real hardware,+with inspectable frames beyond the opening. The smaller canvas also passed.+The conflicting prompt can override the source environment even with the+native canvas and observed image-conditioning rows. Recommend motion-only+prompts, model-native sizes and whole-clip inspection; image mode is an anchor,+not a promise of persistent scene identity. The Video Gen help exposes this+limitation for MiniMax H3 MLX image mode.++No new conditioning correction is warranted by this experiment. The existing+geometry correction has reference-contract coverage, but the before/after+render supplies no causal evidence for the original scene replacement. Actual+VAE moments, shared-noise normalization, vision features, packed tags and+rotary positions were examined; close float32 results do not erase the measured+bfloat16 vision gap. [#8948](https://github.com/atomantic/PortOS/issues/8948)+owns the layer-level precision investigation before any further adapter change.+The full conditioning language model, arbitrary photographs, other seeds,+and cross-framework diffusion output equivalence were not established.++The harness correctly leaves `continuity: not_assessed` in its raw reports;+visual assessments are separate observations. The [sanitized measurements](assets/minimax-h3-continuity/results.json)+include pins, source hash, shapes, timings and assessments. Full clips and raw+logs remain in the local experiment archive; logs can contain private paths+and must be redacted before sharing. All published frames are synthetic.diff --git a/scripts/diagnose_minimax_h3_vision.py b/scripts/diagnose_minimax_h3_vision.pynew file mode 100644index 0000000000..fa384cfa6e--- /dev/null+++ b/scripts/diagnose_minimax_h3_vision.py@@ -0,0 +1,96 @@+#!/usr/bin/env python3+"""Inspect H3 vision precision with cached weights and a synthetic input (#8867).++Run each backend/device in a separate process with torch, mlx, mlx-vlm and+transformers installed at the versions in docs/research/minimax-h3-continuity.md.+No model downloads or full language-model loads. GPU runs require an idle GPU.+Outputs are observations, not a pass/fail equivalence test; compare the four+arrays with max(abs(reference-actual)) and norm(reference-actual)/norm(reference).+"""+import argparse+import json+import os+import time+from pathlib import Path+++def main():+ p = argparse.ArgumentParser(description=__doc__)+ p.add_argument('backend', choices=['torch', 'mlx'])+ p.add_argument('--device', choices=['cpu', 'gpu'], default='cpu')+ p.add_argument('--dtype', choices=['float32', 'bfloat16'], default='float32')+ p.add_argument('--checkpoint-dir', type=Path, required=True, help='cached FL2VA directory')+ p.add_argument('--source', type=Path, required=True, help='synthetic source.ppm from diagnose_minimax_h3.py')+ p.add_argument('--output', type=Path, required=True, help='new .npz output file')+ a = p.parse_args()+ if a.output.suffix != '.npz':+ p.error('--output must end in .npz')+ if a.output.exists():+ raise SystemExit('Output already exists; choose a new path')+ os.environ['HF_HUB_OFFLINE'] = '1'+ os.environ['TRANSFORMERS_OFFLINE'] = '1'+ import numpy as np+ from PIL import Image+ from safetensors import safe_open+ root = a.checkpoint_dir+ raw = json.loads((root / 'text_encoder/config.json').read_text())['vision_config']+ index = json.loads((root / 'text_encoder/model.safetensors.index.json').read_text())['weight_map']+ keys = {k: v for k, v in index.items() if k.startswith('model.visual.')}+ from transformers import Qwen2VLImageProcessorPil+ processor = Qwen2VLImageProcessorPil.from_pretrained(str(root / 'processor'))+ source = Image.open(a.source).convert('RGB').resize((576, 1024), Image.Resampling.LANCZOS)+ inputs = processor(images=[source], return_tensors='np')+ started = time.perf_counter()+ if a.backend == 'torch':+ import torch+ from transformers.models.qwen3_vl.configuration_qwen3_vl import Qwen3VLVisionConfig+ from transformers.models.qwen3_vl.modeling_qwen3_vl import Qwen3VLVisionModel+ torch.set_num_threads(6)+ cfg = Qwen3VLVisionConfig(**raw)+ cfg._attn_implementation = 'eager'+ with torch.device('meta'):+ model = Qwen3VLVisionModel(cfg)+ weights = {}+ for shard in sorted(set(keys.values())):+ with safe_open(root / 'text_encoder' / shard, framework='pt', device='cpu') as f:+ for k, v in keys.items():+ if v == shard:+ weights[k.removeprefix('model.visual.')] = f.get_tensor(k).to(getattr(torch, a.dtype))+ model.load_state_dict(weights, strict=True, assign=True)+ model.eval()+ from transformers.models.qwen3_vl.modeling_qwen3_vl import Qwen3VLVisionRotaryEmbedding+ # Meta construction leaves this nonpersistent buffer unmaterialized.+ model.rotary_pos_emb = Qwen3VLVisionRotaryEmbedding(cfg.hidden_size // cfg.num_heads // 2)+ device = 'mps' if a.device == 'gpu' else 'cpu'+ model.to(device)+ with torch.inference_mode():+ out = model(torch.from_numpy(inputs['pixel_values']).to(device=device, dtype=getattr(torch, a.dtype)), grid_thw=torch.from_numpy(inputs['image_grid_thw']).to(device))+ arrays = [out.pooler_output] + list(out.deepstack_features)+ arrays = [v.float().cpu().numpy() for v in arrays]+ else:+ import mlx.core as mx+ mx.set_default_device(mx.gpu if a.device == 'gpu' else mx.cpu)+ from mlx.utils import tree_flatten, tree_unflatten+ from mlx_vlm.models.qwen3_vl.config import VisionConfig+ from mlx_vlm.models.qwen3_vl.vision import VisionModel+ from generate_minimax_h3 import sanitize_vision_weights+ model = VisionModel(VisionConfig.from_dict(raw))+ weights = {}+ for shard in sorted(set(keys.values())):+ with safe_open(root / 'text_encoder' / shard, framework='pt', device='cpu') as f:+ for k, v in keys.items():+ if v == shard:+ weights[k.removeprefix('model.visual.')] = mx.array(f.get_tensor(k).float().numpy()).astype(getattr(mx, a.dtype))+ expected = {key for key, _ in tree_flatten(model.parameters())}+ if expected != set(weights):+ raise ValueError('Vision checkpoint keys do not match the MLX model')+ model.update(tree_unflatten(list(weights.items())))+ sanitize_vision_weights(model)+ hidden, deep = model(mx.array(inputs['pixel_values']).astype(getattr(mx, a.dtype)), mx.array(inputs['image_grid_thw'].astype(np.int32)), output_hidden_states=True)+ mx.eval(hidden, deep)+ arrays = [np.array(v.astype(mx.float32)) for v in [hidden] + list(deep)]+ with a.output.open('xb') as output:+ np.savez(output, **{str(i): v for i, v in enumerate(arrays)})+ print(json.dumps({'backend': a.backend, 'dtype': a.dtype, 'device': a.device, 'seconds': time.perf_counter() - started, 'shapes': [list(v.shape) for v in arrays]}))+if __name__ == '__main__':+ main()