You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BandScope needs a commercially admissible, immutable local source-separation model artifact for supported Windows/macOS releases. The current Draft Signal/MIR compatibility path can consume an already-present Demucs htdemucs cache object without hidden network fallback, but #1181 establishes that the upstream pretrained weights are not commercially releasable on the currently documented basis.
This issue owns the Distribution/update artifact contract, not MIR accuracy and not the legal decision itself. #770 remains the scientific real-audio acceptance owner. #1181 owns the upstream pretrained-weight rights prerequisite. Resource Admission/Project Persistence and Signal/MIR must not copy model-delivery logic.
it opens the registered local cache object with no-follow semantics where supported and verifies opened-descriptor identity;
it rejects missing, non-regular, empty, over-limit, or checksum-mismatched cache state before model resolution;
it copies only the admitted descriptor bytes into a private temporary local Demucs repository;
it calls get_model(signature, repo=snapshot_root), keeping upstream resolution on LocalRepo rather than RemoteRepo;
a later deletion or replacement of the original torch-cache pathname therefore cannot change the bytes deserialized for that load or reactivate the remote resolver;
the compatibility snapshot is capped at 128 MiB before materialization;
RED f4ef3dc86e34432936b2febb152991af70e57bd1 → fix 0d0c6c3263e9b72b5aec554c1824de3d004b5831 binds materialization to the descriptor size observed at fstat: early EOF and any extra post-preflight byte fail before resolver/deserialization;
RED 3ae3646087f6fe2ae6a9aa709025720fc40beb6c → fix 0d9fb9f983a093fe3868106945677dfa58d10bba rejects PyTorch's documented TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD downgrade before Demucs import/resolution, so inherited process state cannot turn the upstream implicit checkpoint load into unrestricted pickle deserialization;
RED 4d0b16b6ace0bad9ef5b91fc996034b1ae4001c8 → fix 000fdb57e212be5f08a328bb677be4e0ae1ebb24 rejects PyTorch's documented TORCH_DEVICE_BACKEND_AUTOLOAD=1 before Demucs/torch import, so inherited process state cannot auto-import out-of-tree backend extensions into the CPU-oriented compatibility path.
Upstream code also makes the remaining serialization risk concrete. demucs.states.load_model calls torch.load(path, 'cpu') for path-based packages, then obtains klass, args, kwargs, and state from that serialized package and instantiates the class. That is a code-bearing trusted-artifact boundary, not a passive tensor-file read. PyTorch documents that TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD changes an implicit torch.load to weights_only=False, and separately that TORCH_DEVICE_BACKEND_AUTOLOAD=1 imports out-of-tree backend extensions on import torch. Therefore a release that retains native PyTorch/Demucs loading must own both deserialization and backend-import environment semantics. The private snapshot closes pathname and byte-race problems; it does not make arbitrary checkpoint or backend code execution safe.
These controls are Draft runtime compatibility evidence only. The eight-hex Demucs filename checksum is truncated upstream integrity evidence, and the 128 MiB ceiling is a generic safety limit. Neither is an immutable release manifest, full provenance receipt, commercial-rights basis, or substitute for a safer release serialization boundary.
Required outcome
A supported Windows/macOS BandScope installation contains, or can install through an explicit separately authorized product flow, an immutable source-separation model artifact that ordinary local analysis can open without any implicit remote fallback.
The admitted artifact may be the exact upstream htdemucs weights only if #1181 is resolved by explicit commercial-use/redistribution rights covering the intended BandScope use and distribution. Otherwise Distribution must package a commercially admissible replacement or CWL-owned/retrained model whose model-weight and training-data rights are traceable.
Acceptance criteria
Commercial model-use and redistribution basis is documented with primary evidence for the exact artifact.
Exact model identity/version, exact byte size, full SHA-256 digest or stronger signed manifest, and provenance are immutable release inputs.
The actual shipped model is tracked in supply-chain/supplemental-component-inventory.json; ecosystem SBOM + supplemental inventory + NOTICE explain the packaged desktop contents.
The artifact is packaged into signed Windows and signed/notarized macOS release graphs with deterministic placement and bounded storage.
Ordinary analysis uses a local-only loader that consumes only the verified released artifact. No RemoteRepo, implicit load_state_dict_from_url, hidden model download, paid fallback, or developer torch-cache prerequisite is reachable.
Artifact bytes are verified against the exact release manifest before deserialization/model load; symlink/reparse/path substitution, corrupt/truncated/oversized artifacts, descriptor-size drift, and incompatible app/model versions fail closed with bounded diagnostics.
The updater defines model/app compatibility, migration, rollback, partial-update recovery, and disk-space behavior so app/model versions cannot silently diverge.
Release architecture explicitly chooses the model serialization boundary. Prefer a non-code-executing or materially narrower artifact format such as safetensors/ONNX when it can preserve the required model and metrics. If native Demucs/PyTorch checkpoint deserialization remains necessary, document why, bind it to immutable full-digest/signature provenance, isolate the loader as narrowly as practical, and define a removal condition.
Loader/runtime security semantics cannot be weakened by inherited process environment. If an owned or third-party call still leaves weights_only implicit, TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD and equivalent downgrade controls are rejected or neutralized before deserialization. If the released CPU path does not explicitly package and admit out-of-tree backends, TORCH_DEVICE_BACKEND_AUTOLOAD=1 is rejected before importing torch. Negative tests run on every packaged platform.
Any intentionally supported accelerator/backend is explicit, versioned, packaged, inventoried, signed, and admitted by the release contract; inherited backend autoload is not a capability-discovery mechanism.
No claim that weights_only=True or a filename checksum alone solves this boundary unless the exact packaged model is demonstrated to load under that restriction and the allowed object graph is documented; current upstream Demucs packages include class/constructor metadata.
Distribution owns remote acquisition/package provenance and immutable artifact/backend delivery. Signal/MIR may consume only an admitted local artifact through a narrow verified adapter. #970's torch-cache snapshot and pre-import environment guards are technical compatibility controls, not Distribution authority. #1181 owns whether the upstream pretrained weights are legally admissible at all.
Upstream Demucs LocalRepo narrows where the model is loaded from, but demucs.states.load_model still performs torch.load(path, 'cpu') and consumes serialized class/constructor metadata. PyTorch may also import out-of-tree backend extensions if process environment enables backend autoload. Therefore release trust must be established before those boundaries, or the release model/backend format must remove them. A default-safe PyTorch version is insufficient if inherited process state can reverse deserialization or import defaults.
Realistic threats
missing weights trigger an implicit network fetch;
a compromised, corrupt, oversized, growing, or truncated local object reaches deserialization or exhausts storage;
a symlink/reparse/path substitution changes the model after verification;
a malicious or incorrectly admitted native checkpoint exploits code-bearing deserialization semantics;
inherited TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD state downgrades an implicit third-party checkpoint load to unrestricted pickle;
inherited TORCH_DEVICE_BACKEND_AUTOLOAD=1 causes unadmitted out-of-tree backend extension code to load during torch import;
an app/model/backend update mismatch silently changes separation behavior;
rollback leaves an incompatible artifact or backend;
a scientific-use-only upstream checkpoint is packaged as a commercial dependency;
a mirror/conversion is mistaken for a new rights grant;
logs or artifacts expose local paths or acquisition credentials.
Mitigations
Exact artifact allowlist, exact size, full digest/signature verification, regular-file/no-link or descriptor-bound acquisition, exact-size private materialization, local-only resolver, explicit loader/backend environment policy, rejection of inherited unsafe overrides/autoload, signed release/update manifests, bounded storage, explicit version compatibility, fail-closed offline behavior, rights evidence tied to the artifact, a documented serialization/backend choice and removal condition, and release-time Windows/macOS real-audio execution.
Remaining risk
#970 closes the documented mutable torch-cache reopen/remote-fallback, post-preflight descriptor-size-drift, inherited no-weights-only downgrade, and inherited backend-autoload paths for its Draft compatibility load by resolving an exact-size private snapshot through LocalRepo and refusing unsafe pre-import process state. The remaining release gap is different: the repository still lacks a commercially admitted Distribution-owned model/backend artifact set with full immutable provenance, and #1181 currently blocks commercial use/redistribution of the upstream pretrained htdemucs weights absent an explicit grant.
Native Demucs checkpoint loading also remains a trusted deserialization boundary because upstream load_model uses torch.load and serialized class metadata. A technically sound checksum/snapshot/environment guard cannot by itself remove that risk. Conversely, a rights grant alone cannot replace #770 scientific acceptance, immutable package provenance, serialization/backend hardening, or updater/rollback evidence.
Test points
missing, modified, oversized, size-racing, symlinked, or non-regular compatibility cache object never reaches model resolution;
mutation of the original cache pathname after snapshot acquisition does not change resolver bytes;
truthy TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD cannot reach the implicit upstream loader;
TORCH_DEVICE_BACKEND_AUTOLOAD=1 cannot import an out-of-tree backend on the CPU-oriented released path before admission;
exact release artifact full digest/size/signature mismatch fails before deserialization;
exact release artifact serialization/backend/environment policy is exercised on every supported platform, including negative corrupt/object-graph/downgrade/autoload cases where applicable;
ordinary packaged analysis performs no hidden model or backend network request;
updater interruption and rollback preserve a compatible admitted model/backend set;
Windows/macOS packaged builds execute rights-cleared real audio through the exact released artifact;
Défossez, A., Usunier, N., Bottou, L., & Bach, F. (2021). Music source separation in the waveform domain. Transactions of the International Society for Music Information Retrieval, 4(1), 197–208. https://doi.org/10.5334/tismir.76
Rouard, S., Massa, F., & Défossez, A. (2023). Hybrid transformers for music source separation. Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). https://doi.org/10.1109/ICASSP49357.2023.10097003
Buyer-visible gap
BandScope needs a commercially admissible, immutable local source-separation model artifact for supported Windows/macOS releases. The current Draft Signal/MIR compatibility path can consume an already-present Demucs
htdemucscache object without hidden network fallback, but #1181 establishes that the upstream pretrained weights are not commercially releasable on the currently documented basis.This issue owns the Distribution/update artifact contract, not MIR accuracy and not the legal decision itself. #770 remains the scientific real-audio acceptance owner. #1181 owns the upstream pretrained-weight rights prerequisite. Resource Admission/Project Persistence and Signal/MIR must not copy model-delivery logic.
Current technical baseline
#970 now does more than a path preflight:
get_model(signature, repo=snapshot_root), keeping upstream resolution onLocalReporather thanRemoteRepo;f4ef3dc86e34432936b2febb152991af70e57bd1→ fix0d0c6c3263e9b72b5aec554c1824de3d004b5831binds materialization to the descriptor size observed atfstat: early EOF and any extra post-preflight byte fail before resolver/deserialization;3ae3646087f6fe2ae6a9aa709025720fc40beb6c→ fix0d9fb9f983a093fe3868106945677dfa58d10bbarejects PyTorch's documentedTORCH_FORCE_NO_WEIGHTS_ONLY_LOADdowngrade before Demucs import/resolution, so inherited process state cannot turn the upstream implicit checkpoint load into unrestricted pickle deserialization;4d0b16b6ace0bad9ef5b91fc996034b1ae4001c8→ fix000fdb57e212be5f08a328bb677be4e0ae1ebb24rejects PyTorch's documentedTORCH_DEVICE_BACKEND_AUTOLOAD=1before Demucs/torch import, so inherited process state cannot auto-import out-of-tree backend extensions into the CPU-oriented compatibility path.Upstream code also makes the remaining serialization risk concrete.
demucs.states.load_modelcallstorch.load(path, 'cpu')for path-based packages, then obtainsklass,args,kwargs, andstatefrom that serialized package and instantiates the class. That is a code-bearing trusted-artifact boundary, not a passive tensor-file read. PyTorch documents thatTORCH_FORCE_NO_WEIGHTS_ONLY_LOADchanges an implicittorch.loadtoweights_only=False, and separately thatTORCH_DEVICE_BACKEND_AUTOLOAD=1imports out-of-tree backend extensions onimport torch. Therefore a release that retains native PyTorch/Demucs loading must own both deserialization and backend-import environment semantics. The private snapshot closes pathname and byte-race problems; it does not make arbitrary checkpoint or backend code execution safe.These controls are Draft runtime compatibility evidence only. The eight-hex Demucs filename checksum is truncated upstream integrity evidence, and the 128 MiB ceiling is a generic safety limit. Neither is an immutable release manifest, full provenance receipt, commercial-rights basis, or substitute for a safer release serialization boundary.
Required outcome
A supported Windows/macOS BandScope installation contains, or can install through an explicit separately authorized product flow, an immutable source-separation model artifact that ordinary local analysis can open without any implicit remote fallback.
The admitted artifact may be the exact upstream
htdemucsweights only if #1181 is resolved by explicit commercial-use/redistribution rights covering the intended BandScope use and distribution. Otherwise Distribution must package a commercially admissible replacement or CWL-owned/retrained model whose model-weight and training-data rights are traceable.Acceptance criteria
supply-chain/supplemental-component-inventory.json; ecosystem SBOM + supplemental inventory + NOTICE explain the packaged desktop contents.RemoteRepo, implicitload_state_dict_from_url, hidden model download, paid fallback, or developer torch-cache prerequisite is reachable.weights_onlyimplicit,TORCH_FORCE_NO_WEIGHTS_ONLY_LOADand equivalent downgrade controls are rejected or neutralized before deserialization. If the released CPU path does not explicitly package and admit out-of-tree backends,TORCH_DEVICE_BACKEND_AUTOLOAD=1is rejected before importing torch. Negative tests run on every packaged platform.weights_only=Trueor a filename checksum alone solves this boundary unless the exact packaged model is demonstrated to load under that restriction and the allowed object graph is documented; current upstream Demucs packages include class/constructor metadata.Security Notes
Attack surface
Model artifact acquisition, package extraction, filesystem lookup, integrity verification, inherited loader/backend environment, Python/native extension import, PyTorch/model deserialization, temporary compatibility snapshots, updater replacement, rollback, and release inventory.
Trust boundary
Distribution owns remote acquisition/package provenance and immutable artifact/backend delivery. Signal/MIR may consume only an admitted local artifact through a narrow verified adapter. #970's torch-cache snapshot and pre-import environment guards are technical compatibility controls, not Distribution authority. #1181 owns whether the upstream pretrained weights are legally admissible at all.
Upstream Demucs
LocalReponarrows where the model is loaded from, butdemucs.states.load_modelstill performstorch.load(path, 'cpu')and consumes serialized class/constructor metadata. PyTorch may also import out-of-tree backend extensions if process environment enables backend autoload. Therefore release trust must be established before those boundaries, or the release model/backend format must remove them. A default-safe PyTorch version is insufficient if inherited process state can reverse deserialization or import defaults.Realistic threats
TORCH_FORCE_NO_WEIGHTS_ONLY_LOADstate downgrades an implicit third-party checkpoint load to unrestricted pickle;TORCH_DEVICE_BACKEND_AUTOLOAD=1causes unadmitted out-of-tree backend extension code to load during torch import;Mitigations
Exact artifact allowlist, exact size, full digest/signature verification, regular-file/no-link or descriptor-bound acquisition, exact-size private materialization, local-only resolver, explicit loader/backend environment policy, rejection of inherited unsafe overrides/autoload, signed release/update manifests, bounded storage, explicit version compatibility, fail-closed offline behavior, rights evidence tied to the artifact, a documented serialization/backend choice and removal condition, and release-time Windows/macOS real-audio execution.
Remaining risk
#970 closes the documented mutable torch-cache reopen/remote-fallback, post-preflight descriptor-size-drift, inherited no-weights-only downgrade, and inherited backend-autoload paths for its Draft compatibility load by resolving an exact-size private snapshot through
LocalRepoand refusing unsafe pre-import process state. The remaining release gap is different: the repository still lacks a commercially admitted Distribution-owned model/backend artifact set with full immutable provenance, and #1181 currently blocks commercial use/redistribution of the upstream pretrainedhtdemucsweights absent an explicit grant.Native Demucs checkpoint loading also remains a trusted deserialization boundary because upstream
load_modelusestorch.loadand serialized class metadata. A technically sound checksum/snapshot/environment guard cannot by itself remove that risk. Conversely, a rights grant alone cannot replace #770 scientific acceptance, immutable package provenance, serialization/backend hardening, or updater/rollback evidence.Test points
TORCH_FORCE_NO_WEIGHTS_ONLY_LOADcannot reach the implicit upstream loader;TORCH_DEVICE_BACKEND_AUTOLOAD=1cannot import an out-of-tree backend on the CPU-oriented released path before admission;Traceability
docs/traceability/demucs-local-model-admission.mddocs/traceability/pytorch-runtime-environment-admission.mdReferences
Défossez, A., Usunier, N., Bottou, L., & Bach, F. (2021). Music source separation in the waveform domain. Transactions of the International Society for Music Information Retrieval, 4(1), 197–208. https://doi.org/10.5334/tismir.76
Rouard, S., Massa, F., & Défossez, A. (2023). Hybrid transformers for music source separation. Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). https://doi.org/10.1109/ICASSP49357.2023.10097003
Défossez, A. (2022). Re: License of pre-trained models (Issue comment 1134828611). facebookresearch/demucs (Issue #327). facebookresearch/demucs#327 (comment)
Meta Platforms, Inc. (2023).
demucs.pretrained: loading pretrained models. facebookresearch/demucs. https://github.com/facebookresearch/demucs/blob/v4.0.1/demucs/pretrained.pyMeta Platforms, Inc. (2023).
demucs.repo: remote and local model repositories. facebookresearch/demucs. https://github.com/facebookresearch/demucs/blob/v4.0.1/demucs/repo.pyMeta Platforms, Inc. (2023).
demucs.states: model serialization/loading. facebookresearch/demucs. https://github.com/facebookresearch/demucs/blob/v4.0.1/demucs/states.pyPyTorch Contributors. (2026). Miscellaneous environment variables. PyTorch documentation. https://docs.pytorch.org/docs/stable/miscellaneous_environment_variables.html