比较提交

...
共修改 27 个文件,包含 2631 行新增和 103 行删除

没有与搜索条件相匹配的文件

+115
查看文件
@@ -0,0 +1,115 @@
#!/usr/bin/env python3
"""Package the verified formal Dayu Color installation through the PKG Forge skill."""
import argparse
import datetime
import hashlib
import json
import os
from pathlib import Path
import plistlib
import shutil
import subprocess
ROOT = Path(__file__).resolve().parent.parent
APP = Path("/Library/Plug-Ins/FxPlug/大鱼调色.app")
CACHE = Path.home() / "Library/Caches/CodexBuilds/com.dayu.color"
LOCK = Path.home() / ".codex/app-delivery-locks/com.dayu.color.lock"
def run(*args, cwd=None):
return subprocess.check_output(args, cwd=cwd, text=True, stderr=subprocess.STDOUT).strip()
def history(profile, keychain):
return json.loads(run("xcrun", "notarytool", "history", "--keychain-profile", profile,
"--keychain", keychain, "--output-format", "json"))["history"]
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--pkg-forge-repo", type=Path,
default=Path.home() / "Documents/dayu-git/repositories/pkg-forge")
parser.add_argument("--output-dir", type=Path, default=ROOT.parent / "发行包")
parser.add_argument("--prepare-only", action="store_true")
args = parser.parse_args()
args.output_dir = args.output_dir.expanduser().resolve()
forge = args.pkg_forge_repo.expanduser().resolve()
skill = forge / "skills/pkg-forge/scripts"
assert (skill / "package_fxplug.py").is_file(), "请指定含 pkg-forge 技能的 PKG 工坊 checkout"
delivery = json.loads((ROOT / "verification/Delivery.json").read_text())
info = plistlib.loads((APP / "Contents/Info.plist").read_bytes())
assert delivery["status"] == "verified" and delivery["path"] == str(APP)
assert info["CFBundleIdentifier"] == "com.dayu.color"
assert (info["CFBundleShortVersionString"], info["CFBundleVersion"]) == (delivery["version"], delivery["build"])
args.output_dir.mkdir(parents=True, exist_ok=True)
CACHE.mkdir(parents=True, exist_ok=True)
LOCK.parent.mkdir(parents=True, exist_ok=True)
LOCK.mkdir()
(LOCK / "owner.json").write_text(json.dumps(dict(PID=os.getpid(), cwd=str(ROOT),
product="大鱼调色", phase="PKG packaging", started=datetime.datetime.now(datetime.timezone.utc).isoformat())))
try:
source = APP / "Contents/Resources/FCP Templates"
staged = CACHE / "pkg-inputs/大鱼调色/大鱼调色"
staged.mkdir(parents=True, exist_ok=True)
hashes = {}
for name in ["大鱼调色.moef", "large.png", "small.png"]:
data = (source / name).read_bytes()
assert data == (ROOT / "template" / name).read_bytes(), name
target = staged / name
if target.exists():
os.chflags(target, 0)
target.write_bytes(data)
target.chmod(0o644)
if name.endswith(".png"):
os.chflags(target, 2)
hashes[name] = hashlib.sha256(data).hexdigest()
for folder in [staged, staged.parent]:
folder.chmod(0o755)
keychain = str(Path.home() / "Library/Keychains/login.keychain-db")
profile = "codex-dayu-notary-B3W25FX5H5"
version = info["CFBundleShortVersionString"]
manifest = dict(name="大鱼调色", output=str(args.output_dir / "大鱼调色.pkg"),
identifierPrefix="com.dayu.color.installer", resources=[dict(source=str(APP)),
dict(source=str(staged.parent), destination="~/Movies/Motion Templates.localized/Effects.localized")],
signing=dict(identity="Developer ID Installer: zhong luo (B3W25FX5H5)", profile=profile,
keychain=keychain, notaryKeychain=keychain),
appearance=dict(title="大鱼调色", subtitle="适用于 Final Cut Pro 与 Motion 的原生调色效果",
badgeImage=str(ROOT / "design/dayu-color-app-icon-v1.png"), authorContact="https://dayu.media"),
pages=dict(welcome="安装大鱼调色 " + version + ",包含原生 FxPlug 调色插件和 Final Cut Pro 效果入口。",
readme="系统要求:macOS 14.6 或更高版本。本发行构建适用于 Apple Silicon Mac。\n\n安装内容:\n/Library/Plug-Ins/FxPlug/大鱼调色.app\n登录用户“影片/Motion Templates/Effects/大鱼调色”中的效果模板与预览图。\n\n重新打开 Final Cut Pro 后,在“效果 → 大鱼调色”中应用;Motion 中可选择原生滤镜。\n本安装包不包含用户自选 LUT、预设或媒体文件。",
license="", conclusion="大鱼调色已安装。请完成插件 APP 的系统提示,随后退出并重新打开 Final Cut Pro / Motion。\n如果效果未出现,可在访达打开 /Library/Plug-Ins/FxPlug/大鱼调色.app 后再次启动宿主。"))
manifest_path = CACHE / "dayu-color-package-manifest.json"
manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2) + "\n")
command = ["/usr/bin/python3", str(skill / "package_fxplug.py"), "--repo", str(forge), "--manifest", str(manifest_path)]
subprocess.run(command + ["--check"], check=True)
if args.prepare_only:
print("清单:" + str(manifest_path))
return
before = {x["id"] for x in history(profile, keychain)}
log_path = CACHE / "pkg-release-build.log"
with log_path.open("w") as log:
subprocess.run(command, stdout=log, stderr=subprocess.STDOUT, check=True)
package = args.output_dir / ("大鱼调色-" + version + ".pkg")
report_path = ROOT / "verification/Package.json"
subprocess.run(["/usr/bin/python3", str(skill / "verify_fxplug_package.py"), "--manifest", str(manifest_path),
"--package", str(package), "--report", str(report_path)], check=True)
jobs = [x for x in history(profile, keychain) if x["id"] not in before and x["name"] == package.name]
assert len(jobs) == 1, "安装包已生成,请核对公证 ID;不要重复提交同一包"
job = json.loads(run("xcrun", "notarytool", "info", jobs[0]["id"], "--keychain-profile", profile,
"--keychain", keychain, "--output-format", "json"))
assert job["status"] == "Accepted"
report = json.loads(report_path.read_text())
report.update(notarization=job, appCompiledSource=delivery["sourceCommit"], appBuild=info["CFBundleVersion"],
packageBuilderRemote="https://dayu.media/git/dayu/pkg-forge.git",
packageBuilderCommit=run("git", "rev-parse", "HEAD", cwd=forge), templateSHA256=hashes,
installedAppHostAcceptance=delivery.get("hostVerification", "verification/HostLUTLoading.json"),
installScope="本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。")
report_path.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
print("正式安装包:" + str(package))
finally:
(LOCK / "owner.json").unlink()
LOCK.rmdir()
if __name__ == "__main__":
main()
+13 -1
查看文件
@@ -10,13 +10,17 @@
- [GPU 数学来源与验证](tools/kernels/README.md)
- [正式安装记录](verification/Delivery.json)
- [LUT 后台加载的 FCP 验收](verification/HostLUTLoading.json)
- [N12 外部 LUT 导入与应用验收](verification/HostExternalLUT.json)
- [外部 LUT 问题定位及回归](verification/ExternalLUTActivation.json)
- [LUT 编码兼容与回归](verification/LUTEncoding.json)
- [混合编码 LUT 的 FCP 验收](verification/HostLUTEncoding.json)
- [LUT 加载响应压力测试](verification/LUTResponsiveness.json)
- [程序图标与插件缩略图验收](verification/BrandAssets.json)
- [分组展开与启用验收](verification/HostGroupFolding.json)
- [主题与 LUT 库的 FCP 验收](verification/HostThemeLUT.json)
- [早期调色链的 FCP 验收](verification/Host.json)
当前正式版本为 1.1.3(14),交付标签 `v1.1.3-async-lut-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。
当前正式版本为 1.1.5(16),交付标签 `v1.1.5-lut-encoding-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。
程序图标与 FCP 缩略图采用统一的光谱鱼。两张原始生成图及提示词保存在 `design/`;运行 `python3 tools/build_brand_assets.py` 使用 macOS 工具导出 ICNS、640×360 与 240×135 的效果预览。
@@ -35,3 +39,11 @@
`tools/create_group_fold_host_fixture.py` 可创建独立的合成验收时间线,用于检查新实例仅基础调节默认启用、分组展开/折叠与数值保留。风格 LUT 总组停用会旁路全部五层;停用的输入或风格 LUT 不加载其文件。
LUT 文件夹扫描、逐项校验/复制和选择文件后的解析均在后台执行;导入期间可继续搜索、滚动和选择,刷新按钮临时变为“取消”。失败或取消会移除本次新复制的文件并保留既有库。目录与缩略图只为可见范围创建控件,预览逐项出现;快速切换时仅应用最后一次选择。24个65级合成LUT与3,025项库的响应测试见 [LUTResponsiveness.json](verification/LUTResponsiveness.json)。
1.1.4 修复外部 Cube 的旧编码标题导致整批导入失败:标题、注释兼容旧编码,尺寸和数值仍严格校验,报错包含文件名。点击缩略图时先在后台解析并准备 GPU 纹理,宿主接受后才确认选择;已选表独立保留,不受缩略图缓存淘汰影响。用户提供的 N12 目录 26 个 LUT 已全部导入、生成缩略图并完成 Metal 渲染,FCP 中两份“青橙色”、64 级 LUT、快速切换和保存重开通过。用户 LUT 不进入源码或安装包。
1.1.5 增加整份 Cube 的 UTF-16/UTF-32 大小端、有无 BOM 识别,在后台转换工作副本,保留导入文件的原始字节。支持常见换行及 Unicode 空白,标题、注释继续兼容 ASCII 指令下的旧编码。16 份 UTF-8/16/32 与 GB18030、Big5、Shift JIS、Windows-1252、MacRoman、ISO-8859-1 样本已在 FCP 中全部导入、预览和逐项应用,无 BOM UTF-32 保存重开通过。损坏的编码、非法数字仍会报错,不使用有损转码猜测颜色值。
正式 PKG 打包使用 PKG 工坊源码中的 `pkg-forge` 技能。运行 `python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录`,默认输出到上级“发行包”目录;先使用 `--prepare-only` 可只检查清单。打包使用已验证的正式 APP,并从相同 APP 资源中核对、整理 FCP 模板与缩略图,不重签或重建调色 APP。生成包将要求正常退出四种 FCP/Motion 宿主并在登录用户会话验证注册;签名公证和真实展开验包由该技能的原打包器与校验器完成。已有同名版本包不会覆盖。
当前正式安装包:[大鱼调色-1.1.5.pkg](../发行包/大鱼调色-1.1.5.pkg),包含1.1.5(16)正式APP及相同版本的FCP模板/预览图;本机Apple Silicon,最低macOS14.6。签名、公证与20项真实展开验包记录见 [Package.json](verification/Package.json)。本轮没有重复执行系统安装;包内APP与已验收的正式安装逐字节一致。
+58 -2
查看文件
@@ -4,7 +4,11 @@
初始化基线:10987dd6bcc6986ea321eff75b37d4e8b48e966d;后续节点见git log。
产品主ID:com.dayu.color,XPC:com.dayu.color.XPC;唯一正式位置:/Library/Plug-Ins/FxPlug/大鱼调色.app。
当前交付标签:v1.1.3-async-lut-20261101。APP 1.1.3(14)编译源码:6452e793f974234b5ffffdfad5dc3ddeee64d53c;标签另含最终宿主验收与恢复记录。Apple 公证 ID d47784c7-7cad-4837-93ab-9bce5d8c19da,Accepted;正式签名、票据、Gatekeeper 与唯一安装均通过,见 verification/Delivery.json。
当前交付标签:v1.1.5-lut-encoding-20261101。APP 1.1.5(16)编译源码:59b058a3c8b9e5387381574da6bbc05af437527c;标签另含最终宿主验收与恢复记录。Apple 公证 ID b47b6fe8-b7a9-4112-93b9-de85b03ca598,Accepted;正式签名、票据、Gatekeeper 与宿主重开均通过,见 verification/Delivery.json 和 verification/HostLUTEncoding.json。
外部LUT版本 v1.1.4-external-lut-20261101 保留,编译源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14,原公证ID d9d9b05a-58b5-4a7a-aac2-6433b87d901d。
后台加载版本 v1.1.3-async-lut-20261101 保留,编译源码6452e793f974234b5ffffdfad5dc3ddeee64d53c,原公证ID d47784c7-7cad-4837-93ab-9bce5d8c19da。
分组折叠版本 v1.1.2-group-fold-20261031 保留,编译源码 cdcb30a6aa1519bfb2f183165fef11cbf278bc7c,原公证 ID 398b020c-9e1e-4c2b-b637-e8e3af2a8f59。
@@ -20,7 +24,7 @@ FCP12.4正式安装版本的11组标题/眼睛联动、隐藏参数、黑白红4
本次编译节点的远端独立克隆116个已提交文件比对、strict/full fsck、从源码与本机SDK重建原生模型注册信息及FCP模板逐字节一致,见 verification/GroupFoldingRecovery.json。当前模板 SHA256:ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1。
图标版本的远端独立克隆113文件比对、strict/full fsck和三种导出资源逐字节重建见 verification/BrandRecovery.json。主题/LUT源码的完整 XPC Release 重建和73项原生自检见 verification/ThemeLUTRecovery.json;本次Release送公证前及正式安装后均通过82项原生自检,正式结果见 verification/InstalledSelfTest.json。重建 Metal SHA256:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。构建只使用仓库内的源码与资源。
图标版本的远端独立克隆113文件比对、strict/full fsck和三种导出资源逐字节重建见 verification/BrandRecovery.json。主题/LUT源码的完整 XPC Release 重建和73项原生自检见 verification/ThemeLUTRecovery.json;当前Release送公证前及正式安装后均通过92项原生自检,正式结果见 verification/InstalledSelfTest.json。重建 Metal SHA256:9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132。构建只使用仓库内的源码与资源。
## 恢复和构建
@@ -73,3 +77,55 @@ verification/LUTResponsiveness.json 记录同一组 24 个 65³ 合成 LUT(197
远端编译源码 6452e793f974234b5ffffdfad5dc3ddeee64d53c 独立恢复129个已提交文件逐字节一致、strict/full fsck、从恢复源码重建92项库检查通过,见 verification/AsyncLUTRecovery.json。Release 送公证前与正式安装后82项 Metal/IOSurface原生集成检查通过。无需读取外部目标程序,模型 ABI、模板及 Metal 数学库未变。
运行 python3 tools/create_async_lut_host_fixture.py --cancel-pack 可在产品缓存重建24个65³导入样本和192个硬链接取消样本,不自动写入用户库;运行 tools/verify_lut_responsiveness.mm 构建出的独立检查器可重测响应。完整 VoiceOver、旧系统、Intel、网络卷未作验收;SwiftUI 专用审查对现有 AppKit 实现不适用。
## 外部 LUT 与旧编码目录修复(2026-11-01)
1.1.4(15)先在后台解码并上传 GPU,宿主写入成功后才确认缩略图选择。不可变表独立于缩略图缓存保留;测试中删除已选65³源文件、再加载14个其他表淘汰缓存,仍可输出逐像素一致的画面。预览采用 utility 优先级,当前选择采用 user-initiated 优先级;GPU 设备0和真实 registry ID复用相同设备资源。恢复旧工程时未准备的路径仍可能在渲染工作线程首次加载,不能把此结果解释为任何恢复场景都不读文件。
实际 N12精选luts 包含26个真实Cube、91,960,032字节,维度16/17/32/33/64。“青橙色.cube”和“青橙色2.cube”含非UTF-8描述性TITLE,旧版因此将整批导入中止。修复只放宽标题/注释编码,尺寸、DOMAIN和数字尾部继续校验;原文件和导入副本逐字节一致。文件系统另有AppleDouble元数据,Foundation枚举未把它们作为本次LUT输入,它们不是此次故障原因。
真实目录隔离导入26/26、全部缩略图通过,主循环最大空档6.275毫秒;真实原目录及正式安装后用户库副本分别通过171项Metal/IOSurface检查。合成库回归112项通过;浏览器与宿主确认状态、取消、快速切换等67项通过,24个65³文件导入7.681秒,主循环最大空档6.696毫秒。量化数据是本机运行循环测试,不能当作所有机器和存储的性能承诺。结果见verification/ExternalLUTActivation.json。
正式安装的FCP12.4中已看到N12目录完整26项,全部导入副本核对一致;实际应用青橙色两份及64³文件、搜索、连续切换、清除、正常退出重开均通过。验收开始时目录已在用户操作后导入,未重复导入。原有4个LUT保留,N12的26个导入副本保留;恢复验收前用户选中的“复古-大白鲨”、空搜索及N12目录,不改第一段其他插件效果。未捕获先前未指定文件的卡死现场,因此仅就这些实际文件和已检查路径报告通过。
源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14从远端独立恢复133个已提交文件、strict/full fsck、恢复源码重编译112项库检查通过,见verification/ExternalLUTRecovery.json。LUT文件未进入Git或PKG,新机器须另行搬移用户库。
真实目录复测可用tools/verify_external_lut_folder.mm与DYLUTLibrary.mm,链接Foundation、AppKit和zlib构建;调用参数为源目录及报告JSON。该工具只读源文件并使用独立临时库,完成后清理。正式XPC的--self-test可选环境变量DY_DIAGNOSTIC_LUT_FOLDER指向实际LUT目录,逐文件准备和渲染;正常插件运行不读取这个诊断变量。
## Cube 文本编码兼容(2026-11-01)
1.1.5(16)支持 UTF-8 BOM/无BOM、UTF-16 LE/BE 与 UTF-32 LE/BE 的有无BOM文件。无BOM时只根据可识别的Cube起始内容判断字节序,不任意删除NUL字节。宽字符解码在后台进行,每约16KB检查取消;合法字符转换为工作副本,导入仍逐字节复制原文件。中文、日文与非BMP标题已覆盖。ASCII兼容的GB18030、Big5、Shift JIS、Windows-1252、MacRoman和ISO-8859-1标题/注释不要求UTF-8;无需为了显示标题而猜测这些编码。
LF、CRLF、CR、Unicode横向空白和宽字符文本中的Unicode换行已覆盖。截断单元、非法UTF-16代理对、UTF-32越界/代理值、宽字符NUL和非法数值不会通过有损转换绕过校验;维度2–128与单文件256MB限制保持。未增加其他LUT文件格式或承诺所有历史字符集。模型、GPU数学和二进制dylut未变。
独立编码回归报告179项通过,混合编码40文件异步导入含54,925,360字节UTF-32 65³样本,主循环最大空档6.283毫秒;核心库112项、浏览器67项通过。ASCII快速路径保留普通LUT速度:24个65³合成文件导入7.526秒,主循环最大空档6.3毫秒。N12原26个实际LUT导入与缩略图回归通过。正式APP自检92项通过,16份33³编码样本的实际Metal渲染检查141项通过。详见verification/LUTEncoding.json。
FCP12.4通过原生文件夹选择框导入全部16个UTF-8/16/32与旧编码样本,缩略图和逐项应用全部通过;UTF-32 BE无BOM路径保存、正常退出重开仍生效。验收后恢复用户原“复古-大白鲨”、N12目录和空搜索,仅按清单摘要删除16个测试导入副本;原有30个LUT逐字节不变,N12的26项保留。详情见verification/HostLUTEncoding.json。本轮未强制退出宿主或改动第一片段的其他插件。
源码59b058a3c8b9e5387381574da6bbc05af437527c已从远端独立恢复138文件、strict/full fsck,恢复源码重建112项库及179项编码回归通过,见verification/LUTEncodingRecovery.json。tools/create_lut_encoding_fixture.py在固定产品缓存重建16个合成宿主样本,不自动导入用户库;tools/verify_lut_encoding.mm与DYLUTLibrary.mm链接Foundation、AppKit和zlib可重测编码/取消/字节保留。正式XPC的DY_DIAGNOSTIC_LUT_FOLDER诊断方式同前。
## 正式 PKG(2026-11-01)
当前安装包:上级发行包/大鱼调色-1.1.5.pkg,13,752,153字节,SHA256 bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071。Apple公证ID 90a38636-93bb-4693-8db2-16b9a815e409,Accepted;Installer团队B3W25FX5H5、可信时间戳、票据、Gatekeeper和20项真实展开验包通过。包内APP与1.1.5(16)正式安装逐字节一致,宿主验收为verification/HostLUTEncoding.json。源码技能采用191da9dc0abfda83fcc5939f6fc90e4c9019f4d9,发行标签v1.1.5-lut-encoding-20261101同时包含应用和PKG记录。
APP编译源码59b058a3c8b9e5387381574da6bbc05af437527c;恢复后先完成APP正式交付,再运行Packaging/build_pkg.py。没有再次执行本PKG的系统安装。当前包不含用户LUT、测试LUT、媒体或偏好;本轮生成的APP、旧版备份、解包/打包暂存和公证ZIP均已核对清理。历史包保留。
### 历史 1.1.4 安装包
安装包:上级发行包/大鱼调色-1.1.4.pkg,13,750,251字节,SHA256 b078fc5a86763edeab07002eb00dd13355d28a5c61bb4bed487eb93c0a8b316d。Apple公证ID 1b7bbefe-956c-45bd-8a68-cd6720a9c00d,Accepted;Installer团队B3W25FX5H5、可信时间戳、票据、Gatekeeper和20项真实展开验包通过。包内APP与1.1.4(15)正式安装逐字节一致,宿主验收为verification/HostExternalLUT.json。源码技能采用191da9dc0abfda83fcc5939f6fc90e4c9019f4d9,发行标签v1.1.4-external-lut-20261101同时包含应用和PKG记录。
APP编译源码497eef29fe8eaa5fb7025aa045b6dfa46a9acc14;恢复后先完成APP正式交付,再运行Packaging/build_pkg.py。没有再次执行本PKG的系统安装,不能将结构验包描述为安装脚本已经实际运行。原1.1.3安装包与历史标签保留;当前包不含N12 LUT、用户媒体或偏好。旧版14备份由管理员所有,已在系统管理员授权后清理;本轮生成的APP、解包/打包暂存和公证ZIP均已核对清理。
### 历史 1.1.3 安装包
安装包:上级发行包/大鱼调色-1.1.3.pkg,13,742,355字节,SHA256 2538d513debe9357b4cb78cc7de96783390b41133ad6d1bacf99ed42b18d470c。Apple 公证 ID 70a315dc-5741-45f2-95fa-875454447177,Accepted;Developer ID Installer团队B3W25FX5H5、可信时间戳、票据与Gatekeeper install通过。发行记录标签 v1.1.3-pkg-20261101。
打包脚本 Packaging/build_pkg.py,编写节点2bb062c82fcd7eddcba742f7324c662c079bf13c;复用 https://dayu.media/git/dayu/pkg-forge.git 的6d4266efbf85d13582a5d9d97f492273872128f4节点内 skills/pkg-forge 技能。恢复该源码并准备已公证正式APP及本机独立签名凭据后运行:
python3 Packaging/build_pkg.py --pkg-forge-repo /实际/PKG工坊源码目录 --output-dir /新的发行目录
新机器需先按前述编译源码6452e793f974234b5ffffdfad5dc3ddeee64d53c恢复、正式签名公证并安装APP;打包不会替APP重签。默认输出已有同版本包时停止,不覆盖历史包。
包内完整APP固定至/Library/Plug-Ins/FxPlug/大鱼调色.app;模板分类文件夹及3个必要文件单独安装至登录用户的Motion Templates效果目录,预览锁恢复命令已核对。四种FCP/Motion must-close、root授权、桌面与Bundle ID前置检查、用户GUI注册worker、逐插件真实验证调用、连续验证、修复、成功/失败均显示目录、禁止relocation、欢迎与结束页均通过实际展开检查。包内APP与正式APP全部文件/符号链接一致,APP独立签名票据和Gatekeeper通过。
系统安装器介绍页、说明页及光谱鱼角标已预览;没有执行安装动作,不宣称本PKG实际安装流程/注册或旧系统已验收。已有正式APP的FCP保存重开等验收仍见HostLUTLoading.json。包、用户媒体和凭据不进入源码Git;重建的签名时间戳、随机组件ID与公证票据会使PKG摘要不同。完整验包结果见verification/Package.json。
打包技能清理修正:当前推荐技能标签skill-pkg-forge-20261101-r2,节点191da9dc0abfda83fcc5939f6fc90e4c9019f4d9。最初生成正式包所用6d4266e保留为真实来源;修正版只增加唯一组件ID关联的暂存清理,不改原PackageBuilder或正式包内容。旧版打包器因保护预览留下的两份载荷及本次探针副本已按任务ID核实清理;修正版真实测试完成后无本任务APP暂存,源预览锁保留。补充交付记录标签v1.1.3-pkg-20261101-r2;初次PKG标签保留。
+40
查看文件
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""Rebuild synthetic encoding fixtures in the fixed product cache, never user LUTs."""
from pathlib import Path
import hashlib
import json
ROOT = Path.home() / "Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/编码兼容验收"
def main():
ROOT.mkdir(parents=True, exist_ok=True)
matrix = [("utf-8", False), ("utf-8", True)]
matrix += [(codec, bom) for codec in ("utf-16-le", "utf-16-be", "utf-32-le", "utf-32-be") for bom in (False, True)]
matrix += [(codec, False) for codec in ("gb18030", "big5", "shift_jis", "cp1252", "mac_roman", "iso8859-1")]
marks = {"utf-8": b"\xef\xbb\xbf", "utf-16-le": b"\xff\xfe", "utf-16-be": b"\xfe\xff",
"utf-32-le": b"\xff\xfe\0\0", "utf-32-be": b"\0\0\xfe\xff"}
previous = ROOT / "fixtures.json"
known = json.loads(previous.read_text())["files"] if previous.exists() else []
known = {item["file"]: item["sha256"] for item in known}
rows = []
for index, (codec, bom) in enumerate(matrix):
title = "Unicode 中文 🎬" if codec.startswith("utf-") else "中文標題" if codec in ("gb18030", "big5") else "日本語" if codec == "shift_jis" else "Café"
newline = ("\n", "\r\n", "\r")[index % 3]
name = codec.upper() + ("-BOM" if bom else "-NoBOM") + ".cube"
text = [f'TITLE "{title}"', '# Encoding compatibility fixture only', 'LUT_3D_SIZE 33', 'DOMAIN_MIN 0 0 0', 'DOMAIN_MAX 1 1 1']
gain = .7 + .04 * index
text.extend(f"{x/32*gain:.7f} {y/32:.7f} {z/32:.7f}" for z in range(33) for y in range(33) for x in range(33))
data = (marks[codec] if bom else b"") + (newline.join(text) + newline).encode(codec)
target = ROOT / name
if target.exists():
assert hashlib.sha256(target.read_bytes()).hexdigest() == known.get(name), f"Existing fixture changed; preserve it: {target}"
target.write_bytes(data)
rows.append(dict(file=name, codec=codec, bom=bom, sha256=hashlib.sha256(data).hexdigest(), bytes=len(data), dimension=33))
report = dict(synthetic=True, sourceFolder=str(ROOT), files=rows, count=len(rows), bytes=sum(x["bytes"] for x in rows))
previous.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n")
print(json.dumps({k: v for k, v in report.items() if k != "files"}, ensure_ascii=False))
if __name__ == "__main__":
main()
+51
查看文件
@@ -0,0 +1,51 @@
#import <AppKit/AppKit.h>
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
#include <CommonCrypto/CommonDigest.h>
// Read user-provided files in place; only import into a unique disposable library.
static NSString *digest(NSURL *url) {
NSData *data=[NSData dataWithContentsOfURL:url];if(!data)return @"unreadable";
unsigned char bytes[CC_SHA256_DIGEST_LENGTH];CC_SHA256(data.bytes,(CC_LONG)data.length,bytes);
NSMutableString *hex=[NSMutableString string];for(unsigned char byte:bytes)[hex appendFormat:@"%02x",byte];return hex;
}
int main(int argc,const char **argv){@autoreleasepool{
if(argc!=3){fprintf(stderr,"usage: verify-external-lut-folder <folder> <report.json>\n");return 2;}
NSFileManager *fm=NSFileManager.defaultManager;NSURL *source=[NSURL fileURLWithPath:[NSString stringWithUTF8String:argv[1]]];
NSMutableArray *files=[NSMutableArray array],*rows=[NSMutableArray array];NSUInteger sidecars=0;
for(NSURL *url in [fm enumeratorAtURL:source includingPropertiesForKeys:@[NSURLIsRegularFileKey] options:0 errorHandler:nil]){
if([url.lastPathComponent hasPrefix:@"._"]){sidecars++;continue;}
NSNumber *regular=nil;[url getResourceValue:&regular forKey:NSURLIsRegularFileKey error:nil];
if(regular.boolValue&&[url.pathExtension.lowercaseString isEqual:@"cube"])[files addObject:url];
}
[files sortUsingComparator:^NSComparisonResult(NSURL *a,NSURL *b){return [a.path localizedStandardCompare:b.path];}];
BOOL parsedAll=files.count>0;NSMutableDictionary *originalHashes=[NSMutableDictionary dictionary];
for(NSURL *url in files){@autoreleasepool{
NSError *error=nil;std::vector<float> values;NSUInteger size=0;BOOL parsed=DYLUTReadCube(url.path,values,size,&error);parsedAll&=parsed;
originalHashes[url.lastPathComponent]=digest(url);
[rows addObject:@{@"file":url.lastPathComponent,@"dimension":@(size),@"parsed":@(parsed),@"error":error.localizedDescription?:@""}];
}}
NSURL *temporary=[NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[@"dayu-external-lut-folder-" stringByAppendingString:NSUUID.UUID.UUIDString]]];
DYLUTLibrary *library=[[DYLUTLibrary alloc]initWithRootURL:[temporary URLByAppendingPathComponent:@"library"]];
__block BOOL done=NO;__block NSUInteger importedCount=0;__block NSError *importError=nil;
__block double last=NSProcessInfo.processInfo.systemUptime,maxGap=0;__block NSUInteger ticks=0;
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *t){double now=NSProcessInfo.processInfo.systemUptime;maxGap=MAX(maxGap,now-last);last=now;ticks++;(void)library.entries;}];
NSProgress *task=[library importURLsAsync:@[source] completion:^(NSArray *imported,NSError *error){importedCount=imported.count;importError=[error retain];done=YES;}];
double deadline=NSProcessInfo.processInfo.systemUptime+120;
while(!done&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
[timer invalidate];if(!done)[task cancel];
BOOL thumbnails=done&&!importError&&importedCount==files.count,identical=thumbnails;
if(done&&!importError)for(NSDictionary *entry in library.entries){@autoreleasepool{
NSError *error=nil;thumbnails&=DYLUTThumbnail(entry[@"path"],nil,0,0,NSMakeSize(64,36),&error)!=nil;
identical&=[digest([NSURL fileURLWithPath:entry[@"path"]])isEqual:originalHashes[[entry[@"path"]lastPathComponent]]];
}}
BOOL originalUnchanged=YES;for(NSURL *url in files)originalUnchanged&=[digest(url)isEqual:originalHashes[url.lastPathComponent]];
BOOL pass=done&&parsedAll&&!importError&&importedCount==files.count&&thumbnails&&identical&&originalUnchanged&&maxGap<.15;
NSDictionary *report=@{@"pass":@(pass),@"sourceFolder":source.path,@"sourceFiles":@(files.count),@"appleDoubleSidecars":@(sidecars),@"files":rows,
@"plannedFiles":@(MAX((int64_t)0,task.totalUnitCount)/2),@"importedFiles":@(importedCount),@"importError":importError.localizedDescription?:@"",
@"allThumbnailsGenerated":@(thumbnails),@"importedContentsIdentical":@(identical),@"sourceFilesUnchanged":@(originalUnchanged),
@"mainHeartbeatMaxGapMS":@(maxGap*1000),@"mainHeartbeatTicks":@(ticks),@"userLibraryModified":@NO,
@"scope":@"User-supplied LUTs read only; isolated library import and thumbnail generation. No LUT data redistributed, no GUI or host parameter edits."};
NSData *json=[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:nil];[json writeToFile:[NSString stringWithUTF8String:argv[2]] atomically:YES];
if(done&&[fm fileExistsAtPath:temporary.path])[fm removeItemAtURL:temporary error:nil];[library release];[importError release];
printf("%s: %lu sources, %lu imported\n",pass?"PASS":"FAIL",(unsigned long)files.count,(unsigned long)importedCount);return pass?0:1;
}}
+56
查看文件
@@ -0,0 +1,56 @@
#import <AppKit/AppKit.h>
#import "../大鱼调色/Plugin/DYLUTLibrary.h"
#include <cmath>
static NSMutableArray *checks;
static void need(BOOL pass,NSString *name){[checks addObject:@{@"name":name,@"pass":@(pass)}];if(!pass){fprintf(stderr,"FAIL %s\n",name.UTF8String);exit(1);}}
static NSString *cube(NSUInteger n){
NSMutableString *s=[NSMutableString stringWithString:@"# 中文 / 日本語 / café / 🎨\nTITLE \"Unicode 🎬\"\nLUT_3D_SIZE "];[s appendFormat:@"%lu\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n",(unsigned long)n];
for(NSUInteger z=0;z<n;z++)for(NSUInteger y=0;y<n;y++)for(NSUInteger x=0;x<n;x++)[s appendFormat:@"%.7e %.7e %.7e # value\n",double(x)/(n-1)*.8,double(y)/(n-1),double(z)/(n-1)];return s;
}
static NSData *encoded(NSString *text,NSStringEncoding encoding,BOOL bom){
NSMutableData *d=[NSMutableData data];
if(bom){const uint8_t le16[]={0xff,0xfe},be16[]={0xfe,0xff},le32[]={0xff,0xfe,0,0},be32[]={0,0,0xfe,0xff},utf8[]={0xef,0xbb,0xbf};
if(encoding==NSUTF16LittleEndianStringEncoding)[d appendBytes:le16 length:2];else if(encoding==NSUTF16BigEndianStringEncoding)[d appendBytes:be16 length:2];
else if(encoding==NSUTF32LittleEndianStringEncoding)[d appendBytes:le32 length:4];else if(encoding==NSUTF32BigEndianStringEncoding)[d appendBytes:be32 length:4];else [d appendBytes:utf8 length:3];}
[d appendData:[text dataUsingEncoding:encoding]];return d;
}
static void pump(BOOL (^done)(void)){double end=NSProcessInfo.processInfo.systemUptime+90;while(!done()&&NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];need(done(),@"asynchronous operation completes");}
int main(int argc,const char **argv){@autoreleasepool{
if(argc!=2)return 2;checks=[NSMutableArray new];NSFileManager *fm=NSFileManager.defaultManager;NSError *error=nil;
NSURL *root=[NSURL fileURLWithPath:[NSTemporaryDirectory()stringByAppendingPathComponent:[@"dayu-lut-encoding-" stringByAppendingString:NSUUID.UUID.UUIDString]]];NSURL *valid=[root URLByAppendingPathComponent:@"Valid"];
need([fm createDirectoryAtURL:valid withIntermediateDirectories:YES attributes:nil error:&error],@"create isolated encoding fixtures");
NSString *base=cube(2);float pixel[]={.37,.28,.81,1};NSData *input=[NSData dataWithBytes:pixel length:sizeof(pixel)];
NSURL *baseline=[root URLByAppendingPathComponent:@"Baseline.cube"];need([base writeToURL:baseline atomically:YES encoding:NSUTF8StringEncoding error:&error],@"write independent UTF-8 baseline");NSData *reference=DYLUTTransformRGBA(input,1,1,baseline.path,&error);need(reference!=nil,@"baseline color result");
NSArray *encodings=@[@(NSUTF8StringEncoding),@(NSUTF16LittleEndianStringEncoding),@(NSUTF16BigEndianStringEncoding),@(NSUTF32LittleEndianStringEncoding),@(NSUTF32BigEndianStringEncoding)];
NSUInteger count=0;NSMutableDictionary *originals=[NSMutableDictionary dictionary];
for(NSNumber *e in encodings)for(NSNumber *bom in @[@NO,@YES])for(NSString *newline in @[@"\n",@"\r\n",@"\r"]){@autoreleasepool{
NSString *name=[NSString stringWithFormat:@"Encoding-%02lu.cube",(unsigned long)count++];NSURL *url=[valid URLByAppendingPathComponent:name];NSData *data=encoded([base stringByReplacingOccurrencesOfString:@"\n" withString:newline],e.unsignedIntegerValue,bom.boolValue);
need([data writeToURL:url atomically:YES],name);originals[name]=data;
need([DYLUTTransformRGBA(input,1,1,url.path,&error)isEqual:reference],[name stringByAppendingString:@" exact numeric equivalence"]);
need(DYLUTThumbnail(url.path,nil,0,0,NSMakeSize(32,18),&error)!=nil,[name stringByAppendingString:@" thumbnail"]);
}}
// Unicode horizontal spacing is valid around commands and numeric tokens.
NSString *spaced=[base stringByReplacingOccurrencesOfString:@" " withString:@"\u00a0"];
for(NSNumber *e in encodings){NSString *name=[NSString stringWithFormat:@"Spacing-%lu.cube",(unsigned long)e.unsignedIntegerValue];NSData *data=encoded(spaced,e.unsignedIntegerValue,NO);NSURL *url=[valid URLByAppendingPathComponent:name];need([data writeToURL:url atomically:YES],name);originals[name]=data;need([DYLUTTransformRGBA(input,1,1,url.path,&error)isEqual:reference],[name stringByAppendingString:@" nonbreaking spaces"]);}
for(NSNumber *e in [encodings subarrayWithRange:NSMakeRange(1,4)]){NSString *name=[NSString stringWithFormat:@"UnicodeLines-%lu.cube",(unsigned long)e.unsignedIntegerValue];NSString *text=[base stringByReplacingOccurrencesOfString:@"\n" withString:@"\u2028"];NSData *data=encoded(text,e.unsignedIntegerValue,YES);NSURL *url=[valid URLByAppendingPathComponent:name];need([data writeToURL:url atomically:YES],name);originals[name]=data;need([DYLUTTransformRGBA(input,1,1,url.path,&error)isEqual:reference],[name stringByAppendingString:@" Unicode line separators"]);}
// Explicit bytes keep this independent of the decoder being exercised.
NSArray *bad=@[[NSData dataWithBytes:"\xff\xfe\x54" length:3],[NSData dataWithBytes:"\xfe\xff\x54" length:3],
[NSData dataWithBytes:"\xff\xfe\x00\xd8" length:4],[NSData dataWithBytes:"\xff\xfe\x00\xdc" length:4],
[NSData dataWithBytes:"\xff\xfe\x00\xd8\x41\x00" length:6],
[NSData dataWithBytes:"\x00\x00\xfe\xff\x00\x11\x00\x00" length:8],
[NSData dataWithBytes:"\xff\xfe\x00\x00\x00\xd8\x00\x00" length:8],
[NSData dataWithBytes:"\x00\x00\xfe\xff\x00\x00\x00" length:7],
[NSData dataWithBytes:"\xff\xfe\x00\x00\x00\x00\x00\x00" length:8]];
NSUInteger badIndex=0;for(NSData *data in bad){NSURL *url=[root URLByAppendingPathComponent:[NSString stringWithFormat:@"Malformed-%lu.cube",(unsigned long)badIndex++]];need([data writeToURL:url atomically:YES],@"write malformed Unicode fixture");std::vector<float> v;NSUInteger n=0;need(!DYLUTReadCube(url.path,v,n,&error)&&v.empty()&&n==0&&[error.localizedDescription containsString:@"编码损坏"],@"reject malformed Unicode without a lossy fallback");}
NSURL *invalid=[root URLByAppendingPathComponent:@"BadNumbers.cube"];need([encoded([base stringByAppendingString:@"NaN 0 0\n"],NSUTF32BigEndianStringEncoding,YES)writeToURL:invalid atomically:YES],@"write encoded invalid numbers");std::vector<float> v;NSUInteger n=0;need(!DYLUTReadCube(invalid.path,v,n,&error)&&v.empty()&&n==0,@"Unicode decoding does not weaken numeric validation");
// Cold large UTF-32 file exercises background conversion and cancellation.
NSURL *large=[valid URLByAppendingPathComponent:@"Large-UTF32BE.cube"];NSData *largeBytes=encoded(cube(65),NSUTF32BigEndianStringEncoding,YES);need([largeBytes writeToURL:large atomically:YES],@"write cold 65-cube UTF-32 fixture");originals[large.lastPathComponent]=largeBytes;
DYLUTLibrary *library=[[DYLUTLibrary alloc]initWithRootURL:[root URLByAppendingPathComponent:@"Library"]];__block BOOL done=NO;__block double last=NSProcessInfo.processInfo.systemUptime,gap=0;__block NSUInteger ticks=0,imported=0;
NSTimer *timer=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *t){double now=NSProcessInfo.processInfo.systemUptime;gap=MAX(gap,now-last);last=now;ticks++;(void)library.entries;}];
[library importURLsAsync:@[valid] completion:^(NSArray *items,NSError *failure){need(!failure,@"mixed encoding folder imports asynchronously");imported=items.count;done=YES;}];pump(^{return done;});[timer invalidate];need(imported==originals.count,@"all encoded files imported");need(ticks>0&&gap<.15,@"main loop remains responsive during Unicode conversion");
for(NSDictionary *entry in library.entries)need([[NSData dataWithContentsOfFile:entry[@"path"]]isEqual:originals[[entry[@"path"]lastPathComponent]]],@"import preserves exact encoded bytes");
NSURL *cancelURL=[root URLByAppendingPathComponent:@"Cancel-UTF32BE.cube"];need([largeBytes writeToURL:cancelURL atomically:YES],@"write uncached cancellation fixture");done=NO;NSProgress *task=DYLUTPrepareAsync(cancelURL.path,^(NSError *failure){need(failure.code==NSUserCancelledError,@"cancelled Unicode conversion reports cancellation");done=YES;});NSTimer *cancel=[NSTimer scheduledTimerWithTimeInterval:.001 repeats:NO block:^(NSTimer *t){[task cancel];}];pump(^{return done;});[cancel invalidate];
NSDictionary *report=@{@"pass":@YES,@"checks":@(checks.count),@"results":checks,@"encodedImportFiles":@(imported),@"mainHeartbeatMaxGapMS":@(gap*1000),@"mainHeartbeatTicks":@(ticks),@"largeEncodedBytes":@(largeBytes.length),@"scope":@"Synthetic isolated UTF-8/16/32 LE/BE BOM/no-BOM, line endings, Unicode spacing, exact colors, corruption, async import and cancellation. No user files modified."};
need([[NSJSONSerialization dataWithJSONObject:report options:NSJSONWritingPrettyPrinted error:nil]writeToFile:[NSString stringWithUTF8String:argv[1]] atomically:YES],@"write encoding report");[library release];need([fm removeItemAtURL:root error:nil],@"clean encoding fixtures");printf("PASS %lu checks, main gap %.3f ms\n",(unsigned long)checks.count,gap*1000);return 0;
}}
+19 -1
查看文件
@@ -45,6 +45,24 @@ int main(int argc,const char **argv){@autoreleasepool{
require(gain&&near(out[0],.555)&&near(out[1],.28)&&near(out[2],.81),@"red gain trilinear interpolation");
NSData *ranged=DYLUTTransformRGBA(input,1,1,domain.path,&error);out=(const float *)ranged.bytes;
require(ranged&&near(out[0],.185)&&near(out[1],.14)&&near(out[2],.405),@"DOMAIN normalization resamples Cube");
NSURL *legacy=write(temporary,@"LegacyMetadata/Legacy.cube",@"");
NSMutableData *legacyBytes=[NSMutableData dataWithBytes:"TITLE \"" length:7];
const unsigned char titleBytes[]={0xc7,0xe0,0xb3,0xc8};[legacyBytes appendBytes:titleBytes length:sizeof(titleBytes)];
[legacyBytes appendData:[@"\"\n# legacy comment " dataUsingEncoding:NSUTF8StringEncoding]];[legacyBytes appendBytes:titleBytes length:sizeof(titleBytes)];
[legacyBytes appendData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];[legacyBytes appendData:[cube()dataUsingEncoding:NSUTF8StringEncoding]];
require([legacyBytes writeToURL:legacy atomically:YES],@"write legacy-encoded descriptive metadata fixture");
require(DYLUTReadCube(legacy.path,values,n,&error)&&n==2,@"legacy TITLE and comments do not invalidate ASCII numeric payload");
require([DYLUTTransformRGBA(input,1,1,legacy.path,&error)isEqual:neutral],@"legacy descriptive encoding leaves numeric colors unchanged");
NSURL *invalidNumeric=write(temporary,@"LegacyMetadata/InvalidNumeric.cube",@"");
NSMutableData *invalidBytes=[NSMutableData dataWithData:[@"LUT_3D_SIZE 2\n0 0 0" dataUsingEncoding:NSUTF8StringEncoding]];
const unsigned char invalidByte=0xff;[invalidBytes appendBytes:&invalidByte length:1];
[invalidBytes appendData:[@"\n1 0 0\n0 1 0\n1 1 0\n0 0 1\n1 0 1\n0 1 1\n1 1 1\n" dataUsingEncoding:NSUTF8StringEncoding]];
require([invalidBytes writeToURL:invalidNumeric atomically:YES],@"write corrupt numeric suffix fixture");
require(!DYLUTReadCube(invalidNumeric.path,values,n,&error)&&values.empty()&&n==0,@"non-ASCII numeric suffix remains invalid");
DYLUTLibrary *metadataLibrary=[[[DYLUTLibrary alloc]initWithRootURL:[temporary URLByAppendingPathComponent:@"MetadataLibrary"]]autorelease];
NSArray *metadataImported=[metadataLibrary importURLs:@[legacy] error:&error];
require(metadataImported.count==1&&[[NSData dataWithContentsOfFile:metadataImported[0][@"path"]]isEqual:legacyBytes],@"legacy metadata imports without rewriting source bytes");
require(![metadataLibrary importURLs:@[invalidNumeric] error:&error]&&[error.localizedDescription containsString:@"InvalidNumeric.cube"]&&metadataLibrary.entries.count==1,@"failed import names the file and preserves previous library");
NSData *clear=DYLUTTransformRGBA(sample(NAN,.2,.3),1,1,nil,&error);out=(const float *)clear.bytes;
require(clear&&out[0]==0&&out[1]==0&&out[2]==0&&out[3]==0,@"invalid float samples become clear");
require(!DYLUTTransformRGBA([NSData data],1,1,nil,&error),@"reject malformed float RGBA length");
@@ -66,7 +84,7 @@ int main(int argc,const char **argv){@autoreleasepool{
if(!DYLUTReadCube(red.path,local,dimension,NULL)||dimension!=2||!near(local[4],1.6))parallelState->store(false);
}});
require(parallelOK,@"concurrent table cache reads stay consistent");
NSArray *invalid=@[@"LUT_3D_SIZE 1\n0 0 0\n",@"LUT_3D_SIZE 129\n",@"LUT_3D_SIZE 2\n0 0 0\n",@"LUT_1D_SIZE 2\n0 0 0\n1 1 1\n",@"LUT_3D_SIZE 2\nNaN 0 0\n",[cube() stringByAppendingString:@"0 0 0\n"],[cube() stringByAppendingString:@"DOMAIN_MAX 0 1 1\n"],[cube() stringByAppendingString:@"garbage\n"],[cube() stringByAppendingString:@"LUT_3D_SIZE 2\n"]];
NSArray *invalid=@[@"",[cube()stringByReplacingOccurrencesOfString:@"LUT_3D_SIZE 2" withString:@"LUT_3D_SIZE 2junk"],[cube()stringByAppendingString:@"DOMAIN_MAX 1 1 1 junk\n"],@"LUT_3D_SIZE 1\n0 0 0\n",@"LUT_3D_SIZE 129\n",@"LUT_3D_SIZE 2\n0 0 0\n",@"LUT_1D_SIZE 2\n0 0 0\n1 1 1\n",@"LUT_3D_SIZE 2\nNaN 0 0\n",[cube() stringByAppendingString:@"0 0 0\n"],[cube() stringByAppendingString:@"DOMAIN_MAX 0 1 1\n"],[cube() stringByAppendingString:@"garbage\n"],[cube() stringByAppendingString:@"LUT_3D_SIZE 2\n"]];
NSUInteger invalidIndex=0;
for(NSString *text in invalid) {
NSURL *url=write(temporary,[NSString stringWithFormat:@"Invalid%lu.cube",(unsigned long)invalidIndex++],text);
+26 -1
查看文件
@@ -77,7 +77,7 @@ int main(int argc,const char *argv[]) {@autoreleasepool {
}require(catalogOK,@"3000 catalog files in independent folders created");
[NSApplication sharedApplication];[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
NSMutableArray *selected=[NSMutableArray array];
DYLUTBrowser *browser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:nil palette:@{} selection:^(NSString *path){[selected addObject:path?:@""];}];
DYLUTBrowser *browser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:nil palette:@{} selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){if(path.length)return DYLUTPrepareAsync(path,^(NSError *error){if(!error)[selected addObject:path];completion(error);});[selected addObject:@""];dispatch_async(dispatch_get_main_queue(),^{completion(nil);});return [NSProgress discreteProgressWithTotalUnitCount:1];}];
pump(^{return [browser valueForKey:@"libraryTask"]==nil;});
NSUInteger visible=[[browser valueForKey:@"visibleEntries"]count],tileCount=[[browser valueForKey:@"tiles"]count];
require([[browser valueForKey:@"folderPaths"]count]>3000&&[[browser valueForKey:@"folderButtons"]count]<30,@"large directory list creates only visible folder controls");
@@ -94,6 +94,31 @@ int main(int argc,const char *argv[]) {@autoreleasepool {
NSUInteger folderViews=[[browser valueForKey:@"folderButtons"]count];
[browser importSelectedURLs:@[source]];[browser close];done=NO;[library reloadAsync:^(NSError *failure){require(!failure,@"scan after browser close completes");done=YES;}];pump(^{return done;});
require(library.entries.count==3025,@"closing during import cancels without changing existing library");
// Host acknowledgement is the selection boundary, including rejection,
// cancellation and an older completion arriving after a newer click.
NSMutableArray *acknowledgements=[NSMutableArray array],*applyTasks=[NSMutableArray array];
DYLUTBrowser *ackBrowser=[[DYLUTBrowser alloc]initWithLibrary:library preview:nil selectedPath:anchor.path palette:@{} selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){
[acknowledgements addObject:[[completion copy]autorelease]];NSProgress *task=[NSProgress discreteProgressWithTotalUnitCount:1];[applyTasks addObject:task];return task;
}];
pump(^{return [ackBrowser valueForKey:@"libraryTask"]==nil;});
NSDictionary *ackTiles=[ackBrowser valueForKey:@"tiles"];NSArray *ackPaths=ackTiles.allKeys;require(ackPaths.count>=2,@"acknowledgement fixture has selectable thumbnails");
id firstTile=ackTiles[ackPaths[0]],secondTile=ackTiles[ackPaths[1]];[firstTile setEnabled:YES];[secondTile setEnabled:YES];
[ackBrowser thumbnailClicked:firstTile];
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:anchor.path]&&[[[ackBrowser valueForKey:@"statusLabel"]stringValue]hasPrefix:@"正在载入"],@"thumbnail stays loading until host application acknowledges");
void (^rejected)(NSError *)=acknowledgements[0];rejected([NSError errorWithDomain:@"test.host" code:1 userInfo:@{NSLocalizedDescriptionKey:@"Host rejected this edit"}]);
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:anchor.path]&&[[[ackBrowser valueForKey:@"statusLabel"]stringValue]isEqual:@"Host rejected this edit"],@"host rejection preserves previous selection and reports the error");
[ackBrowser thumbnailClicked:firstTile];[ackBrowser thumbnailClicked:secondTile];
require([applyTasks[1]isCancelled],@"new thumbnail click cancels previous application task");
void (^older)(NSError *)=acknowledgements[1];older(nil);
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:anchor.path],@"late older acknowledgement cannot mark a stale LUT selected");
void (^latest)(NSError *)=acknowledgements[2];latest(nil);
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:ackPaths[1]],@"only acknowledged latest thumbnail becomes selected");
[ackBrowser clearSelection:nil];
require([[ackBrowser valueForKey:@"selectedPath"]isEqual:ackPaths[1]],@"removal also waits for host acknowledgement");
void (^removed)(NSError *)=acknowledgements[3];removed(nil);require([ackBrowser valueForKey:@"selectedPath"]==nil,@"acknowledged removal clears selection");
[ackBrowser thumbnailClicked:firstTile];[ackBrowser close];require([applyTasks.lastObject isCancelled],@"closing the browser cancels pending host application");
void (^afterClose)(NSError *)=acknowledgements[4];afterClose(nil);require([ackBrowser valueForKey:@"selectedPath"]==nil,@"completion after close cannot change the selection");
[acknowledgements removeAllObjects];[ackBrowser release];
[browser release];report[@"largeCatalogEntries"]=@(visible);report[@"initialLiveThumbnailViews"]=@(tileCount);report[@"initialLiveFolderViews"]=@(folderViews);report[@"pass"]=@YES;
#else
report[@"mode"]=@"baseline synchronous import";
+23 -31
查看文件
@@ -2,43 +2,35 @@
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.3",
"build": "14",
"version": "1.1.5",
"build": "16",
"team": "B3W25FX5H5",
"notaryID": "d47784c7-7cad-4837-93ab-9bce5d8c19da",
"notaryID": "b47b6fe8-b7a9-4112-93b9-de85b03ca598",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "6452e793f974234b5ffffdfad5dc3ddeee64d53c",
"sourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"shaderSHA256": "9d89ed3197cf987a37ad7320911d23b8510b5461ffca2bd16397c8b963e02132",
"registry": "com.dayu.color.XPC(1.1)\tC8DCC642-3ADE-432E-9B93-A574E1882E41\t2026-11-01 04:23:34 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
"hostVerification": "verification/HostLUTLoading.json",
"sourceRecoveryVerification": "verification/AsyncLUTRecovery.json",
"responsivenessVerification": "verification/LUTResponsiveness.json",
"brandAssetsVerification": "verification/BrandAssets.json",
"removedPreviousInstallBackups": [
"/Library/Plug-Ins/FxPlug/.dayu-color-previous-915be36208cf4ba6a5f211bd146db0a5.app",
"/Library/Plug-Ins/FxPlug/.dayu-color-previous-f4d0e95875244934a781a2b2ae46b395.app"
"hostVerification": "verification/HostLUTEncoding.json",
"sourceRecoveryVerification": "verification/LUTEncodingRecovery.json",
"responsivenessVerification": "verification/LUTEncoding.json",
"registry": "com.dayu.color.XPC(1.1)\t78D73EB2-7FCE-41CD-8E6A-6AABC8ACACDB\t2026-11-01 07:39:57 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
"appInventory": [
{
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"version": "1.1.5",
"build": "16"
}
],
"generatedCopyAudit": {
"roots": [
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color",
"/Volumes/备份/大鱼调色/大鱼调色",
"/Users/mac/Desktop",
"/Users/mac/Downloads",
"/Applications",
"/Users/mac/Applications",
"/Users/mac/Library/Plug-Ins/FxPlug",
"/Library/Plug-Ins/FxPlug"
],
"matchingOuterApps": [
{
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"version": "1.1.3",
"build": "14"
}
],
"scope": "Known task, build and standard installation directories; not a whole-disk uniqueness claim."
"inventoryScope": [
"project and fixed product cache",
"system FxPlug and Applications",
"user FxPlug, Downloads and Desktop"
],
"packageVerification": "verification/Package.json",
"packageStagingCleanup": {
"identifier": "com.dayu.color.installer.c8d19ea6-1117-4621-ae47-48a41ea4ca10",
"remainingMatchedDirectories": []
}
}
+278
查看文件
@@ -0,0 +1,278 @@
{
"date": "2026-11-01",
"status": "verified-formal-release-and-live-fcp",
"version": "1.1.4",
"build": "15",
"reportedTrigger": [
"External LUT thumbnail application hangs after successful import",
"N12精选luts folder import fails"
],
"baselineCommit": "a2c8dfafcfe8c1974ec560b9586b78052356a0e4",
"finding": "A preview-cache preheat did not pin the selected table or GPU texture; frame rendering still performed path metadata queries and could parse external text again. Browser acknowledged selection before the inspector finished application.",
"changes": [
"Decode and upload on the renderer preparation queue before committing the host path.",
"Retain immutable selected snapshots independently of preview caches; no file metadata or parsing on prepared frame paths.",
"Acknowledge browser selection only after preparation and accepted host write.",
"Cancel stale requests before they can overwrite a newer host selection.",
"Keep preview work at utility priority and selected LUT preparation at user-initiated priority.",
"Reuse prepared GPU device pipelines when the host supplies the actual registry ID.",
"Allow legacy-encoded TITLE/comments while strictly validating ASCII numeric data and include the failing filename in import errors."
],
"nativeChecks": 171,
"nativePassed": true,
"externalChecks": [
{
"name": "external-large-cube-written",
"pass": true
},
{
"error": "未提供错误信息",
"name": "external-decode-and-gpu-upload-complete",
"pass": true
},
{
"heartbeats": 4,
"maximumGapMS": 5.996874999254942,
"name": "external-activation-main-loop-responsive",
"pass": true
},
{
"error": "",
"name": "external-first-frame-after-preparation",
"pass": true
},
{
"name": "external-lut-affects-frame",
"pass": true
},
{
"name": "external-source-removed-for-no-io-check",
"pass": true
},
{
"name": "external-preview-and-gpu-cache-churn",
"pass": true
},
{
"error": "",
"name": "external-render-with-source-unavailable-after-cache-churn",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "external-snapshot-is-independent-of-file-and-preview-cache",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"name": "external-preparation-cancellation",
"pass": true
}
],
"browserChecks": 67,
"browserPassed": true,
"browserMainMaxGapMS": 6.6957916133105755,
"libraryChecks": 112,
"libraryPassed": true,
"limitations": [
"The supplied folder failure was reproduced; the earlier unspecified thumbnail hang was not captured while occurring. These supplied files now pass the actual host checks.",
"No Intel, older macOS or network-volume performance benchmark; no full VoiceOver audit."
],
"realFolder": {
"sourceFolder": "/Volumes/备份/N12精选luts",
"baseline": {
"importedFiles": 0,
"error": "LUT 必须是 UTF-8 文本",
"failedFiles": [
"青橙色.cube",
"青橙色2.cube"
]
},
"fixedImport": {
"importError": "",
"sourceFilesUnchanged": true,
"mainHeartbeatMaxGapMS": 6.27491669729352,
"userLibraryModified": false,
"importedContentsIdentical": true,
"mainHeartbeatTicks": 794,
"allThumbnailsGenerated": true,
"scope": "User-supplied LUTs read only; isolated library import and thumbnail generation. No LUT data redistributed, no GUI or host parameter edits.",
"files": [
{
"parsed": true,
"file": "超强质感高对比.cube",
"error": "",
"dimension": 17
},
{
"parsed": true,
"file": "城市莫兰迪灰2 加亮.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "复古-大白鲨.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "复古胶片风.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "复古清新干净1.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "复古清新干净2.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "复古清新干净3.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "感性内敛色调.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "户外森林2.cube",
"error": "",
"dimension": 16
},
{
"parsed": true,
"file": "绿转白.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "绿转粉.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "绿转紫.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "内景(柔皮肤).cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "青橙色.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "青橙色2.cube",
"error": "",
"dimension": 32
},
{
"parsed": true,
"file": "清新亮调.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "万能青橙色.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "质感超高对比.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "质感低对比.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "质感高对比1.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "质感高对比2.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "质感高对比暗部发红.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "质感中对比.cube",
"error": "",
"dimension": 33
},
{
"parsed": true,
"file": "自然高对比高饱和.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "自然清新.cube",
"error": "",
"dimension": 64
},
{
"parsed": true,
"file": "AAChangyong1.cube",
"error": "",
"dimension": 64
}
],
"sourceFolder": "/Volumes/备份/N12精选luts",
"pass": true,
"importedFiles": 26,
"sourceFiles": 26,
"appleDoubleSidecars": 0,
"plannedFiles": 26
},
"metal": {
"checks": 171,
"pass": true,
"files": 26,
"scope": "Every supplied LUT prepared asynchronously and rendered through actual Metal/IOSurface. No user file changes or LUT redistribution."
}
},
"hostVerification": "verification/HostExternalLUT.json",
"browserImportSeconds": 7.68114308337681,
"installedMetalChecks": 171,
"installedMetalPassed": true
}
+14
查看文件
@@ -0,0 +1,14 @@
{
"passResult": true,
"sourceCommit": "497eef29fe8eaa5fb7025aa045b6dfa46a9acc14",
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"filesCompared": 133,
"gitFsck": "strict/full passed",
"restoredLibraryChecks": 112,
"restoredLibraryPass": true,
"lfs": false,
"submodules": false,
"userLUTsIncluded": false,
"date": "2026-11-01T07:25:42.831321+00:00",
"hostVerification": "verification/HostExternalLUT.json"
}
+256
查看文件
@@ -0,0 +1,256 @@
{
"date": "2026-11-01T07:25:42.831321+00:00",
"status": "verified",
"version": "1.1.4",
"build": "15",
"compiledSourceCommit": "497eef29fe8eaa5fb7025aa045b6dfa46a9acc14",
"formalApp": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": {
"name": "Final Cut Pro",
"version": "12.4",
"build": "454072",
"process": 76603,
"pluginProcess": 76607,
"pluginExecutable": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit/Contents/MacOS/大鱼调色 XPC Service"
},
"fixture": {
"library": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/大鱼调色_验收.fcpbundle",
"project": "大鱼调色_分组展开与启用验收",
"playhead": "00:00:02:18",
"sourceFolder": "/Volumes/备份/N12精选luts",
"importedFolder": "/Users/mac/Movies/大鱼调色LUT/look LUTs/N12精选luts",
"files": 26,
"sourceBytes": 91960032,
"synthetic": false
},
"observations": [
{
"check": "Official 1.1.4 inspector and plugin loaded from the single formal path",
"pass": true
},
{
"check": "N12 directory contains all 26 imported real LUTs and original library retains its four items",
"pass": true,
"note": "Directory was already imported when the live UI changed during acceptance; no duplicate import was performed."
},
{
"check": "Imported copies match all source files byte for byte",
"pass": true
},
{
"check": "Both legacy TITLE LUTs apply and browser/inspector agree after acknowledgement",
"pass": true,
"files": [
"青橙色.cube",
"青橙色2.cube"
]
},
{
"check": "64-cube external LUT applies successfully",
"pass": true,
"file": "复古清新干净3.cube"
},
{
"check": "Search remains responsive and returns three matching real LUTs",
"pass": true
},
{
"check": "Rapid first/second selection ends on the second LUT",
"pass": true,
"last": "复古清新干净2.cube"
},
{
"check": "Clear synchronizes browser and inspector to no LUT",
"pass": true
},
{
"check": "Restore original user selection, normal quit and reopen retains path/enabled group and all 26 library items",
"pass": true,
"last": "复古-大白鲨.cube"
},
{
"check": "Progressive visible thumbnails coexist with ready/applicable thumbnails",
"pass": true
}
],
"importedFileVerification": {
"pass": true,
"files": 26,
"bytes": 91960032,
"totalLibraryCubes": 30,
"records": [
{
"file": "AAChangyong1.cube",
"sha256": "976240cb0787ace83603e345b79dff4584a8076c5ef9b53d3bd513910890fe71",
"installed": true,
"identical": true
},
{
"file": "万能青橙色.cube",
"sha256": "8f237931811754c40d26764d2b2553f3a07960833c16147d13f658f481a3aaa9",
"installed": true,
"identical": true
},
{
"file": "内景(柔皮肤).cube",
"sha256": "1710719e2096087d80c21c0f25bbda06d5d1402acaac12a87cb66a65bd233c2a",
"installed": true,
"identical": true
},
{
"file": "城市莫兰迪灰2 加亮.cube",
"sha256": "b0165e2f603d3eca15d01e9fd16878ce279be72674318d532de17799bb638ddd",
"installed": true,
"identical": true
},
{
"file": "复古-大白鲨.cube",
"sha256": "68961a83fbdebce27b51b779dfcb3ed23edfe885cb6fd804c7f5bedc3c55d92f",
"installed": true,
"identical": true
},
{
"file": "复古清新干净1.cube",
"sha256": "bd1fe33027092632a37cddb7b461a5260d9123ae1de1924fa0b7df8132c4e3e0",
"installed": true,
"identical": true
},
{
"file": "复古清新干净2.cube",
"sha256": "6f07a956922a2269616be6ad8e4b1719b5d811cc3ada43693c9342e24de016a8",
"installed": true,
"identical": true
},
{
"file": "复古清新干净3.cube",
"sha256": "a2addc8b672b3bc210c3d206fe9860284e89c80c81016e043f060c3b72fa45e4",
"installed": true,
"identical": true
},
{
"file": "复古胶片风.cube",
"sha256": "65e79ba7611f8d75b82c29e2bed75a2785e260bc6ef2b4e464b575101df6fc66",
"installed": true,
"identical": true
},
{
"file": "感性内敛色调.cube",
"sha256": "9169af70620e972c6d030e1b88b61adc40801cf23b7706a986212c2d6cae82c1",
"installed": true,
"identical": true
},
{
"file": "户外森林2.cube",
"sha256": "55f64e6a62d8db8b65331a7b207d99e339a14e00602b8a025555b293c62f75b8",
"installed": true,
"identical": true
},
{
"file": "清新亮调.cube",
"sha256": "213c15702ebeae606b081d45ad28879fe048ecb458acae2c7c4610e3a9be3e04",
"installed": true,
"identical": true
},
{
"file": "绿转白.cube",
"sha256": "ff09e5b1afda53ca8ce909283b4ef86d1b8d4c32cd21959a6ca2863a3933e665",
"installed": true,
"identical": true
},
{
"file": "绿转粉.cube",
"sha256": "b3bd35d4f49e5894ad9b029904bd137bf46b9fb5509822ddff977256bfa0617e",
"installed": true,
"identical": true
},
{
"file": "绿转紫.cube",
"sha256": "ced2642062da92c1b5fa31fa02ebcae24c46b5ee815b1e958b314f0b2d141b0f",
"installed": true,
"identical": true
},
{
"file": "自然清新.cube",
"sha256": "5fc57742076417151f2bac44a4459bfd0694191c301cf3bf855be0516af7e2a2",
"installed": true,
"identical": true
},
{
"file": "自然高对比高饱和.cube",
"sha256": "212c8a1358e751e6ef644450db46e9e2fd16e591438716e755f8f9f743c849e2",
"installed": true,
"identical": true
},
{
"file": "质感中对比.cube",
"sha256": "d82c12ac309dbf10ff368c8bf3407312a1432eea321e83a3501bacb35f17e165",
"installed": true,
"identical": true
},
{
"file": "质感低对比.cube",
"sha256": "6c42c73de72f91cb61526103ad4486a7880ce8281c5996c37a10f8ef079f5ce3",
"installed": true,
"identical": true
},
{
"file": "质感超高对比.cube",
"sha256": "7e38fcede4532a81d53d9441dc9c2b5f6d8f234ee88db7f2d731d376728b7c42",
"installed": true,
"identical": true
},
{
"file": "质感高对比1.cube",
"sha256": "195968667bbd4fad90fe595b6e1564a7d4bda8a19ba94ab3e49ee203a4c69e38",
"installed": true,
"identical": true
},
{
"file": "质感高对比2.cube",
"sha256": "346c0ccee28d9f551310046e6961a0ad7145c3795d19c8b8ad7a4b82cf63c73d",
"installed": true,
"identical": true
},
{
"file": "质感高对比暗部发红.cube",
"sha256": "be109ad99cfd249d99bd6b32d0a4dadee869bee98c497687a08722e897c9f4fe",
"installed": true,
"identical": true
},
{
"file": "超强质感高对比.cube",
"sha256": "a9c8e9b92643f22ea382d5c3fd535c6474108b52ce67eb7b0d45926d31f03bef",
"installed": true,
"identical": true
},
{
"file": "青橙色.cube",
"sha256": "0422f0820e146244ea1aa05ad68677121d4a68251675252395acd4d2ae93b457",
"installed": true,
"identical": true
},
{
"file": "青橙色2.cube",
"sha256": "238b79dfbd6a499e7acc367bc71d86ae661d73bd4890554834629f94ecbfeb91",
"installed": true,
"identical": true
}
]
},
"installedMetalChecks": 171,
"installedMetalPassed": true,
"preservation": {
"sourceFilesUnchanged": true,
"keptAllN12Imports": true,
"keptOriginalFourLUTs": true,
"restoredInitialUserSelection": "复古-大白鲨.cube",
"search": "",
"folder": "N12精选luts",
"firstClipOtherEffectsEdited": false,
"forcedQuit": false
},
"limitations": [
"The supplied folder failure was reproduced; the earlier unspecified thumbnail hang was not captured while occurring. These supplied files now pass the actual host checks.",
"No Intel, older macOS or network-volume performance benchmark; no full VoiceOver audit."
]
}
+213
查看文件
@@ -0,0 +1,213 @@
{
"date": "2026-11-01T07:46:11.571597+00:00",
"status": "verified",
"version": "1.1.5",
"build": "16",
"compiledSourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
"formalApp": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"host": {
"name": "Final Cut Pro",
"version": "12.4",
"build": "454072"
},
"project": "大鱼调色_分组展开与启用验收",
"playhead": "00:00:02:18",
"fixture": {
"synthetic": true,
"sourceFolder": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/编码兼容验收",
"files": [
{
"file": "UTF-8-NoBOM.cube",
"codec": "utf-8",
"bom": false,
"sha256": "0ccd6767407545c141d38d8233e57a57e0fc40078c8371f55786800de204003f",
"bytes": 1078225,
"dimension": 33
},
{
"file": "UTF-8-BOM.cube",
"codec": "utf-8",
"bom": true,
"sha256": "b98c9e163a0ab33b7c7d3af477a335810846dfc82af0ae6a713bfdade88cb7db",
"bytes": 1114170,
"dimension": 33
},
{
"file": "UTF-16-LE-NoBOM.cube",
"codec": "utf-16-le",
"bom": false,
"sha256": "76deea4650a01fdbe57b9cd4fca06b0fa47c78d544bde9104959b7416bc67ed6",
"bytes": 2156438,
"dimension": 33
},
{
"file": "UTF-16-LE-BOM.cube",
"codec": "utf-16-le",
"bom": true,
"sha256": "c5151d57a58acd6751e014d19c7073ce50a1151f0701943c13497f0c0a21a42d",
"bytes": 2156440,
"dimension": 33
},
{
"file": "UTF-16-BE-NoBOM.cube",
"codec": "utf-16-be",
"bom": false,
"sha256": "59cf2d07c31532a209efc432f2ed139856221cb47704473b9b2ce7344476594f",
"bytes": 2228322,
"dimension": 33
},
{
"file": "UTF-16-BE-BOM.cube",
"codec": "utf-16-be",
"bom": true,
"sha256": "8d58a8e67a2cd1e3a33c354a7751f65c31790f086a249976da0d7783b25e49c7",
"bytes": 2156440,
"dimension": 33
},
{
"file": "UTF-32-LE-NoBOM.cube",
"codec": "utf-32-le",
"bom": false,
"sha256": "5104b4235e0d86c73444b82642904d9bd779ce0cf4a22d4cb9fcab8ecbfed99e",
"bytes": 4312872,
"dimension": 33
},
{
"file": "UTF-32-LE-BOM.cube",
"codec": "utf-32-le",
"bom": true,
"sha256": "0ef0fbdc899575385f4a05b1bdb8a8b17664af6c0ce9c3474b9927831ea94ba1",
"bytes": 4456644,
"dimension": 33
},
{
"file": "UTF-32-BE-NoBOM.cube",
"codec": "utf-32-be",
"bom": false,
"sha256": "8e99c713412b02cef3056427a3e10a4a8979a1ff8387d7f5beef568252825295",
"bytes": 4312872,
"dimension": 33
},
{
"file": "UTF-32-BE-BOM.cube",
"codec": "utf-32-be",
"bom": true,
"sha256": "fc011e3ff28c0b4834a37cf4ee617133db730d37cf07f8bfd9303c4f6dc0df96",
"bytes": 4312876,
"dimension": 33
},
{
"file": "GB18030-NoBOM.cube",
"codec": "gb18030",
"bom": false,
"sha256": "c0dc4012b06798fd4d8ddedeb125edc5512652a5292b70f54e40197e2a028c8d",
"bytes": 1114156,
"dimension": 33
},
{
"file": "BIG5-NoBOM.cube",
"codec": "big5",
"bom": false,
"sha256": "39de3cd6272e852fbc25e309364cc0b0f9cc745e6b2b1e3d412c0dacb7fac53f",
"bytes": 1078214,
"dimension": 33
},
{
"file": "SHIFT_JIS-NoBOM.cube",
"codec": "shift_jis",
"bom": false,
"sha256": "adb4615709ef54a992dfa05a016748ada5642f110a3456f01329b55a55a5241e",
"bytes": 1078212,
"dimension": 33
},
{
"file": "CP1252-NoBOM.cube",
"codec": "cp1252",
"bom": false,
"sha256": "fb37195b5ed916f291e2f32db1f3d69df79afef73f3967cc238e6ae3c2a1167f",
"bytes": 1114152,
"dimension": 33
},
{
"file": "MAC_ROMAN-NoBOM.cube",
"codec": "mac_roman",
"bom": false,
"sha256": "4ebefb24fa47faabbc34c135287b9bd74852b30fe812c85927c697028dd35cf4",
"bytes": 1078210,
"dimension": 33
},
{
"file": "ISO8859-1-NoBOM.cube",
"codec": "iso8859-1",
"bom": false,
"sha256": "ff3bb7cab36c4f4366f098bde199885671a6364b20481e99e81cda8e2c72a5f9",
"bytes": 1078210,
"dimension": 33
}
],
"count": 16,
"bytes": 34826453
},
"observations": [
{
"check": "Native folder selector imports all 16 mixed-encoding LUTs",
"pass": true
},
{
"check": "All sixteen thumbnails generated and individually applied; browser and inspector acknowledge the same path",
"pass": true,
"names": [
"UTF-8-NoBOM",
"UTF-8-BOM",
"UTF-16-LE-NoBOM",
"UTF-16-LE-BOM",
"UTF-16-BE-NoBOM",
"UTF-16-BE-BOM",
"UTF-32-LE-NoBOM",
"UTF-32-LE-BOM",
"UTF-32-BE-NoBOM",
"UTF-32-BE-BOM",
"GB18030-NoBOM",
"BIG5-NoBOM",
"SHIFT_JIS-NoBOM",
"CP1252-NoBOM",
"MAC_ROMAN-NoBOM",
"ISO8859-1-NoBOM"
]
},
{
"check": "UTF-32 BE without BOM retained after normal quit and reopen, group remains enabled",
"pass": true
},
{
"check": "Original user selection restored to 复古-大白鲨, N12 folder, empty search",
"pass": true
}
],
"importedBytes": {
"passResult": true,
"files": 16,
"byteIdentical": 16,
"originalLibraryFiles": 30,
"originalLibraryPreserved": true,
"installedMetalChecks": 141,
"installedMetalPass": true
},
"installedMetal": {
"checks": 141,
"pass": true,
"files": 16
},
"cleanup": {
"removedSyntheticImports": 16,
"originalLibraryFiles": 30,
"originalLibraryHashesUnchanged": true,
"keptN12Imports": 26,
"firstClipOtherEffectsEdited": false,
"forcedQuit": false
},
"limitations": [
"No older macOS, Intel or network-storage benchmark; no full VoiceOver audit.",
"Encoding support covers the documented Cube cases, not every historical charset or unrelated LUT format."
]
}
+53 -4
查看文件
@@ -1,6 +1,6 @@
{
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
"checks": 82,
"checks": 92,
"gpu": "Apple M4",
"limitations": [
"Finite states and a 64x48 frame; live FCP discovery, inspector interaction, timeline persistence and real host export require separate acceptance.",
@@ -12,7 +12,7 @@
"error": "未提供错误信息",
"name": "runtime-directory",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69"
},
{
"descriptors": 196,
@@ -506,7 +506,7 @@
"error": "未提供错误信息",
"name": "renderer-export-33cube",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B/diagnostic-export.cube"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69/diagnostic-export.cube"
},
{
"bytes": 1186070,
@@ -514,8 +514,57 @@
"nonzeroRows": 35937,
"pass": true,
"rows": 35937
},
{
"name": "external-large-cube-written",
"pass": true
},
{
"error": "未提供错误信息",
"name": "external-decode-and-gpu-upload-complete",
"pass": true
},
{
"heartbeats": 4,
"maximumGapMS": 5.919541465118527,
"name": "external-activation-main-loop-responsive",
"pass": true
},
{
"error": "",
"name": "external-first-frame-after-preparation",
"pass": true
},
{
"name": "external-lut-affects-frame",
"pass": true
},
{
"name": "external-source-removed-for-no-io-check",
"pass": true
},
{
"name": "external-preview-and-gpu-cache-churn",
"pass": true
},
{
"error": "",
"name": "external-render-with-source-unavailable-after-cache-churn",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "external-snapshot-is-independent-of-file-and-preview-cache",
"nonfiniteComponents": 0,
"nonzeroComponents": 9832,
"pass": true
},
{
"name": "external-preparation-cancellation",
"pass": true
}
],
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/BB439FDC-A9EA-4009-8EE7-C685AB9F230B",
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/6C00009B-0E3E-4F6A-84FB-501C35480F69",
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
}
文件差异过大,未显示。 加载差异
+12
查看文件
@@ -0,0 +1,12 @@
{
"passResult": true,
"sourceCommit": "59b058a3c8b9e5387381574da6bbc05af437527c",
"filesCompared": 138,
"fsck": "strict/full passed",
"restoredChecks": {
"library": 112,
"encoding": 179
},
"lfs": false,
"submodules": false
}
+64
查看文件
@@ -0,0 +1,64 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.1.5.pkg",
"sha256": "bf2a4acc57a3c08176be0f317c90551120bfcfb21a7224a690191884c8a3d071",
"bytes": 13752153,
"testUnsigned": false,
"installationExecuted": false,
"checks": [
"PKG Developer ID Installer signature",
"PKG stapled ticket and Gatekeeper install assessment",
"must-close attached to root-authorized payload",
"all four FCP/Motion host identifiers",
"bundle relocation disabled",
"desktop and Bundle ID preinstall guards",
"postinstall contains actual FxPlug verification invocations",
"GUI worker, registration repair and Finder reveal present",
"successful completion and consecutive registration checks",
"exact payload contents: 大鱼调色.app",
"fixed FxPlug outer APP install path",
"outer APP has one real verification action",
"service path/identifier/registration version: com.dayu.color.XPC",
"nonempty FxPlug service manifest",
"payload APP signature, independent ticket and Gatekeeper",
"exact payload contents: 大鱼调色",
"login-user resource destination: ~/Movies/Motion Templates.localized/Effects.localized",
"complete outer APP payload present",
"welcome warns to save work and close hosts",
"conclusion gives manual APP and host restart instructions"
],
"resources": [
{
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.1.5",
"build": "16"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.c8d19ea6-1117-4621-ae47-48a41ea4ca10/1F33731D-2B0E-486C-8F6B-88E78433618D/大鱼调色"
}
],
"signature": "Package \"大鱼调色-1.1.5.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-01 07:46:31 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.1.5.pkg: accepted\nsource=Notarized Developer ID",
"pass": true,
"scope": "Expanded package structural and payload verification only; no installer scripts executed and no host quit or registration performed.",
"notarization": {
"message": "Successfully received submission info",
"name": "大鱼调色-1.1.5.pkg",
"status": "Accepted",
"createdDate": "2026-11-01T07:46:33.136Z",
"id": "90a38636-93bb-4693-8db2-16b9a815e409"
},
"appCompiledSource": "59b058a3c8b9e5387381574da6bbc05af437527c",
"appBuild": "16",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"packageBuilderCommit": "191da9dc0abfda83fcc5939f6fc90e4c9019f4d9",
"templateSHA256": {
"大鱼调色.moef": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"installedAppHostAcceptance": "verification/HostLUTEncoding.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
}
+60
查看文件
@@ -2,6 +2,8 @@
#import "DYModel.h"
#import "DYRenderer.h"
#import "DYAutoGrade.h"
#import "DYLUTLibrary.h"
#include <string>
#import <CoreVideo/CoreVideo.h>
#import <IOSurface/IOSurface.h>
#include <algorithm>
@@ -207,6 +209,64 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
NSURL *exportURL=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"diagnostic-export.cube"]];error=nil;run.need(@"renderer-export-33cube",[renderer exportLUT:exportURL uniforms:u paths:paths error:&error],@{@"error":reason(error),@"path":exportURL.path});
NSString *exported=[NSString stringWithContentsOfURL:exportURL encoding:NSUTF8StringEncoding error:&error];NSUInteger triples=0,nonzero=0;bool exportFinite=true;for(NSString *line in [exported componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){triples++;exportFinite&=std::isfinite(r)&&std::isfinite(g)&&std::isfinite(b);if(r!=0||g!=0||b!=0)nonzero++;}}
run.record(@"export-33cube-data-contract",[exported containsString:@"LUT_3D_SIZE 33"]&&triples==33*33*33&&exportFinite&&nonzero>0,@{@"rows":@(triples),@"nonzeroRows":@(nonzero),@"bytes":@([[[NSFileManager defaultManager]attributesOfItemAtPath:exportURL.path error:nil][NSFileSize]unsignedLongLongValue])});
// A selected external table must outlive preview-cache churn and must
// not consult the file system again on the frame-render path.
NSString *external=[runtime stringByAppendingPathComponent:@"external-65.cube"];
std::string externalCube="TITLE \"External activation fixture\"\nLUT_3D_SIZE 65\n";char row[128];
for(int z=0;z<65;z++)for(int y=0;y<65;y++)for(int x=0;x<65;x++){snprintf(row,sizeof(row),"%.8f %.8f %.8f\n",x/64.f*.82f,y/64.f,z/64.f*1.12f);externalCube+=row;}
run.need(@"external-large-cube-written",[[NSData dataWithBytes:externalCube.data() length:externalCube.size()]writeToFile:external options:NSDataWritingAtomic error:&error]);
DYRenderer *externalRenderer=[[[DYRenderer alloc]init]autorelease];
__block BOOL prepared=NO;__block NSError *preparationError=nil;__block NSUInteger beats=0;__block double last=NSProcessInfo.processInfo.systemUptime,maxGap=0;
NSTimer *heartbeat=[NSTimer scheduledTimerWithTimeInterval:.005 repeats:YES block:^(NSTimer *timer){double now=NSProcessInfo.processInfo.systemUptime;maxGap=std::max(maxGap,now-last);last=now;beats++;}];
[externalRenderer prepareLUTPath:external completion:^(NSError *failure){preparationError=[failure retain];prepared=YES;}];
double deadline=NSProcessInfo.processInfo.systemUptime+30;
while(!prepared&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
[heartbeat invalidate];
run.need(@"external-decode-and-gpu-upload-complete",prepared&&!preparationError,@{@"error":reason(preparationError)});[preparationError release];
run.record(@"external-activation-main-loop-responsive",beats>0&&maxGap<.15,@{@"heartbeats":@(beats),@"maximumGapMS":@(maxGap*1000)});
DYUniforms externalUniforms=defaults;externalUniforms.lookSectionEnabled=1;externalUniforms.postLUTStrength=1;
NSDictionary *externalPaths=@{@"look0":external};
Pixels externalFrame=render(run,externalRenderer,source,destination,gpu,externalUniforms,externalPaths,@"external-first-frame-after-preparation");
run.record(@"external-lut-affects-frame",difference(neutral,externalFrame).different>100);
run.need(@"external-source-removed-for-no-io-check",[[NSFileManager defaultManager]removeItemAtPath:external error:&error]);
BOOL churnOK=YES;
for(int i=0;i<14;i++){@autoreleasepool{
NSString *other=[runtime stringByAppendingPathComponent:[NSString stringWithFormat:@"eviction-%02d.cube",i]];
NSString *text=@"LUT_3D_SIZE 2\n0 0 0\n1 0 0\n0 1 0\n1 1 0\n0 0 1\n1 0 1\n0 1 1\n1 1 1\n";
churnOK&=[text writeToFile:other atomically:YES encoding:NSUTF8StringEncoding error:&error];
__block BOOL ready=NO;__block BOOL success=NO;
[externalRenderer prepareLUTPath:other completion:^(NSError *failure){success=failure==nil;ready=YES;}];
double until=NSProcessInfo.processInfo.systemUptime+10;
while(!ready&&NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
churnOK&=ready&&success;
}}
run.need(@"external-preview-and-gpu-cache-churn",churnOK);
Pixels retainedFrame=render(run,externalRenderer,source,destination,gpu,externalUniforms,externalPaths,@"external-render-with-source-unavailable-after-cache-churn");
Difference retainedDifference=difference(externalFrame,retainedFrame);
run.record(@"external-snapshot-is-independent-of-file-and-preview-cache",retainedDifference.maximum==0&&retainedDifference.nonfinite==0,measure(retainedDifference));
__block BOOL cancelledDone=NO;__block BOOL cancellationReported=NO;
NSProgress *cancelled=[externalRenderer prepareLUTPath:[runtime stringByAppendingPathComponent:@"eviction-00.cube"] completion:^(NSError *failure){cancellationReported=failure.code==NSUserCancelledError;cancelledDone=YES;}];[cancelled cancel];
deadline=NSProcessInfo.processInfo.systemUptime+10;
while(!cancelledDone&&NSProcessInfo.processInfo.systemUptime<deadline)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
run.record(@"external-preparation-cancellation",cancelledDone&&cancellationReported);
NSString *userFolder=NSProcessInfo.processInfo.environment[@"DY_DIAGNOSTIC_LUT_FOLDER"];
if(userFolder.length){
NSUInteger userCount=0;BOOL allUserFrames=YES;
NSURL *folder=[NSURL fileURLWithPath:userFolder];
for(NSURL *file in [NSFileManager.defaultManager enumeratorAtURL:folder includingPropertiesForKeys:@[NSURLIsRegularFileKey] options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:nil]){@autoreleasepool{
NSNumber *regular=nil;[file getResourceValue:&regular forKey:NSURLIsRegularFileKey error:nil];
if(!regular.boolValue||![file.pathExtension.lowercaseString isEqual:@"cube"])continue;
__block BOOL ready=NO;__block NSError *failure=nil;
[externalRenderer prepareLUTPath:file.path completion:^(NSError *result){failure=[result retain];ready=YES;}];
double until=NSProcessInfo.processInfo.systemUptime+30;
while(!ready&&NSProcessInfo.processInfo.systemUptime<until)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.01]];
run.need([@"user-lut-preparation:" stringByAppendingString:file.lastPathComponent],ready&&!failure,@{@"error":reason(failure)});[failure release];
Pixels frame=render(run,externalRenderer,source,destination,gpu,externalUniforms,@{@"look0":file.path},[@"user-lut-render:" stringByAppendingString:file.lastPathComponent]);
Difference delta=difference(neutral,frame);BOOL good=delta.nonfinite==0;allUserFrames&=good;userCount++;
run.record([@"user-lut-finite-frame:" stringByAppendingString:file.lastPathComponent],good,measure(delta));
}}
run.record(@"user-folder-all-luts-prepared-and-rendered",userCount>0&&allUserFrames,@{@"files":@(userCount),@"sourceFolder":userFolder,@"sourceFilesModified":@NO});
}
[gpu release];
} @catch(NSException *exception) {
run.record(@"diagnostic-exception",false,@{@"exception":exception.name?:@"unknown",@"message":exception.reason?:@"unknown"});
+30 -14
查看文件
@@ -392,6 +392,8 @@ static NSImage *DYWheelImage(void) {
NSProgress *_menuScan;
NSDictionary *_pendingAssetMenuCommand;
}
- (NSProgress *)setAssetPath:(NSString *)path forKey:(NSString *)key completion:(void (^)(NSError *))completion;
- (BOOL)commitAssetPath:(NSString *)path forKey:(NSString *)key error:(NSError **)error;
@end
@implementation DYInspector
@@ -410,7 +412,7 @@ static NSImage *DYWheelImage(void) {
self.layer.backgroundColor=[DYThemePalette()[@"background"] CGColor];
self.appearance=[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
_brand=[DYLabel(@"◒ 大鱼调色",16) retain]; _brand.font=[NSFont boldSystemFontOfSize:16];_brand.textColor=DYInk();
_subtitle=[DYLabel([[NSBundle bundleForClass:self.class]objectForInfoDictionaryKey:@"CFBundleShortVersionString"]?:@"1.1.3",9) retain]; _subtitle.textColor=DYThemeColor(@"secondary");
_subtitle=[DYLabel([[NSBundle bundleForClass:self.class]objectForInfoDictionaryKey:@"CFBundleShortVersionString"]?:@"1.1.5",9) retain]; _subtitle.textColor=DYThemeColor(@"secondary");
_resetAll=[DYButton(@"↺",self,@selector(resetAll:)) retain];_resetAll.bordered=NO; _resetAll.toolTip=@"恢复全部调色参数与 LUT";_resetAll.accessibilityLabel=@"全部还原";
_save=[DYButton(@"保存预设",self,@selector(savePreset:)) retain];
_load=[DYButton(@"载入预设",self,@selector(loadPreset:)) retain];
@@ -870,7 +872,7 @@ static NSImage *DYWheelImage(void) {
[_browser close];[_browser release];_browser=nil;
id<FxCustomParameterActionAPI_v4> a=[self actionAPI];if(!a)return;[a startAction:self];NSString *selected=nil;@try{selected=[DYReadAssets(_manager,a.currentTime).paths[sender.identifier]copy];}@finally{[a endAction:self];}
__block DYInspector *owner=self;NSString *key=[[sender.identifier copy]autorelease];
_browser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:selected palette:DYThemePalette() selection:^(NSString *path){[owner setAssetPath:path forKey:key];}];[selected release];
_browser=[[DYLUTBrowser alloc]initWithLibrary:_library preview:[_renderer lookLUTPreview] selectedPath:selected palette:DYThemePalette() selection:^NSProgress *(NSString *path,void (^completion)(NSError *)){return [owner setAssetPath:path forKey:key completion:completion];}];[selected release];
id<FxRemoteWindowAPI> remote=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v3)];
if(!remote)remote=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v2)];if(!remote)remote=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI)];
DYLUTBrowser *browser=_browser;id<FxRemoteWindowAPI_v3> closer=[_manager apiForProtocol:@protocol(FxRemoteWindowAPI_v3)];
@@ -885,30 +887,44 @@ static NSImage *DYWheelImage(void) {
NSError *error=nil;if(![[NSFileManager defaultManager]createDirectoryAtURL:_library.rootURL withIntermediateDirectories:YES attributes:nil error:&error]){[self showError:error.localizedDescription];return;}[[NSWorkspace sharedWorkspace]openURL:_library.rootURL];
}
- (void)removeAsset:(NSButton *)sender { [self setAssetPath:nil forKey:sender.identifier]; }
- (void)setAssetPath:(NSString *)path forKey:(NSString *)key {
- (void)setAssetPath:(NSString *)path forKey:(NSString *)key {[self setAssetPath:path forKey:key completion:nil];}
- (NSProgress *)setAssetPath:(NSString *)path forKey:(NSString *)key completion:(void (^)(NSError *))completion {
[_assetLoads[key]cancel];[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
if(!path.length){[self commitAssetPath:nil forKey:key];return;}
if(!path.length){
NSError *error=nil;[self commitAssetPath:nil forKey:key error:&error];
NSProgress *done=[NSProgress discreteProgressWithTotalUnitCount:1];done.completedUnitCount=1;
dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(error);});return done;
}
NSUInteger requestID=++_nextAssetLoadID;_assetLoadIDs[key]=@(requestID);
NSProgress *task=DYLUTPrepareAsync(path,^(NSError *error){
if([_assetLoadIDs[key]unsignedIntegerValue]!=requestID||!self.window)return;[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
if(error){[self refresh];[_assetButtons[key][@"choose"]setTitle:@"载入失败"];[_assetButtons[key][@"choose"]setToolTip:error.localizedDescription];return;}
[self commitAssetPath:path forKey:key];
});_assetLoads[key]=task;[_assetButtons[key][@"choose"]setTitle:@"正在载入…"];
void (^prepared)(NSError *)=^(NSError *error){
if([_assetLoadIDs[key]unsignedIntegerValue]!=requestID||!self.window){
if(completion)completion([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]);return;
}
[_assetLoads removeObjectForKey:key];[_assetLoadIDs removeObjectForKey:key];
NSError *result=error;
if(!result)[self commitAssetPath:path forKey:key error:&result];
if(result){[self refresh];[_assetButtons[key][@"choose"]setTitle:@"载入失败"];[_assetButtons[key][@"choose"]setToolTip:result.localizedDescription];}
if(completion)completion(result);
};
NSProgress *task=_renderer?[_renderer prepareLUTPath:path completion:prepared]:DYLUTPrepareAsync(path,prepared);
_assetLoads[key]=task;[_assetButtons[key][@"choose"]setTitle:@"正在载入…"];return task;
}
- (void)cancelAssetLoads {
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads removeAllObjects];[_assetLoadIDs removeAllObjects];
}
- (void)commitAssetPath:(NSString *)path forKey:(NSString *)key {
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
- (BOOL)commitAssetPath:(NSString *)path forKey:(NSString *)key error:(NSError **)error {
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];
if(!action){if(error)*error=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:@"宿主暂时无法应用 LUT,请重试"}];return NO;}
BOOL written=NO;[action startAction:self];
@try {
CMTime t=action.currentTime;DYAssetState *assets=[[DYReadAssets(_manager,t) copy] autorelease];
if(!assets)assets=[[[DYAssetState alloc] init] autorelease];
NSMutableDictionary *paths=[[assets.paths mutableCopy] autorelease];if(!paths)paths=[NSMutableDictionary dictionary];
if(path.length)paths[key]=path;else [paths removeObjectForKey:key];
assets.paths=paths;DYWriteAssets(_manager,assets,t);
assets.paths=paths;written=DYWriteAssets(_manager,assets,t);
} @finally {[action endAction:self];}
[self postChanged];
if(written)[self postChanged];else if(error)*error=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:@"宿主未接受此 LUT,原来的选择已保留"}];
return written;
}
- (void)showError:(NSString *)message {
NSAlert *a=[[[NSAlert alloc] init] autorelease];a.messageText=@"大鱼调色";a.informativeText=message?:@"操作未完成";[a addButtonWithTitle:@"好"];[a runModal];
+4 -3
查看文件
@@ -2,15 +2,16 @@
@class DYLUTLibrary;
/// A nonmodal browser. Selecting a validated thumbnail applies that LUT.
/// All UI and selection callbacks run on the main thread.
typedef NSProgress * (^DYLUTSelectionHandler)(NSString *path,void (^completion)(NSError *error));
/// A nonmodal browser. The handler finishes asynchronously on the main thread
/// after decoding, GPU preparation and the host edit have actually succeeded.
@interface DYLUTBrowser : NSWindowController
@property(nonatomic,readonly) BOOL visible;
- (instancetype)initWithLibrary:(DYLUTLibrary *)library
preview:(NSData *)rgba
selectedPath:(NSString *)path
palette:(NSDictionary *)palette
selection:(void (^)(NSString *path))selection;
selection:(DYLUTSelectionHandler)selection;
- (void)showRelativeToView:(NSView *)view;
/// Attach to the FxRemoteWindow API's supplied parent; the caller owns that API.
/// Completion, double-click and close dismiss through closeAction exactly once.
+17 -10
查看文件
@@ -105,7 +105,7 @@ static NSString *const DYBrowserFolderPreference=@"com.dayu.color.lookLUTPreview
NSData *_preview;
NSString *_selectedPath,*_folder;
NSDictionary *_palette;
void (^_selection)(NSString *);
DYLUTSelectionHandler _selection;
void (^_closeAction)(void);
NSPopover *_popover;
DYBrowserCanvas *_root,*_folderDocument,*_gridDocument;
@@ -133,12 +133,12 @@ static NSString *const DYBrowserFolderPreference=@"com.dayu.color.lookLUTPreview
@implementation DYLUTBrowser
static NSTextField *BrowserLabel(NSString *title,CGFloat size){NSTextField *label=[NSTextField labelWithString:title];label.font=[NSFont systemFontOfSize:size];label.lineBreakMode=NSLineBreakByTruncatingTail;return label;}
static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *button=[NSButton buttonWithTitle:title target:target action:action];button.font=[NSFont systemFontOfSize:11];button.bezelStyle=NSBezelStyleRounded;return button;}
- (instancetype)initWithLibrary:(DYLUTLibrary *)library preview:(NSData *)rgba selectedPath:(NSString *)path palette:(NSDictionary *)palette selection:(void (^)(NSString *))selection{
- (instancetype)initWithLibrary:(DYLUTLibrary *)library preview:(NSData *)rgba selectedPath:(NSString *)path palette:(NSDictionary *)palette selection:(DYLUTSelectionHandler)selection{
NSPanel *panel=[[[NSPanel alloc]initWithContentRect:NSMakeRect(0,0,760,560) styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO]autorelease];
if((self=[super initWithWindow:panel])){
NSString *savedFolder=[[NSUserDefaults standardUserDefaults]stringForKey:DYBrowserFolderPreference];
_library=[library retain];_preview=[rgba copy];_selectedPath=[path copy];_folder=[(savedFolder?:@"*") copy];_selection=[selection copy];
_folderButtons=[NSMutableArray new];_tiles=[NSMutableDictionary new];_queuedPaths=[NSMutableSet new];_thumbnailCache=[NSCache new];_thumbnailCache.countLimit=600;_thumbnailCache.totalCostLimit=64*1024*1024;_previewQueue=dispatch_queue_create("com.dayu.color.lut-thumbnails",DISPATCH_QUEUE_SERIAL);
_folderButtons=[NSMutableArray new];_tiles=[NSMutableDictionary new];_queuedPaths=[NSMutableSet new];_thumbnailCache=[NSCache new];_thumbnailCache.countLimit=600;_thumbnailCache.totalCostLimit=64*1024*1024;_previewQueue=dispatch_queue_create("com.dayu.color.lut-thumbnails",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_previewQueue,dispatch_get_global_queue(QOS_CLASS_UTILITY,0));
panel.title=@"风格 LUT";panel.minSize=NSMakeSize(760,420);panel.releasedWhenClosed=NO;panel.hidesOnDeactivate=NO;panel.delegate=self;
_root=[[DYBrowserCanvas alloc]initWithFrame:NSMakeRect(0,0,760,560)];_root.accessibilityLabel=@"LUT 缩略图浏览库";panel.contentView=_root;
_titleLabel=[BrowserLabel(@"LUT 文件夹",14)retain];_titleLabel.font=[NSFont systemFontOfSize:14 weight:NSFontWeightSemibold];
@@ -397,19 +397,26 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
if(!sender.enabled||sender.failure.length)return;
[_selectionTask cancel];[_selectionTask release];NSUInteger generation=++_selectionGeneration;
NSString *path=sender.identifier,*name=sender.displayName;BOOL closeAfter=sender.doubleClicked;[self setStatus:[@"正在载入 " stringByAppendingString:name]];
_selectionTask=[DYLUTPrepareAsync(path,^(NSError *error){
void (^applied)(NSError *)=^(NSError *error){
if(_closed||generation!=_selectionGeneration)return;[_selectionTask release];_selectionTask=nil;
if(error){[self setStatus:error.localizedDescription];return;}
[_selectedPath release];_selectedPath=[path copy];
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=[tile.identifier isEqualToString:path];[tile setNeedsDisplay:YES];}
if(_selection)_selection(path);[self setStatus:[@"已选择 " stringByAppendingString:name]];if(closeAfter)[self close];
})retain];
[self setStatus:[@"已选择 " stringByAppendingString:name]];if(closeAfter)[self close];
};
_selectionTask=[(_selection?_selection(path,applied):DYLUTPrepareAsync(path,applied))retain];
}
- (void)clearSelection:(id)sender{
++_selectionGeneration;[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;
[_selectedPath release];_selectedPath=nil;
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=NO;[tile setNeedsDisplay:YES];}
if(_selection)_selection(nil);[self setStatus:@"已移除 LUT"];
NSUInteger generation=++_selectionGeneration;[_selectionTask cancel];[_selectionTask release];_selectionTask=nil;
[self setStatus:@"正在移除 LUT…"];
void (^cleared)(NSError *)=^(NSError *error){
if(_closed||generation!=_selectionGeneration)return;[_selectionTask release];_selectionTask=nil;
if(error){[self setStatus:error.localizedDescription];return;}
[_selectedPath release];_selectedPath=nil;
for(DYBrowserTile *tile in _tiles.allValues){tile.chosen=NO;[tile setNeedsDisplay:YES];}
[self setStatus:@"已移除 LUT"];
};
if(_selection)_selectionTask=[_selection(nil,cleared)retain];else cleared(nil);
}
- (void)done:(id)sender{[self close];}
- (void)showImportError:(NSError *)error{if(error&&!_closed)[self setStatus:error.localizedDescription];}
+13
查看文件
@@ -6,6 +6,19 @@
NS_ASSUME_NONNULL_BEGIN
/// Immutable decoded contents. A retained snapshot survives preview-cache
/// eviction and does not consult the source file while a frame is rendered.
@interface DYLUTPreparedTable : NSObject
@property(nonatomic,readonly) NSUInteger dimension;
@property(nonatomic,readonly,copy) NSString *path;
@property(nonatomic,readonly,copy) NSString *revision;
- (const float *)rgbaValues;
@end
/// Synchronous worker-only entry; do not call it from an inspector action.
FOUNDATION_EXPORT DYLUTPreparedTable * _Nullable DYLUTReadPreparedTable(NSString *path,
NSProgress * _Nullable progress, NSError * _Nullable * _Nullable error);
#ifdef __cplusplus
/// Same red-fastest 3D Cube table and DOMAIN resampling used by the renderer.
/// Output is cleared on failure. Built-in .dylut tables are also supported.
+105 -25
查看文件
@@ -32,12 +32,19 @@ static BOOL DYLUTFail(NSError **error,NSString *message) {
return NO;
}
@interface DYLUTTable : NSObject {
@interface DYLUTPreparedTable () {
@public std::vector<float> values;
@public NSUInteger dimension;
@public NSUInteger _dimension;
@public NSString *_path,*_revision;
}
@end
@implementation DYLUTTable @end
@implementation DYLUTPreparedTable
- (void)dealloc {[_path release];[_revision release];[super dealloc];}
- (NSUInteger)dimension {return _dimension;}
- (NSString *)path {return _path;}
- (NSString *)revision {return _revision;}
- (const float *)rgbaValues {return values.data();}
@end
static NSCache *DYLUTTableCache(void) {
static NSCache *cache;static dispatch_once_t once;
@@ -67,6 +74,78 @@ static BOOL DYLUTCancelled(NSProgress *progress,NSError **error) {
if(error)*error=[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey:@"已取消 LUT 加载"}];
return YES;
}
static NSError *DYLUTFileError(NSError *error,NSURL *url) {
if(error.code==NSUserCancelledError&&[error.domain isEqual:NSCocoaErrorDomain])return error;
NSMutableDictionary *info=[NSMutableDictionary dictionaryWithDictionary:error.userInfo?:@{}];
info[NSLocalizedDescriptionKey]=[NSString stringWithFormat:@"%@:%@",url.lastPathComponent,error.localizedDescription?:@"无法读取此 LUT"];
info[NSFilePathErrorKey]=url.path;if(error)info[NSUnderlyingErrorKey]=error;
return [NSError errorWithDomain:error.domain?:DYLUTLibraryErrorDomain code:error?error.code:1 userInfo:info];
}
static bool DYLUTUnicodeSpace(uint32_t c) {
return c==0x20||(c>=9&&c<=13)||c==0x85||c==0xa0||c==0x1680||
(c>=0x2000&&c<=0x200a)||c==0x2028||c==0x2029||c==0x202f||c==0x205f||c==0x3000;
}
static void DYLUTAppendScalar(std::string& text,uint32_t c) {
if(DYLUTUnicodeSpace(c)) {
text+=char(c==13?'\r':c==10||c==0x85||c==0x2028||c==0x2029?'\n':' ');return;
}
if(c<0x80)text+=char(c);
else if(c<0x800){text+=char(0xc0|(c>>6));text+=char(0x80|(c&63));}
else if(c<0x10000){text+=char(0xe0|(c>>12));text+=char(0x80|((c>>6)&63));text+=char(0x80|(c&63));}
else {text+=char(0xf0|(c>>18));text+=char(0x80|((c>>12)&63));text+=char(0x80|((c>>6)&63));text+=char(0x80|(c&63));}
}
// Normalize only the working copy. Imports retain their original bytes. Narrow
// files remain byte-transparent so legacy TITLE/comment encodings still work.
static BOOL DYLUTText(NSData *bytes,std::string& text,NSProgress *progress,NSError **error) {
const uint8_t *p=(const uint8_t *)bytes.bytes;size_t length=bytes.length,offset=0,width=1;bool little=true;
if(!length)return DYLUTFail(error,@"LUT 文件为空");
auto unit=[&](size_t at,size_t w,bool le){uint32_t c=0;for(size_t k=0;k<w;k++)c|=uint32_t(p[at+k])<<(8*(le?k:w-1-k));return c;};
if(length>=4&&unit(0,4,true)==0x0000feff){width=4;offset=4;}
else if(length>=4&&unit(0,4,false)==0x0000feff){width=4;offset=4;little=false;}
else if(length>=2&&unit(0,2,true)==0xfeff){width=2;offset=2;}
else if(length>=2&&unit(0,2,false)==0xfeff){width=2;offset=2;little=false;}
else if(length>=3&&!memcmp(p,"\xef\xbb\xbf",3))offset=3;
else {
// Without a BOM, infer byte order only from a recognizable Cube prefix.
// Never remove arbitrary NUL bytes or guess an encoding from the title.
auto prefix=[&](size_t w,bool le){bool whitespace=false;
for(size_t at=0;at+w<=length&&at<128;at+=w){uint32_t c=unit(at,w,le);
if(DYLUTUnicodeSpace(c)||c==0xfeff){whitespace=true;continue;}
return c=='#'||(c>='A'&&c<='Z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||c=='+'||c=='-'||c=='.';
}return whitespace;
};
for(size_t w:{size_t(4),size_t(2)}) {
if(prefix(w,true)){width=w;break;}
if(prefix(w,false)){width=w;little=false;break;}
}
}
if(width==1){text.assign((const char *)p+offset,length-offset);return !DYLUTCancelled(progress,error);}
NSString *encoding=[NSString stringWithFormat:@"UTF-%lu%@",(unsigned long)(width*8),little?@"LE":@"BE"];
auto invalid=[&](NSString *detail){return DYLUTFail(error,[NSString stringWithFormat:@"%@ 编码损坏:%@",encoding,detail]);};
if((length-offset)%width)return invalid(@"文件结尾不完整");
text.clear();text.reserve((length-offset)/width);
size_t nextCancellationCheck=offset;
for(size_t at=offset;at<length;at+=width){
if(at>=nextCancellationCheck){if(DYLUTCancelled(progress,error))return NO;nextCancellationCheck=at+16384;}
uint32_t c=unit(at,width,little);
if(width==2&&c>=0xd800&&c<=0xdbff){
if(at+4>length)return invalid(@"缺少配对字符");uint32_t next=unit(at+2,2,little);
if(next<0xdc00||next>0xdfff)return invalid(@"字符配对无效");c=0x10000+((c-0xd800)<<10)+(next-0xdc00);at+=2;
}else if(c>=0xd800&&c<=0xdfff)return invalid(@"孤立的配对字符");
if(c>0x10ffff||c==0)return invalid(@"含无效字符");
DYLUTAppendScalar(text,c);
}
return !DYLUTCancelled(progress,error);
}
static std::string_view DYLUTTrim(std::string_view v) {
while(!v.empty()) {
unsigned char c=v.front();size_t count=0;
if(c<0x80){if(c==' '||(c>=9&&c<=13))count=1;else break;}
else if(c==0xc2&&v.size()>=2&&v[1]=='\xa0')count=2;
else if((c==0xe1||c==0xe2||c==0xe3)&&v.size()>=3&&(v.substr(0,3)=="\xe1\x9a\x80"||v.substr(0,3)=="\xe2\x80\xaf"||v.substr(0,3)=="\xe2\x81\x9f"||v.substr(0,3)=="\xe3\x80\x80"||(v.substr(0,2)=="\xe2\x80"&&(unsigned char)v[2]>=0x80&&(unsigned char)v[2]<=0x8a)))count=3;
if(!count)break;v.remove_prefix(count);
}return v;
}
static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,NSProgress *progress,NSError **error) {
data.clear();size=0;
NSDictionary *attributes=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:error];
@@ -85,35 +164,31 @@ static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,
for(float v:data)if(!std::isfinite(v))return DYLUTFail(error,@"输入 LUT 含无效数字");
size=n;return YES;
}
// Validate encoding once, then parse byte spans without allocating an
// NSString, NSArray and temporary strings for every numeric row.
NSString *text=[[NSString alloc]initWithData:bytes encoding:NSUTF8StringEncoding];
if(!text)return DYLUTFail(error,@"LUT 必须是 UTF-8 文本");[text release];
std::string storage((const char *)bytes.bytes,bytes.length);
std::string storage;if(!DYLUTText(bytes,storage,progress,error))return NO;
static locale_t numericLocale;static dispatch_once_t localeOnce;dispatch_once(&localeOnce,^{numericLocale=newlocale(LC_NUMERIC_MASK,"C",NULL);});
float domainMin[3]={0,0,0},domainMax[3]={1,1,1};BOOL foundSize=NO;
std::string_view remaining(storage);NSUInteger rows=0;
if(remaining.size()>=3&&remaining.substr(0,3)=="\xef\xbb\xbf")remaining.remove_prefix(3);
auto trim=[](std::string_view v){while(!v.empty()&&(v.front()==' '||v.front()=='\t'||v.front()=='\r'))v.remove_prefix(1);return v;};
auto trim=DYLUTTrim;
auto number=[&](std::string_view& v,float& value){v=trim(v);if(v.empty())return false;char *end=nullptr;value=strtof_l(v.data(),&end,numericLocale);if(end==v.data()||end>v.data()+v.size())return false;v.remove_prefix(end-v.data());return true;};
while(!remaining.empty()) {
if((rows++&1023)==0&&DYLUTCancelled(progress,error))return NO;
size_t end=remaining.find_first_of("\r\n");std::string_view line=remaining.substr(0,end);
if(end==std::string_view::npos)remaining={};else remaining.remove_prefix(end+1);
if(end==std::string_view::npos)remaining={};else {size_t count=end+1;if(remaining[end]=='\r'&&count<remaining.size()&&remaining[count]=='\n')count++;remaining.remove_prefix(count);}
line=line.substr(0,line.find('#'));line=trim(line);if(line.empty())continue;
float r=0,g=0,b=0;
auto starts=[&](std::string_view prefix){return line.substr(0,prefix.size())==prefix;};
if(starts("LUT_3D_SIZE")) {
auto v=trim(line.substr(11));int n=0;auto result=std::from_chars(v.data(),v.data()+v.size(),n);
if(result.ec!=std::errc{}||foundSize||n<2||n>128)return DYLUTFail(error,@"LUT 尺寸应为 2–128,且只能声明一次");
if(result.ec!=std::errc{}||!trim(v.substr(result.ptr-v.data())).empty()||foundSize||n<2||n>128)return DYLUTFail(error,@"LUT 尺寸应为 2–128,且只能声明一次");
size=n;foundSize=YES;data.reserve(size*size*size*4);
} else if(starts("DOMAIN_MIN")||starts("DOMAIN_MAX")) {
auto v=line.substr(10);if(!number(v,r)||!number(v,g)||!number(v,b))return DYLUTFail(error,@"LUT DOMAIN 范围无效");
auto v=line.substr(10);if(!number(v,r)||!number(v,g)||!number(v,b)||!trim(v).empty())return DYLUTFail(error,@"LUT DOMAIN 范围无效");
float *domain=starts("DOMAIN_MIN")?domainMin:domainMax;domain[0]=r;domain[1]=g;domain[2]=b;
} else if(starts("TITLE")||starts("LUT_3D_INPUT_RANGE"))continue;
else if(starts("LUT_1D_SIZE"))return DYLUTFail(error,@"请选择三维 .cube LUT");
else {
auto v=line;if(!number(v,r)||!number(v,g)||!number(v,b)||!std::isfinite(r)||!std::isfinite(g)||!std::isfinite(b))return DYLUTFail(error,@"LUT 含无效数据行");
auto v=line;if(!number(v,r)||!number(v,g)||!number(v,b)||!trim(v).empty()||!std::isfinite(r)||!std::isfinite(g)||!std::isfinite(b))return DYLUTFail(error,[NSString stringWithFormat:@"LUT 第 %lu 行含无效数字或多余内容",(unsigned long)rows]);
data.insert(data.end(),{r,g,b,1});if(data.size()>128*128*128*4)return DYLUTFail(error,@"LUT 数据过多");
}
}
@@ -137,19 +212,24 @@ static BOOL DYLUTParse(NSString *path,std::vector<float>& data,NSUInteger& size,
return YES;
}
static BOOL DYLUTReadCancellable(NSString *path,std::vector<float>& data,NSUInteger& size,NSProgress *progress,NSError **error) {
data.clear();size=0;
if(!path.length)return DYLUTFail(error,@"未选择 LUT 文件");
DYLUTPreparedTable *DYLUTReadPreparedTable(NSString *path,NSProgress *progress,NSError **error) {
if(DYLUTCancelled(progress,error))return nil;
if(!path.length){DYLUTFail(error,@"未选择 LUT 文件");return nil;}
NSDictionary *a=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:error];
if(!a)return NO;
if(!a)return nil;
NSString *key=[NSString stringWithFormat:@"%@|%.9f|%@|%@",path.stringByStandardizingPath,[a[NSFileModificationDate]timeIntervalSinceReferenceDate],a[NSFileSize],a[NSFileSystemFileNumber]];
DYLUTTable *cached=[DYLUTTableCache()objectForKey:key];
if(cached){data=cached->values;size=cached->dimension;return YES;}
DYLUTPreparedTable *cached=[DYLUTTableCache()objectForKey:key];
if(cached)return cached;
std::vector<float> parsed;NSUInteger n=0;
if(DYLUTCancelled(progress,error)||!DYLUTParse(path,parsed,n,progress,error))return NO;
DYLUTTable *table=[[[DYLUTTable alloc]init]autorelease];table->values=std::move(parsed);table->dimension=n;
if(DYLUTCancelled(progress,error)||!DYLUTParse(path,parsed,n,progress,error))return nil;
DYLUTPreparedTable *table=[[[DYLUTPreparedTable alloc]init]autorelease];table->values=std::move(parsed);table->_dimension=n;
table->_path=[path copy];table->_revision=[key copy];
[DYLUTTableCache()setObject:table forKey:key cost:table->values.size()*sizeof(float)];
data=table->values;size=n;return YES;
return table;
}
static BOOL DYLUTReadCancellable(NSString *path,std::vector<float>& data,NSUInteger& size,NSProgress *progress,NSError **error) {
data.clear();size=0;DYLUTPreparedTable *table=DYLUTReadPreparedTable(path,progress,error);
if(!table)return NO;data=table->values;size=table.dimension;return YES;
}
BOOL DYLUTReadCube(NSString *path,std::vector<float>& data,NSUInteger& size,NSError **error) {
@@ -162,7 +242,7 @@ NSProgress *DYLUTPrepareAsync(NSString *path,void (^completion)(NSError *)) {
dispatch_async(queue,^{@autoreleasepool{
NSError *error=nil;std::vector<float> values;NSUInteger n=0;
DYLUTReadCancellable(path,values,n,progress,&error);DYLUTCancelled(progress,&error);progress.completedUnitCount=1;
dispatch_async(dispatch_get_main_queue(),^{if(completion)completion(error);});
dispatch_async(dispatch_get_main_queue(),^{NSError *result=error;DYLUTCancelled(progress,&result);if(completion)completion(result);});
}});return progress;
}
@@ -358,7 +438,7 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
NSError *itemError=nil;BOOL valid=NO;
@autoreleasepool{
progress.localizedDescription=[NSString stringWithFormat:@"正在校验 %lld/%lu",progress.completedUnitCount+1,(unsigned long)plans.count];progress.localizedAdditionalDescription=[plan[@"source"]lastPathComponent];
std::vector<float> values;NSUInteger n=0;valid=!DYLUTCancelled(progress,&itemError)&&DYLUTReadCancellable([plan[@"source"]path],values,n,progress,&itemError);[itemError retain];
std::vector<float> values;NSUInteger n=0;valid=!DYLUTCancelled(progress,&itemError)&&DYLUTReadCancellable([plan[@"source"]path],values,n,progress,&itemError);if(!valid)itemError=DYLUTFileError(itemError,plan[@"source"]);[itemError retain];
}
if(!valid){if(error)*error=[itemError autorelease];else[itemError release];return nil;}[itemError release];progress.completedUnitCount++;
}
@@ -377,7 +457,7 @@ static BOOL DYLUTEnsureDirectory(NSURL *directory,NSURL *root,NSError **error) {
if(![fm copyItemAtURL:plan[@"source"] toURL:destination error:&itemError])return NO;[created addObject:destination];
std::vector<float> values;NSUInteger n=0;if(!DYLUTReadCancellable(destination.path,values,n,progress,&itemError))return NO;
[imported addObject:DYLUTEntry(destination,_rootURL)];return YES;
}();[itemError retain];
}();if(!copied)itemError=DYLUTFileError(itemError,plan[@"source"]);[itemError retain];
}
if(!copied){if(error)*error=[itemError autorelease];else[itemError release];success=NO;break;}[itemError release];progress.completedUnitCount++;
}
+3
查看文件
@@ -3,6 +3,9 @@
#import <FxPlug/FxPlugSDK.h>
#import "DYUniforms.h"
@interface DYRenderer : NSObject
/// Decode and upload before committing a host parameter. The renderer retains
/// the immutable selected contents independently of the thumbnail cache.
- (NSProgress *)prepareLUTPath:(NSString *)path completion:(void (^)(NSError *error))completion;
- (BOOL)renderSource:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths error:(NSError**)error;
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)uniforms paths:(NSDictionary*)paths error:(NSError**)error;
- (NSData*)preview;
+36 -7
查看文件
@@ -9,7 +9,9 @@ static BOOL fail(NSError**e,NSString*m){if(e)*e=[NSError errorWithDomain:@"com.d
static NSArray *inputFiles(){return @[@"",@"apple_log_to_rec709",@"arri_logc3_to_rec709",@"arri_logc4_to_rec709",@"blackmagic_film_gen5_to_rec709",@"canon_clog_bt709_to_rec709",@"canon_clog2_cinema_gamut_to_rec709",@"canon_clog3_cinema_gamut_to_rec709",@"dji_dlog_to_rec709",@"dji_dlog_m_to_rec709",@"fujifilm_flog_to_rec709",@"fujifilm_flog2_to_rec709",@"nikon_nlog_to_rec709",@"panasonic_vlog_vgamut_to_rec709",@"red_log3g10_rwg_to_rec709",@"sony_slog2_sgamut_to_rec709",@"sony_slog3_sgamut3cine_to_rec709",@"sony_hlg_bt2020_to_rec709"];}
static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){MTLTextureDescriptor*t=[MTLTextureDescriptor new];t.textureType=MTLTextureType3D;t.pixelFormat=MTLPixelFormatRGBA32Float;t.width=n;t.height=n;t.depth=n;t.storageMode=MTLStorageModeShared;t.usage=MTLTextureUsageShaderRead;id<MTLTexture>x=[d newTextureWithDescriptor:t];[t release];if(x)[x replaceRegion:MTLRegionMake3D(0,0,0,n,n,n) mipmapLevel:0 slice:0 withBytes:values bytesPerRow:n*16 bytesPerImage:n*n*16];return [x autorelease];}
@interface DYRenderer(){
NSMutableDictionary *_devices,*_luts;
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
NSSet *_activeLUTPaths;
dispatch_queue_t _lutPreparationQueue;
DYColorTables *_tables;
NSObject *_previewLock;
NSData *_preview,*_lookLUTPreview;
@@ -17,8 +19,30 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
}
@end
@implementation DYRenderer
- (instancetype)init{if((self=[super init])){_previewLock=[NSObject new];_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_tables=[DYColorTables new];}return self;}
- (void)dealloc{[_devices release];[_luts release];[_tables release];[_preview release];[_lookLUTPreview release];[_previewLock release];[super dealloc];}
- (instancetype)init{if((self=[super init])){_previewLock=[NSObject new];_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_preparedLUTs=[NSMutableDictionary new];_activeLUTPaths=[NSSet new];_lutPreparationQueue=dispatch_queue_create("com.dayu.color.lut-upload",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_lutPreparationQueue,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0));_tables=[DYColorTables new];}return self;}
- (void)dealloc{[_devices release];[_luts release];[_preparedLUTs release];[_activeLUTPaths release];dispatch_release(_lutPreparationQueue);[_tables release];[_preview release];[_lookLUTPreview release];[_previewLock release];[super dealloc];}
- (void)trimPreparedLUTsKeeping:(NSString *)path {
if(_preparedLUTs.count<=12)return;
for(NSString *key in _preparedLUTs.allKeys)if(![_activeLUTPaths containsObject:key]&&![key isEqualToString:path])[_preparedLUTs removeObjectForKey:key];
}
- (id<MTLTexture>)textureForTable:(DYLUTPreparedTable *)table entry:(NSDictionary *)entry error:(NSError **)error {
NSString *key=[NSString stringWithFormat:@"%llu|%@",[entry[@"device"]registryID],table.revision];id<MTLTexture>texture=_luts[key];
if(!texture){texture=texture3D(entry[@"device"],table.rgbaValues,table.dimension);if(!texture){fail(error,@"LUT 纹理分配失败");return nil;}if(_luts.count>=12)[_luts removeAllObjects];_luts[key]=texture;}return texture;
}
- (NSProgress *)prepareLUTPath:(NSString *)path completion:(void (^)(NSError *))completion {
NSProgress *progress=[NSProgress discreteProgressWithTotalUnitCount:2];progress.localizedDescription=@"正在载入 LUT…";path=[[path copy]autorelease];
dispatch_async(_lutPreparationQueue,^{@autoreleasepool{
NSError *error=nil;DYLUTPreparedTable *table=progress.cancelled?nil:DYLUTReadPreparedTable(path,progress,&error);progress.completedUnitCount=1;
if(table&&!progress.cancelled){@synchronized(self){
if(!_devices.count)[self device:0 error:&error];
if(!_devices.count&&!error)fail(&error,@"没有可用的 LUT 渲染设备");
BOOL ready=error==nil;for(NSDictionary *entry in _devices.allValues)if(!progress.cancelled&&![self textureForTable:table entry:entry error:&error]){ready=NO;break;}
if(ready&&!progress.cancelled){_preparedLUTs[path]=table;[self trimPreparedLUTsKeeping:path];}
}}
if(progress.cancelled)error=[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey:@"已取消 LUT 加载"}];
progress.completedUnitCount=2;dispatch_async(dispatch_get_main_queue(),^{NSError *result=progress.cancelled?[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]:error;if(completion)completion(result);});
}});return progress;
}
- (void)invalidatePreview{@synchronized(_previewLock){[_preview release];_preview=nil;[_lookLUTPreview release];_lookLUTPreview=nil;_lastPreview=0;}}
- (NSData*)preview{@synchronized(_previewLock){return [[_preview retain]autorelease];}}
- (NSData*)lookLUTPreview{@synchronized(_previewLock){return [[_lookLUTPreview retain]autorelease];}}
@@ -30,13 +54,17 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
_devices[k]=entry;[d release];[lib release];[q release];return entry;
// Preparing before the first frame may use registry 0. Reuse those pipelines
// when the host subsequently supplies that device's actual registry ID.
_devices[k]=entry;_devices[@(d.registryID)]=entry;[d release];[lib release];[q release];return entry;
}
- (id<MTLTexture>)lut:(NSString*)path entry:(NSDictionary*)e error:(NSError**)err{
if(!path.length)return e[@"identity"];
NSDictionary*attrs=[[NSFileManager defaultManager]attributesOfItemAtPath:path error:err];if(!attrs)return nil;
NSString*key=[NSString stringWithFormat:@"%llu|%@|%.9f|%@|%@",[e[@"device"]registryID],path,[attrs[NSFileModificationDate]timeIntervalSinceReferenceDate],attrs[NSFileSize],attrs[NSFileSystemFileNumber]];id<MTLTexture>t=_luts[key];if(t)return t;
std::vector<float>v;NSUInteger n=0;if(!DYLUTReadCube(path,v,n,err))return nil;t=texture3D(e[@"device"],v.data(),n);if(!t){fail(err,@"LUT 纹理分配失败");return nil;}if(_luts.count>=12)[_luts removeAllObjects];_luts[key]=t;return t;
DYLUTPreparedTable *table=_preparedLUTs[path];
// Restored projects load once on their render worker. Explicit selections
// arrive prepared, so neither metadata I/O nor text parsing occurs here.
if(!table){table=DYLUTReadPreparedTable(path,nil,err);if(!table)return nil;_preparedLUTs[path]=table;[self trimPreparedLUTsKeeping:path];}
return [self textureForTable:table entry:e error:err];
}
- (NSArray*)textures:(NSDictionary*)paths uniforms:(DYUniforms*)u entry:(NSDictionary*)e error:(NSError**)err{
// Normalize only this render copy. Folded groups retain their host parameters
@@ -54,6 +82,7 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
id<MTLTexture>h=[_tables hslForDevice:d uniforms:u],w=[_tables whiteBalanceForDevice:d uniforms:u],g=[_tables gradingForDevice:d uniforms:u];if(!h||!w||!g){fail(err,_tables.lastError?:@"颜色查表构建失败");return nil;}[ts addObjectsFromArray:@[h,w,g]];return ts;
}
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){@autoreleasepool{
[_activeLUTPaths release];_activeLUTPaths=[[NSSet alloc]initWithArray:paths.allValues?:@[]];
NSMutableDictionary*e=[self device:dst.deviceRegistryID error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];id<MTLTexture>input=[src metalTextureForDevice:d],output=[dst metalTextureForDevice:d];if(!input||!output)return fail(err,@"宿主图像纹理不可用");
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;
NSMutableDictionary*ps=e[@"pipelines"];NSNumber*format=@(output.pixelFormat);id<MTLRenderPipelineState>pipeline=ps[format];if(!pipeline){MTLRenderPipelineDescriptor*p=[MTLRenderPipelineDescriptor new];p.vertexFunction=[e[@"library"]newFunctionWithName:@"dyVertex"];p.fragmentFunction=[e[@"library"]newFunctionWithName:@"dyFragment"];p.colorAttachments[0].pixelFormat=output.pixelFormat;pipeline=[d newRenderPipelineStateWithDescriptor:p error:err];[p.vertexFunction release];[p.fragmentFunction release];[p release];if(!pipeline)return NO;ps[format]=pipeline;[pipeline release];}
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.5</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>16</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.5</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>16</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>