Verify eight print colors against reference and remote recovery; prepare 1.6.0

这个提交包含在:
mac 于 2026-11-02 14:37:34 +08:00 提交
1 父节点 ab7cb759e5
当前提交 2b2d657de7
5 个文件已更改
+31070 -1

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

+5 -1
查看文件
@@ -18,4 +18,8 @@
新增第六页“印片”,默认无,八项Kodak2383/2393/2302 BW、Fuji3510/3513/3519/3521、AgfaCP30;旧参数、1.5.0的1296字节前缀及颗粒时间位置保留。预设v6继续读旧版本,新参数缺省中性,独立层默认无。印片是逐像素变换,可写入静态Cube;空间、时间和蒙版限制继续保留。
1.6.0(35)渲染和模板已经编译。当前393项原生检查全部通过,含既有349项及八种印片资源/输出、强度/眼睛/总混合精确旁路、独立两层归档、蒙版和Cube格点对照。组件级原版图像对照仍在核对Core Image串联透明度语义;正式安装仍为1.5.0,未把开发编译副本作为可见版本运行。
1.6.0(35)渲染和模板已经编译。393项原生检查全部通过,含既有349项及八种印片资源/输出、强度/眼睛/总混合精确旁路、独立两层归档、蒙版和Cube格点对照。四尺寸64×48、63×47、1×17、17×1共136项原版颜色函数对照通过,固定容差0.0001,最大线性RGB绝对差0.000004827976;记录 `verification/PrintLooksNative.json`、`PrintLooksReference.json`。远端节点 `ab7cb759e57cc9c2a4725426bced67af55155654` 已独立恢复280文件、全字节比较/full-strict fsck、Release构建及393检查通过,见 `PrintLooksRecovery.json`。
透明度边界已单独取证:原版FTColorSpaceFilter将RGB当直色值转换,LMT processor则按预乘alpha读取。直接用fractional-alpha把两者串联不等于颜色函数,最大偏差3.975311214;八外观alpha=1颜色对照全部通过。32个保活转换filter身份互异,排除共享可变单例。对照工具完整保留原始链、每alpha分组及各中间图样本的诊断,不调整容差掩盖差异。正式算法采用原版alpha=1颜色函数并保持本产品的输入/输出预乘合同,透明像素保留、非透明像素显式解预乘/再预乘;这是有记录的适配,不声称原版Core Image直串在半透明时逐像素等效。
当前准备正式交付;在此检查点正式安装仍为1.5.0,未把开发编译副本作为可见版本运行。
+23
查看文件
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""Create isolated print-look host projects using existing synthetic QA media."""
from pathlib import Path
import uuid
import xml.etree.ElementTree as E
QA=Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa')
CHART=QA/'\u5927\u9c7c\u8c03\u8272\u9a8c\u6536\u56fe.png'
MOVIE=QA/'\u5927\u9c7c\u8c03\u8272_\u8499\u7248\u5408\u6210\u8fd0\u52a8.mov'
assert CHART.is_file() and MOVIE.is_file()
xml=E.Element('fcpxml',version='1.12');r=E.SubElement(xml,'resources')
E.SubElement(r,'format',id='f1',width='1920',height='1080',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)')
E.SubElement(r,'format',id='f2',width='960',height='540',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)')
E.SubElement(r,'format',id='still',width='1920',height='1080',name='FFVideoFormatRateUndefined')
for ident,path,fmt,duration in [('chart',CHART,'still','0s'),('movie',MOVIE,'f2','4s')]:
a=E.SubElement(r,'asset',id=ident,name=path.stem,start='0s',duration=duration,format=fmt,hasVideo='1',videoSources='1');E.SubElement(a,'media-rep',kind='original-media',src=path.as_uri())
E.SubElement(r,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef')
event=E.SubElement(E.SubElement(xml,'library'),'event',name='大鱼调色_1.6_八种印片验收',uid=str(uuid.uuid4()).upper())
for name,asset,fmt in [('大鱼调色_1.6_八种印片','chart','f1'),('大鱼调色_1.6_黑白印片','chart','f1'),('大鱼调色_1.6_印片叠层与蒙版','movie','f2')]:
project=E.SubElement(event,'project',name=name,uid=str(uuid.uuid4()).upper());seq=E.SubElement(project,'sequence',format=fmt,duration='4s',tcStart='0s',tcFormat='NDF',audioLayout='stereo',audioRate='48k');spine=E.SubElement(seq,'spine')
clip=E.SubElement(spine,'video' if asset=='chart' else 'asset-clip',ref=asset,name=name,offset='0s',start='0s',duration='4s');E.SubElement(clip,'filter-video',ref='fx',name='大鱼调色',enabled='1')
# Apply settings through the installed native inspector, never hidden XML IDs.
E.indent(xml);destination=QA/'print-looks-1.6.fcpxml';destination.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'+E.tostring(xml,encoding='unicode')+'\n');print(destination)
+127
查看文件
@@ -0,0 +1,127 @@
// Read-only oracle tool. Neither product builds nor product rendering load
// the installed Color Finale framework used here.
// Build with clang++ -std=c++17 -fno-objc-arc, Foundation/CoreImage/Metal.
#import <Foundation/Foundation.h>
#import <CoreImage/CoreImage.h>
#import <Metal/Metal.h>
#import <objc/message.h>
#import <CommonCrypto/CommonDigest.h>
#include <dlfcn.h>
#include <vector>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include "../大鱼调色/Plugin/DYUniforms.h"
using Floats=std::vector<float>;
static unsigned W=64,H=48;
static id<MTLDevice> gpu;
static id<MTLCommandQueue> queue;
static CIContext *context;
static BOOL bitmapNeedsVerticalFlip=NO;
static NSMutableArray *rows;
static NSMutableArray *conversionFilters,*conversionCalls;
static bool passed=true;
static constexpr double tolerance=1e-4;
static void require(bool condition,NSString *message){
if(!condition)@throw [NSException exceptionWithName:@"PrintReference" reason:message?:@"reference requirement failed" userInfo:nil];
}
static NSString *sha256(NSData *data){
require(data!=nil,@"identity file could not be read for SHA-256");
unsigned char digest[CC_SHA256_DIGEST_LENGTH];CC_SHA256(data.bytes,(CC_LONG)data.length,digest);
NSMutableString *text=[NSMutableString stringWithCapacity:64];for(unsigned char byte:digest)[text appendFormat:@"%02x",byte];return text;
}
static id finiteValue(float value){return std::isfinite(value)?(id)@(value):(id)@"nonfinite";}
static Floats flipped(const Floats& input){
Floats output(input.size());for(unsigned y=0;y<H;y++)memcpy(output.data()+y*W*4,input.data()+(H-1-y)*W*4,W*16);return output;
}
static NSDictionary *difference(const Floats& expected,const Floats& actual,const Floats *alphaSource=nullptr,float selectedAlpha=-1){
require(expected.size()==actual.size(),@"comparison dimensions differ");
double maximum=0,rgbMaximum=0,alphaMaximum=0,sum=0,straightMaximum=0;size_t count=0,nonfinite=0,worst=0,different=0;
for(size_t i=0;i<expected.size();i++){
if(alphaSource&&(*alphaSource)[(i/4)*4+3]!=selectedAlpha)continue;
double delta=fabs(double(expected[i])-actual[i]);
if(!std::isfinite(delta)){nonfinite++;continue;}
if(delta>maximum){maximum=delta;worst=i;}
if(i%4==3)alphaMaximum=fmax(alphaMaximum,delta);
else{rgbMaximum=fmax(rgbMaximum,delta);sum+=delta*delta;count++;if(delta>tolerance)different++;}
}
for(size_t i=0;i<expected.size()/4;i++){
if(alphaSource&&(*alphaSource)[i*4+3]!=selectedAlpha)continue;
float ea=expected[i*4+3],aa=actual[i*4+3];if(!(ea>0&&aa>0))continue;
for(int c=0;c<3;c++){double delta=fabs(double(expected[i*4+c])/ea-double(actual[i*4+c])/aa);if(std::isfinite(delta))straightMaximum=fmax(straightMaximum,delta);}
}
return @{@"maximum":@(maximum),@"rgbMaximum":@(rgbMaximum),@"alphaMaximum":@(alphaMaximum),@"rmsRGB":@(sqrt(sum/fmax(1,count))),@"straightRGBMaximum":@(straightMaximum),@"nonfinite":@(nonfinite),@"pixels":@(count/3),@"rgbComponentsOverTolerance":@(different),@"worstPixel":@{@"x":@((worst/4)%W),@"y":@((worst/4)/W),@"channel":@(worst%4),@"expected":finiteValue(expected[worst]),@"actual":finiteValue(actual[worst])}};
}
static NSArray *differencesByAlpha(const Floats& expected,const Floats& actual,const Floats& source){NSMutableArray *groups=[NSMutableArray array];for(float alpha:{0.f,1.f/65536,1e-4f,.03125f,.25f,1.f}){NSMutableDictionary *group=[NSMutableDictionary dictionaryWithDictionary:difference(expected,actual,&source,alpha)];group[@"sourceAlpha"]=@(alpha);[groups addObject:group];}return groups;}
static NSArray *samples(const Floats& source,const Floats& converted,const Floats& lmt,const Floats& decoded,const Floats& actual){NSMutableArray *result=[NSMutableArray array];for(NSUInteger index:{NSUInteger(0),NSUInteger(1),NSUInteger(6),NSUInteger(30),NSUInteger(54),NSUInteger(78),NSUInteger(102),NSUInteger(126)}){if(index>=size_t(W)*H)continue;auto pixel=[&](const Floats& values){NSMutableArray *array=[NSMutableArray array];for(int c=0;c<4;c++)[array addObject:finiteValue(values[index*4+c])];return array;};[result addObject:@{@"x":@(index%W),@"y":@(index/W),@"source":pixel(source),@"convertedToCCT":pixel(converted),@"lmt":pixel(lmt),@"decodedTo709":pixel(decoded),@"production":pixel(actual)}];}return result;}
static void record(NSString *name,NSDictionary *metrics,double limit,NSDictionary *extra=nil){
BOOL ok=[metrics[@"nonfinite"]unsignedLongLongValue]==0&&[metrics[@"maximum"]doubleValue]<=limit;
NSMutableDictionary *row=[NSMutableDictionary dictionaryWithDictionary:metrics];row[@"name"]=name;row[@"pass"]=@(ok);row[@"tolerance"]=@(limit);if(extra)[row addEntriesFromDictionary:extra];[rows addObject:row];passed&=ok;
}
static id<MTLTexture> texture(const Floats& values={}){
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA32Float width:W height:H mipmapped:NO];desc.storageMode=MTLStorageModeShared;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;
id<MTLTexture> result=[gpu newTextureWithDescriptor:desc];require(result!=nil,@"RGBA32Float texture allocation failed");if(!values.empty()){require(values.size()==size_t(W)*H*4,@"source texture byte count");[result replaceRegion:MTLRegionMake2D(0,0,W,H) mipmapLevel:0 withBytes:values.data() bytesPerRow:W*16];}return [result autorelease];
}
static id<MTLTexture> cubeTexture(NSData *data){
const NSUInteger n=65;require(data.length==n*n*n*16,@"reference cubeData is not 65-cubed RGBA32Float");const float *values=(const float*)data.bytes;for(NSUInteger i=0;i<data.length/4;i++)require(std::isfinite(values[i]),@"reference cubeData contains nonfinite values");
MTLTextureDescriptor *desc=[MTLTextureDescriptor new];desc.textureType=MTLTextureType3D;desc.pixelFormat=MTLPixelFormatRGBA32Float;desc.width=desc.height=desc.depth=n;desc.storageMode=MTLStorageModeShared;desc.usage=MTLTextureUsageShaderRead;
id<MTLTexture> result=[gpu newTextureWithDescriptor:desc];[desc release];require(result!=nil,@"print cube texture allocation failed");[result replaceRegion:MTLRegionMake3D(0,0,0,n,n,n) mipmapLevel:0 slice:0 withBytes:data.bytes bytesPerRow:n*16 bytesPerImage:n*n*16];return [result autorelease];
}
static Floats read(id<MTLTexture> value){Floats result(size_t(W)*H*4);[value getBytes:result.data() bytesPerRow:W*16 fromRegion:MTLRegionMake2D(0,0,W,H) mipmapLevel:0];return result;}
static void finish(id<MTLCommandBuffer> commands){[commands commit];[commands waitUntilCompleted];require(commands.status==MTLCommandBufferStatusCompleted,commands.error.description?:@"Metal command failed");}
static CIImage *image(id<MTLTexture> value){CIImage *result=[CIImage imageWithMTLTexture:value options:@{kCIImageColorSpace:NSNull.null}];require(result!=nil,@"CIImage from Metal texture failed");return result;}
static Floats bitmapRaw(CIImage *value){require(value!=nil,@"reference output image missing");Floats result(size_t(W)*H*4);[context render:value toBitmap:result.data() rowBytes:W*16 bounds:CGRectMake(0,0,W,H) format:kCIFormatRGBAf colorSpace:nil];return result;}
static Floats bitmap(CIImage *value){Floats result=bitmapRaw(value);return bitmapNeedsVerticalFlip?flipped(result):result;}
static id colorSpace(NSString *name){
Class cls=NSClassFromString(@"FTColorSpace");SEL selector=NSSelectorFromString(name);require(cls&&[(id)cls respondsToSelector:selector],[@"reference color space missing: " stringByAppendingString:name]);id value=((id(*)(id,SEL))objc_msgSend)((id)cls,selector);require(value!=nil,@"reference color space factory failed");return value;
}
static CIImage *converted(CIImage *input,id from,id to){
Class cls=NSClassFromString(@"FTColorSpaceFilter");SEL selector=sel_registerName("filterFromColorSpace:toColorSpace:");require(cls&&[(id)cls respondsToSelector:selector],@"reference color conversion factory missing");CIFilter *filter=((id(*)(id,SEL,id,id))objc_msgSend)((id)cls,selector,from,to);require(filter!=nil,@"reference color conversion factory failed");[conversionFilters addObject:filter];[filter setValue:input forKey:kCIInputImageKey];CIImage *output=filter.outputImage;require(output!=nil,@"reference color conversion returned no image");[conversionCalls addObject:@{@"filter": [NSString stringWithFormat:@"%p",(void*)filter],@"outputImage":[NSString stringWithFormat:@"%p",(void*)output],@"fromSpace":[NSString stringWithFormat:@"%p",(void*)from],@"toSpace":[NSString stringWithFormat:@"%p",(void*)to]}];return output;
}
static Floats production(id<MTLComputePipelineState> pipeline,id<MTLTexture> source,id<MTLTexture> cube,DYUniforms uniforms){
id<MTLTexture> output=texture();id<MTLCommandBuffer> commands=[queue commandBuffer];id<MTLComputeCommandEncoder> encoder=[commands computeCommandEncoder];[encoder setComputePipelineState:pipeline];[encoder setTexture:source atIndex:0];[encoder setTexture:cube atIndex:1];[encoder setTexture:output atIndex:2];[encoder setBytes:&uniforms length:sizeof(uniforms) atIndex:0];[encoder dispatchThreads:MTLSizeMake(W,H,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[encoder endEncoding];finish(commands);return read(output);
}
static void orientationControls(){
Floats probe(size_t(W)*H*4);for(unsigned y=0;y<H;y++)for(unsigned x=0;x<W;x++){size_t i=(size_t(y)*W+x)*4;probe[i]=float(x+1)/(W+1)*.6f;probe[i+1]=float(y+1)/(H+1)*.7f;probe[i+2]=float((x+y*3)%17+1)/19;probe[i+3]=1;}
id<MTLTexture> source=texture(probe);CIImage *ci=image(source);Floats raw=bitmapRaw(ci);NSDictionary *direct=difference(probe,raw),*vertical=difference(probe,flipped(raw));double directMaximum=[direct[@"maximum"]doubleValue],verticalMaximum=[vertical[@"maximum"]doubleValue];bitmapNeedsVerticalFlip=verticalMaximum<directMaximum;
NSDictionary *selected=bitmapNeedsVerticalFlip?vertical:direct;record(@"ci-bitmap-orientation-control",selected,1e-7,@{@"rawMaximum":@(directMaximum),@"flippedMaximum":@(verticalMaximum),@"bitmapToMetalMemory":bitmapNeedsVerticalFlip?@"vertical-flip":@"identity"});require([selected[@"nonfinite"]unsignedLongLongValue]==0&&[selected[@"maximum"]doubleValue]<=1e-7,@"CI bitmap orientation control failed; comparisons not run");
id<MTLTexture> output=texture();id<MTLCommandBuffer> commands=[queue commandBuffer];[context render:ci toMTLTexture:output commandBuffer:commands bounds:CGRectMake(0,0,W,H) colorSpace:nil];finish(commands);NSDictionary *metrics=difference(probe,read(output));record(@"ci-texture-orientation-control",metrics,1e-7);require([metrics[@"nonfinite"]unsignedLongLongValue]==0&&[metrics[@"maximum"]doubleValue]<=1e-7,@"CI texture orientation control failed; comparisons not run");
}
static Floats sourcePixels(){
static const float patches[][3]={{0,0,0},{.001f,.001f,.001f},{.0078125f,.0078125f,.0078125f},{.18f,.18f,.18f},{1,1,1},{4,4,4},{16,16,16},{-.02f,-.02f,-.02f},{1,0,0},{0,1,0},{0,0,1},{1,1,0},{0,1,1},{1,0,1},{4,.1f,.01f},{.01f,.2f,8},{-.05f,.18f,.8f},{.25f,-.125f,.04f},{.01f,4,.5f},{.7f,.3f,.1f},{.035f,.07f,.14f},{2,.6f,-.02f},{-.1f,.04f,1.2f},{.5f,.5f,.5f}};
static const float alpha[]={0,1.f/65536,1e-4f,.03125f,.25f,1};Floats result(size_t(W)*H*4);for(size_t i=0;i<size_t(W)*H;i++){size_t patch=i%24;float a=alpha[(i+i/24)%6];for(int c=0;c<3;c++)result[i*4+c]=patches[patch][c]*a;result[i*4+3]=a;}return result;
}
static void writeJSON(NSDictionary *value){NSError *error=nil;NSData *data=[NSJSONSerialization dataWithJSONObject:value options:NSJSONWritingPrettyPrinted|NSJSONWritingSortedKeys error:&error];require(data!=nil,error.description?:@"JSON encoding failed");fwrite(data.bytes,1,data.length,stdout);fputc('\n',stdout);}
int main(int argc,const char **argv){@autoreleasepool{
rows=[NSMutableArray array];conversionFilters=[NSMutableArray array];conversionCalls=[NSMutableArray array];NSMutableDictionary *identity=[NSMutableDictionary dictionary];
@try{
require(argc==2||argc==4,@"Usage: verify_print_reference /absolute/path/default.metallib [width height]");if(argc==4){char *endW=nullptr,*endH=nullptr;long width=strtol(argv[2],&endW,10),height=strtol(argv[3],&endH,10);require(endW&&!*endW&&endH&&!*endH&&width>0&&height>0&&width<=4096&&height<=4096,@"reference dimensions must be integers from 1 through 4096");W=(unsigned)width;H=(unsigned)height;}
gpu=MTLCreateSystemDefaultDevice();require(gpu!=nil,@"Metal device unavailable");queue=[gpu newCommandQueue];require(queue!=nil,@"Metal command queue unavailable");context=[CIContext contextWithMTLDevice:gpu options:@{kCIContextWorkingColorSpace:NSNull.null,kCIContextOutputColorSpace:NSNull.null,kCIContextWorkingFormat:@(kCIFormatRGBAf),kCIContextCacheIntermediates:@NO}];require(context!=nil,@"RGBAf CIContext unavailable");
NSError *error=nil;NSString *libraryPath=@(argv[1]);id<MTLLibrary> dayu=[gpu newLibraryWithURL:[NSURL fileURLWithPath:libraryPath] error:&error];require(dayu!=nil,error.description?:@"product Metal library unavailable");id<MTLFunction> function=[dayu newFunctionWithName:@"dyFilmPrint"];require(function!=nil,@"product dyFilmPrint function missing");id<MTLComputePipelineState> pipeline=[gpu newComputePipelineStateWithFunction:function error:&error];[function release];require(pipeline!=nil,error.description?:@"dyFilmPrint pipeline creation failed");identity[@"productMetallib"]=libraryPath;identity[@"productMetallibSHA256"]=sha256([NSData dataWithContentsOfFile:libraryPath]);
NSString *framework=@"/Applications/ColorFinale.app/Contents/PlugIns/ColorFinale.pluginkit/Contents/Frameworks/RenderingEngine.framework/Versions/A/RenderingEngine";require(dlopen(framework.fileSystemRepresentation,RTLD_NOW|RTLD_LOCAL)!=nullptr,@"cannot load installed reference RenderingEngine");NSBundle *reference=[NSBundle bundleWithPath:@"/Applications/ColorFinale.app"];identity[@"referenceVersion"]=[reference objectForInfoDictionaryKey:@"CFBundleShortVersionString"]?:@"unknown";identity[@"referenceBuild"]=[reference objectForInfoDictionaryKey:@"CFBundleVersion"]?:@"unknown";identity[@"referenceFrameworkSHA256"]=sha256([NSData dataWithContentsOfFile:framework]);
orientationControls();Floats source=sourcePixels(),opaqueSource=source;for(size_t i=0;i<source.size()/4;i++){float a=source[i*4+3];for(int c=0;c<3;c++)opaqueSource[i*4+c]=a>0?source[i*4+c]/a:0;opaqueSource[i*4+3]=1;}id<MTLTexture> input=texture(source),opaqueInput=texture(opaqueSource);id from=colorSpace(@"Rec709Linear"),to=colorSpace(@"ACEScct");NSArray *names=@[@"kodak_2383",@"kodak_2393",@"kodak_2302_bw",@"fuji_3510",@"fuji_3513",@"fuji_3519",@"fuji_3521",@"agfa_cp30"];NSMutableArray *cubes=[NSMutableArray array],*diagnostics=[NSMutableArray array];double rawChainDiscrepancyMaximum=0;
for(NSUInteger look=0;look<names.count;look++){@autoreleasepool{
NSString *name=names[look];Class cls=NSClassFromString(@"FTAcesLMTFilter");SEL selector=sel_registerName("filterWithLMT:");require(cls&&[(id)cls respondsToSelector:selector],@"reference LMT factory missing");CIFilter *filter=((id(*)(id,SEL,id))objc_msgSend)((id)cls,selector,name);require(filter!=nil,[@"reference LMT factory failed: " stringByAppendingString:name]);NSData *data=[filter valueForKey:@"cubeData"];require([data isKindOfClass:NSData.class],@"reference LMT cubeData unavailable");id<MTLTexture> cube=cubeTexture(data);[cubes addObject:@{@"name":name,@"bytes":@(data.length),@"sha256":sha256(data)}];
CIImage *rawConverted=converted(image(input),from,to);[filter setValue:rawConverted forKey:kCIInputImageKey];CIImage *rawLMT=filter.outputImage,*output=converted(rawLMT,to,from);Floats referenceOutput=bitmap(output),convertedValues=bitmap(rawConverted),lmtValues=bitmap(rawLMT);double nativeAlphaMaximum=0;for(size_t i=0;i<source.size()/4;i++)nativeAlphaMaximum=fmax(nativeAlphaMaximum,fabs(double(referenceOutput[i*4+3])-source[i*4+3]));
CIFilter *opaqueFilter=((id(*)(id,SEL,id))objc_msgSend)((id)cls,selector,name);CIImage *opaqueConverted=converted(image(opaqueInput),from,to);[opaqueFilter setValue:opaqueConverted forKey:kCIInputImageKey];CIImage *opaqueLMT=opaqueFilter.outputImage;Floats opaqueReference=bitmap(converted(opaqueLMT,to,from)),opaqueConvertedValues=bitmap(opaqueConverted),opaqueLMTValues=bitmap(opaqueLMT);DYUniforms opaqueUniforms={};opaqueUniforms.film.enabled=opaqueUniforms.film.mix=1;opaqueUniforms.filmPrint=(DYFloat4){float(look+1),1,0,0};Floats opaqueActual=production(pipeline,opaqueInput,cube,opaqueUniforms);record([@"opaque-colour-control-" stringByAppendingString:name],difference(opaqueReference,opaqueActual),tolerance);
DYUniforms rawUniforms=opaqueUniforms;Floats rawActual=production(pipeline,input,cube,rawUniforms);NSDictionary *rawMetrics=difference(referenceOutput,rawActual);rawChainDiscrepancyMaximum=fmax(rawChainDiscrepancyMaximum,[rawMetrics[@"maximum"]doubleValue]);[diagnostics addObject:@{@"name":name,@"rawPremultipliedChainComparison":rawMetrics,@"rawChainBySourceAlpha":differencesByAlpha(referenceOutput,rawActual,source),@"rawChainSamples":samples(source,convertedValues,lmtValues,referenceOutput,rawActual),@"opaqueChainSamples":samples(opaqueSource,opaqueConvertedValues,opaqueLMTValues,opaqueReference,opaqueActual)}];
for(float strength:{1.f,.35f,0.f}){
// FTColorSpaceFilter is a straight-colour function, while the original
// LMT image processor unpremultiplies its input and premultiplies output.
// A raw fractional-alpha concatenation therefore does not implement a
// consistent image contract. Keep its measured discrepancy above. The
// independent colour oracle uses the original chain at alpha one, then
// explicitly restores the host's premultiplied-alpha contract here.
DYUniforms uniforms={};uniforms.film.enabled=1;uniforms.film.mix=1;uniforms.filmPrint=(DYFloat4){float(look+1),strength,0,0};Floats expected=source;if(strength>0)for(size_t i=0;i<expected.size()/4;i++){float a=source[i*4+3];if(a>0)for(int c=0;c<3;c++)expected[i*4+c]=source[i*4+c]*(1-strength)+opaqueReference[i*4+c]*a*strength;}
Floats actual=production(pipeline,input,cube,uniforms);NSDictionary *metrics=difference(expected,actual);record([NSString stringWithFormat:@"original-print-%@-strength-%.2f",name,strength],metrics,tolerance,@{@"lookID":@(look+1),@"strength":@(strength),@"nativeReferenceAlphaMaximum":@(nativeAlphaMaximum),@"bySourceAlpha":differencesByAlpha(expected,actual,source)});
}
}}
NSMutableSet *factoryPointers=[NSMutableSet set];for(NSDictionary *call in conversionCalls)[factoryPointers addObject:call[@"filter"]];identity[@"conversionFactoryCallCount"]=@(conversionCalls.count);identity[@"distinctLiveConversionFilters"]=@(factoryPointers.count);identity[@"conversionFactorySingletonObserved"]=@(factoryPointers.count!=conversionCalls.count);
NSDictionary *result=@{@"pass":@(passed),@"checks":@(rows.count),@"width":@(W),@"height":@(H),@"gpu":gpu.name,@"tolerance":@(tolerance),@"textureFormat":@"RGBA32Float",@"ciWorkingFormat":@"RGBAf",@"referenceChain":@"Original FTColorSpaceFilter Rec709Linear -> ACEScct; FTAcesLMTFilter filterWithLMT: (native defaults); FTColorSpaceFilter ACEScct -> Rec709Linear, evaluated at alpha one, then explicitly premultiplied with the source alpha",@"rawPremultipliedChainEquivalent":@(rawChainDiscrepancyMaximum<=tolerance),@"rawPremultipliedChainDiscrepancyMaximum":@(rawChainDiscrepancyMaximum),@"scope":@"All eight original print tables, strengths 1/0.35/0, premultiplied linear Rec.709 grayscale/color/negative/HDR vectors, alpha {0,1/65536,0.0001,0.03125,0.25,1}. Bitmap orientation is measured against an asymmetric identity control before comparing; texture roundtrip must be identity. The original colour chain is independently checked at alpha one. Its raw fractional-alpha chain is retained as a non-gating diagnostic because FTColorSpaceFilter treats RGB as straight while the LMT processor unpremultiplies/premultiplies. Host alpha restoration is explicit, not claimed as full reference CMS equivalence. All pixels, including alpha zero, are compared. Straight RGB maximum is diagnostic; pass uses absolute premultiplied RGBA error. No half-float quantization or relaxed tolerance is applied.",@"identity":identity,@"referenceCubes":cubes,@"diagnostics":diagnostics,@"conversionFactories":conversionCalls,@"results":rows};writeJSON(result);[pipeline release];[dayu release];return passed?0:1;
}@catch(NSException *exception){
writeJSON(@{@"pass":@NO,@"checks":@(rows.count),@"width":@(W),@"height":@(H),@"tolerance":@(tolerance),@"identity":identity,@"error":exception.reason?:@"unknown reference failure",@"results":rows});return 2;
}
}}
+17
查看文件
@@ -0,0 +1,17 @@
{
"status": "verified",
"commit": "ab7cb759e57cc9c2a4725426bced67af55155654",
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"clone": "/Users/mac/Library/Caches/CodexRecovery/dayu-color-print-1.6.0",
"filesByteCompared": 280,
"fsck": "full/strict passed",
"releaseBuild": true,
"nativeChecks": 393,
"nativePass": true,
"lfs": false,
"submodules": false,
"generatedAppsRemoved": [
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/RecoveryDerivedData/Build/Products/Release/大鱼调色.app",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/RecoveryDerivedData/Build/Products/Release/大鱼调色 XPC Service.pluginkit"
]
}
文件差异过大,未显示。 加载差异