feat: verify merged primary, native balance wheel and persistent variable spider rendering
这个提交包含在:
1 父节点
ac164245aa
当前提交
c2818cbb11
6 个文件已更改
+1332
-8
没有与搜索条件相匹配的文件
@@ -3067,7 +3067,7 @@
|
||||
"template/tools/dump_model.mm": "2ef22e010e0cae15b73107d39fb2c125f6049b1e5405e88078f936cf29e79350",
|
||||
"大鱼调色/Plugin/DYCSTTypes.h": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696",
|
||||
"大鱼调色/Plugin/DYColorManagement.h": "b0a4cd1b8c45dbce90a7b4f30f72ebf95ecd382895e74e3bfeda0f7cdb185157",
|
||||
"大鱼调色/Plugin/DYModel.h": "ff10bd26d4abab1e610e392841b3bf8551f7be1a245a6dca3a13e8f2a2d27adf",
|
||||
"大鱼调色/Plugin/DYModel.h": "80e88add97deeac7a9dc47d12f68b0245905786297de2e6553b3da15c729da6e",
|
||||
"大鱼调色/Plugin/DYModel.mm": "f485aba06c9b4de871e95761d69b3df1001843bcf7226aba2ed278d596358364",
|
||||
"大鱼调色/Plugin/DYSpiderState.h": "0c80747e41e8fc97762e301b011bd08c18865a825eaafde086ed79ace37b22f9",
|
||||
"大鱼调色/Plugin/DYUniforms.h": "8ef480025c739b29f55884ba0c7218e9d6fd8d80c46cfc72d6ee3da90215abe4",
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create an isolated synthetic FCP project for the native spider and wheel."""
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
import xml.etree.ElementTree as ET
|
||||
root=Path(__file__).resolve().parent.parent
|
||||
runpy.run_path(str(root/'tools/create_host_fixture.py'))
|
||||
qa=Path.home()/'Library/Caches/CodexBuilds/com.dayu.color/fcp-qa'
|
||||
tree=ET.parse(qa/'大鱼调色_正式版验收.fcpxml')
|
||||
tree.find('.//event').set('name','大鱼调色_蜘蛛盘与白平衡验收')
|
||||
tree.find('.//project').set('name','大鱼调色_1.3_蜘蛛盘与白平衡')
|
||||
ET.indent(tree)
|
||||
output=qa/'大鱼调色_1.3_蜘蛛盘与白平衡.fcpxml'
|
||||
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n'+ET.tostring(tree.getroot(),encoding='unicode')+'\n')
|
||||
print(output)
|
||||
文件差异过大,未显示。
加载差异
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"pass": true,
|
||||
"output": "PASS spider_mesh: 204683 assertions, 25 topologies, 2005 colors/grid, CPU/Metal max relative error 1.78813934e-06",
|
||||
"assertions": 204683,
|
||||
"topologies": 25,
|
||||
"colorsPerGrid": 2005,
|
||||
"maxRelativeError": 1.78813934e-06,
|
||||
"source": "tools/verify_spider_mesh.mm",
|
||||
"coreSourceSHA256": "bdd6278e17ff4208ad94a8b0e834c817c0a3475f205dd79898e8fd88e84a19c9"
|
||||
}
|
||||
+72
-6
@@ -4,6 +4,7 @@
|
||||
#import "DYAutoGrade.h"
|
||||
#import "DYLUTLibrary.h"
|
||||
#import "DYInspector.h"
|
||||
#include "DYSpiderState.h"
|
||||
#include <string>
|
||||
#import <CoreVideo/CoreVideo.h>
|
||||
#import <IOSurface/IOSurface.h>
|
||||
@@ -19,18 +20,36 @@
|
||||
@public
|
||||
NSMutableDictionary *_values,*_custom;
|
||||
BOOL _duplicate;
|
||||
@public
|
||||
int _undoStarts,_undoEnds;BOOL _undoActive;
|
||||
}
|
||||
@end
|
||||
@interface DYInspector (DiagnosticActions)
|
||||
- (void)refresh;
|
||||
- (void)resetAll:(id)sender;
|
||||
@end
|
||||
@protocol DYSpiderProbe
|
||||
@property(nonatomic,copy) NSData *meshData;
|
||||
@property(nonatomic,retain) NSMutableIndexSet *selection,*pinned;
|
||||
@property(nonatomic,copy) void(^changed)(DYGrade,NSData*);
|
||||
@property(nonatomic,copy) void(^gesture)(BOOL);
|
||||
@property(nonatomic,readonly) NSInteger hueCount,saturationCount;
|
||||
- (void)changeHueCount:(int)hues saturationCount:(int)saturation;
|
||||
- (void)resetMesh;
|
||||
- (NSPoint)point:(NSInteger)index;
|
||||
- (void)selectRing;
|
||||
- (void)selectSpoke;
|
||||
- (void)resetSelected;
|
||||
@end
|
||||
@implementation DYDiagnosticManager
|
||||
- (instancetype)init {if((self=[super init])){_values=[NSMutableDictionary new];_custom=[NSMutableDictionary new];}return self;}
|
||||
- (void)dealloc {[_values release];[_custom release];[super dealloc];}
|
||||
- (id)apiForProtocol:(Protocol *)protocol {
|
||||
NSString *name=NSStringFromProtocol(protocol);
|
||||
return [@[@"FxParameterCreationAPI_v5",@"FxParameterRetrievalAPI_v6",@"FxParameterSettingAPI_v6",@"FxCustomParameterActionAPI_v4"]containsObject:name]?self:nil;
|
||||
return [@[@"FxParameterCreationAPI_v5",@"FxParameterRetrievalAPI_v6",@"FxParameterSettingAPI_v6",@"FxCustomParameterActionAPI_v4",@"FxUndoAPI"]containsObject:name]?self:nil;
|
||||
}
|
||||
- (BOOL)startUndoGroup:(NSString *)title{_undoStarts++;_undoActive=YES;return YES;}
|
||||
- (BOOL)endUndoGroup{_undoEnds++;_undoActive=NO;return YES;}
|
||||
- (void)startAction:(id)sender{}
|
||||
- (void)endAction:(id)sender{}
|
||||
- (CMTime)currentTime{return kCMTimeZero;}
|
||||
@@ -169,12 +188,12 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
DYDiagnosticManager *uiHost=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(uiHost,nil);
|
||||
DYInspector *inspector=[[[DYInspector alloc]initWithAPIManager:uiHost]autorelease];[inspector refresh];
|
||||
NSArray *cards=[inspector valueForKey:@"cards"];BOOL initialUI=YES;
|
||||
for(NSDictionary *card in cards)initialUI&=([card[@"collapsed"]boolValue]!=[@[@"primary",@"base"]containsObject:card[@"section"][@"key"]])&&[(NSButton*)card[@"enabled"]state]==NSControlStateValueOn;
|
||||
run.record(@"default-primary-base-expanded-all-eyes-on",initialUI,@{@"modules":@(cards.count)});
|
||||
for(NSDictionary *card in cards)initialUI&=([card[@"collapsed"]boolValue]!=[@[@"primary",@"spider",@"base"]containsObject:card[@"section"][@"key"]])&&[(NSButton*)card[@"enabled"]state]==NSControlStateValueOn;
|
||||
run.record(@"default-primary-spider-base-expanded-all-eyes-on",initialUI,@{@"modules":@(cards.count)});
|
||||
DYUniforms uiBefore,uiAfter;DYReadUniforms(uiHost,kCMTimeZero,&uiBefore);BOOL foldingIndependent=YES;
|
||||
for(NSDictionary *card in cards){NSButton *header=card[@"header"];BOOL was=[card[@"collapsed"]boolValue];[header performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);foldingIndependent&=[card[@"collapsed"]boolValue]!=was&&memcmp(&uiBefore,&uiAfter,sizeof(uiBefore))==0;[header performClick:nil];[inspector refresh];}
|
||||
run.record(@"all-disclosure-actions-preserve-every-render-parameter",foldingIndependent);
|
||||
NSDictionary *first=cards[0];BOOL wasFolded=[first[@"collapsed"]boolValue];[(NSButton*)first[@"enabled"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
|
||||
NSDictionary *first=cards[0];if(![first[@"collapsed"]boolValue]){[(NSButton*)first[@"header"]performClick:nil];[inspector refresh];}BOOL wasFolded=[first[@"collapsed"]boolValue];[(NSButton*)first[@"enabled"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
|
||||
run.record(@"eye-only-toggles-enable-retains-disclosure",[first[@"collapsed"]boolValue]==wasFolded&&uiAfter.inputSectionEnabled==0);
|
||||
[(NSButton*)first[@"header"]performClick:nil];[inspector refresh];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
|
||||
run.record(@"expanding-disabled-module-keeps-it-disabled",uiAfter.inputSectionEnabled==0&&![first[@"collapsed"]boolValue]);
|
||||
@@ -188,6 +207,38 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
DYCMSettings converted=defaults.cm;converted.exposure=1.25;converted.contrast=.4;converted.balanceStrength=.3;converted.midtones=.6;converted.shadows=-.4;converted.black=.2;converted.shadowContrast=.3;converted.hiContrast=-.2;DayuRenderParams mapped=DYCMRender(converted);
|
||||
run.record(@"basis-raw-controls-use-reference-conversion",fabs(mapped.basis.exposure-exp2f(1.25))<1e-6&&fabs(mapped.basis.contrast-exp2f(.4))<1e-6&&fabs(mapped.basis.balanceStrength-.36)<1e-6&&fabs(mapped.basis.midtones-.1998)<1e-5&&fabs(mapped.basis.shadows+.6)<1e-6&&fabs(mapped.basis.trimLow-.9)<1e-6&&fabs(mapped.basis.shadowContrast+.39)<1e-6&&fabs(mapped.basis.hiContrast+.4)<1e-6);
|
||||
converted.workingTransfer=30;mapped=DYCMRender(converted);run.record(@"unsupported-basis-curve-adapts-through-intermediate",(mapped.reserved&8)&&mapped.basis.colorspace==10&&mapped.basisInput.inputTransfer==30&&mapped.basisOutput.outputTransfer==30);
|
||||
[inspector resetAll:nil];[inspector refresh];
|
||||
NSWindow *interactionWindow=[[[NSWindow alloc]initWithContentRect:NSMakeRect(0,0,400,780) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]autorelease];interactionWindow.contentView=inspector;[inspector layoutSubtreeIfNeeded];
|
||||
NSArray *graphics=[inspector valueForKey:@"graphics"];NSView *wheel=nil;for(NSView *graphic in graphics)if([NSStringFromClass(graphic.class)isEqual:@"DYPrimaryBalanceWheel"])wheel=graphic;
|
||||
run.need(@"primary-balance-wheel-restored-and-palette-loaded",wheel&&[wheel valueForKey:@"wheel"]!=nil);
|
||||
BOOL merged=cards.count==12&&[cards[0][@"section"][@"key"]isEqual:@"primary"]&&[cards[1][@"section"][@"key"]isEqual:@"spider"];for(NSDictionary *card in cards)merged&=![@[@"input",@"output"]containsObject:card[@"section"][@"key"]];
|
||||
NSDictionary *controls=[inspector valueForKey:@"controls"];for(NSDictionary *record in controls.allValues)merged&=![[record[@"descriptor"]objectForKey:@"key"]hasPrefix:@"cmbypass"];
|
||||
run.record(@"single-primary-card-no-bypass-checkboxes",merged);
|
||||
auto mouseFor=[&](NSView *view,NSEventType type,NSPoint point,NSEventModifierFlags flags=0,NSInteger clicks=1){return [NSEvent mouseEventWithType:type location:[view convertPoint:point toView:nil] modifierFlags:flags timestamp:0 windowNumber:interactionWindow.windowNumber context:nil eventNumber:0 clickCount:clicks pressure:type==NSEventTypeLeftMouseUp?0:1];};
|
||||
[wheel setFrameSize:NSMakeSize(310,232)];NSPoint wheelCenter=NSMakePoint(155,126);int starts=uiHost->_undoStarts,ends=uiHost->_undoEnds;
|
||||
[wheel mouseDown:mouseFor(wheel,NSEventTypeLeftMouseDown,wheelCenter)];[wheel mouseDragged:mouseFor(wheel,NSEventTypeLeftMouseDragged,NSMakePoint(wheelCenter.x+25,wheelCenter.y+10))];[wheel mouseUp:mouseFor(wheel,NSEventTypeLeftMouseUp,NSMakePoint(wheelCenter.x+50,wheelCenter.y+20))];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);
|
||||
float expectedStrength=hypotf(10,4)/90.f,expectedAngle=fmodf(atan2f(4,10)*180/M_PI+360-104,360);
|
||||
run.record(@"balance-wheel-reference-orientation-and-fine-drag",fabs(uiAfter.cm.balanceStrength-expectedStrength)<1e-5&&fabs(uiAfter.cm.balanceAngle-expectedAngle)<1e-4&&uiAfter.cm.balanceAngle>1,@{@"angleDegrees":@(uiAfter.cm.balanceAngle),@"strength":@(uiAfter.cm.balanceStrength)});
|
||||
run.record(@"balance-drag-one-host-undo-group",uiHost->_undoStarts==starts+1&&uiHost->_undoEnds==ends+1&&!uiHost->_undoActive);
|
||||
[wheel mouseDown:mouseFor(wheel,NSEventTypeLeftMouseDown,wheelCenter,0,2)];DYReadUniforms(uiHost,kCMTimeZero,&uiAfter);run.record(@"balance-double-click-neutral",uiAfter.cm.balanceStrength==0);
|
||||
NSView *spiderPanel=[inspector valueForKey:@"spiderPanel"];NSView<DYSpiderProbe> *disc=(id)[spiderPanel valueForKey:@"disc"];[disc setFrameSize:NSMakeSize(310,300)];auto initialMesh=DYSpiderMesh(disc.meshData);
|
||||
run.record(@"spider-default-six-by-six-31-nodes",initialMesh.hues==6&&initialMesh.rings==5&&dy::meshCount(initialMesh)==31);
|
||||
auto selectNode=[&](int index,NSEventModifierFlags flags){NSPoint pt=[disc point:index];[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,pt,flags)];[disc mouseUp:mouseFor(disc,NSEventTypeLeftMouseUp,pt,flags)];};
|
||||
auto dragNode=[&](int index,float dx,float dy){NSPoint pt=[disc point:index];[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,pt)];[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(pt.x+dx*.5,pt.y+dy*.5))];[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(pt.x+dx,pt.y+dy))];[disc mouseUp:mouseFor(disc,NSEventTypeLeftMouseUp,NSMakePoint(pt.x+dx,pt.y+dy))];};
|
||||
starts=uiHost->_undoStarts;ends=uiHost->_undoEnds;dragNode(2,18,8);DYAssetState *spiderSaved=DYReadAssets(uiHost,kCMTimeZero);auto dragged=DYSpiderMesh(spiderSaved.spiderMesh);
|
||||
run.record(@"spider-single-drag-spoke-following-and-pin",dragged.x[0]>initialMesh.x[0]&&dragged.x[1]>initialMesh.x[1]&&dragged.x[3]>initialMesh.x[3]&&dragged.x[4]==initialMesh.x[4]&&dragged.x[5]==initialMesh.x[5]&&dragged.pins[2]);
|
||||
run.record(@"spider-drag-one-host-undo-group",uiHost->_undoStarts==starts+1&&uiHost->_undoEnds==ends+1&&!uiHost->_undoActive);
|
||||
error=nil;NSData *spiderArchive=[NSKeyedArchiver archivedDataWithRootObject:spiderSaved requiringSecureCoding:YES error:&error];DYAssetState *decodedSpider=[NSKeyedUnarchiver unarchivedObjectOfClass:DYAssetState.class fromData:spiderArchive error:&error];run.record(@"spider-archive-retains-mesh-pins-and-lut-paths",decodedSpider&&[decodedSpider isEqual:spiderSaved],@{@"error":reason(error)});
|
||||
NSDictionary *snapshot=[inspector performSelector:@selector(presetSnapshot)];NSData *presetJSON=[NSJSONSerialization dataWithJSONObject:snapshot options:0 error:&error];NSDictionary *decodedPreset=[NSJSONSerialization JSONObjectWithData:presetJSON options:0 error:&error];run.record(@"complete-version-three-preset-includes-mesh",[decodedPreset[@"version"]isEqual:@3]&&[DYSpiderFromJSON(decodedPreset[@"spider"])isEqual:spiderSaved.spiderMesh]);
|
||||
NSDictionary *portable=DYSpiderJSON(spiderSaved.spiderMesh,spiderSaved.spiderLinked);NSData *decodedPortable=DYSpiderFromJSON(portable);run.record(@"spider-json-preset-exact-roundtrip",[decodedPortable isEqual:spiderSaved.spiderMesh]);
|
||||
NSMutableDictionary *badJSON=[[portable mutableCopy]autorelease];badJSON[@"hues"]=@7;run.record(@"spider-json-rejects-unsupported-topology",!DYSpiderFromJSON(badJSON));auto corrupt=dragged;corrupt.x[0]=NAN;run.record(@"spider-archive-rejects-nonfinite-coordinates",!DYSpiderMeshIsValid([NSData dataWithBytes:&corrupt length:sizeof(corrupt)]));
|
||||
[disc changeHueCount:12 saturationCount:8];spiderSaved=DYReadAssets(uiHost,kCMTimeZero);auto dense=DYSpiderMesh(spiderSaved.spiderMesh);run.record(@"spider-independent-resolution-and-resample",dense.hues==12&&dense.rings==7&&fabs(dy::meshDelta(dense,0,.6).x)>0);
|
||||
[disc resetMesh];auto resetDense=DYSpiderMesh(DYReadAssets(uiHost,kCMTimeZero).spiderMesh);run.record(@"spider-reset-preserves-density",resetDense.hues==12&&resetDense.rings==7&&dy::meshSamples(resetDense)[4]==0);
|
||||
[disc changeHueCount:6 saturationCount:6];selectNode(1,0);selectNode(2,NSEventModifierFlagCommand);run.record(@"spider-command-multiselect",disc.selection.count==2);[disc selectRing];run.record(@"spider-ring-selection",disc.selection.count==12);[disc.selection removeAllIndexes];selectNode(0,0);[disc selectSpoke];run.record(@"spider-spoke-selection",disc.selection.count==5);
|
||||
selectNode(3,NSEventModifierFlagShift);run.record(@"spider-shift-pin",[disc.pinned containsIndex:3]);float pinnedX=DYSpiderMesh(disc.meshData).x[3];dragNode(3,8,0);run.record(@"spider-pinned-anchor-still-draggable",DYSpiderMesh(disc.meshData).x[3]>pinnedX);
|
||||
NSPoint resetPoint=[disc point:3];[disc rightMouseDown:mouseFor(disc,NSEventTypeRightMouseDown,resetPoint)];run.record(@"spider-right-click-reset-unpins",!DYSpiderMesh(disc.meshData).pins[3]);
|
||||
[disc resetMesh];NSData *beforeCancel=[[disc.meshData copy]autorelease];NSPoint anchor=[disc point:2];[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,anchor)];[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,NSMakePoint(anchor.x+10,anchor.y+5))];[disc keyDown:[NSEvent keyEventWithType:NSEventTypeKeyDown location:NSZeroPoint modifierFlags:0 timestamp:0 windowNumber:interactionWindow.windowNumber context:nil characters:@"\x1b" charactersIgnoringModifiers:@"\x1b" isARepeat:NO keyCode:53]];run.record(@"spider-escape-restores-coordinates-and-pins",[beforeCancel isEqual:disc.meshData]);
|
||||
run.record(@"native-interaction-window-never-visible",!interactionWindow.visible);[inspector resetAll:nil];[inspector refresh];
|
||||
id<MTLDevice> gpu=MTLCreateSystemDefaultDevice();run.need(@"metal-device",gpu!=nil);gpuName=gpu.name;
|
||||
const NSUInteger width=64,height=48;DYDiagnosticTile *source=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:width height:height]autorelease],*destination=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:width height:height]autorelease];
|
||||
run.need(@"real-iosurface-image-tiles",source&&destination&&source.ioSurface&&destination.ioSurface);
|
||||
@@ -200,7 +251,7 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
error=nil;id<MTLLibrary>oracle=[gpu newLibraryWithURL:[NSURL fileURLWithPath:cstReference] error:&error];run.need(@"independent-installed-cst-reference-loaded",oracle!=nil,@{@"path":cstReference,@"error":reason(error)});
|
||||
const int cases[][3]={{28,27,10},{2,23,10},{4,4,10},{5,5,10},{6,6,10},{8,7,10},{9,7,10},{11,10,10},{12,28,10},{15,23,10},{16,17,10},{21,23,10},{22,21,10},{25,24,10},{27,25,10},{30,23,10},{29,23,10},{28,27,1},{28,27,20},{28,27,30},{28,27,1002}};
|
||||
for(unsigned index=0;index<sizeof(cases)/sizeof(cases[0]);index++){@autoreleasepool{
|
||||
DYUniforms candidate=defaults;candidate.cm.configured=1;candidate.cm.inputTransfer=cases[index][0];candidate.cm.inputGamut=cases[index][1];candidate.cm.workingTransfer=cases[index][2];candidate.cm.toneMapping=1;candidate.cm.exposure=.35;candidate.cm.contrast=.15;candidate.cm.saturation=1.1;candidate.cm.balanceAngle=.12;candidate.cm.balanceStrength=.03;
|
||||
DYUniforms candidate=defaults;candidate.cm.configured=1;candidate.cm.inputTransfer=cases[index][0];candidate.cm.inputGamut=cases[index][1];candidate.cm.workingTransfer=cases[index][2];candidate.cm.toneMapping=1;candidate.cm.exposure=.35;candidate.cm.contrast=.15;candidate.cm.saturation=1.1;candidate.cm.balanceAngle=(index%4)*90+.12;candidate.cm.balanceStrength=.03;
|
||||
DayuRenderParams p=DYCMRender(candidate.cm);Pixels expected=referenceFrame(gpu,oracle,input,width,height,p,&error);Pixels actual=render(run,renderer,source,destination,gpu,candidate,@{},[NSString stringWithFormat:@"cst-case-%02u-render",index]);
|
||||
BOOL same=expected.size()==actual.size();double worst=0;float refValue=0,gotValue=0;NSUInteger nonfinite=0;for(NSUInteger i=0;i<expected.size()&&same;i++){float a=expected[i],b=actual[i];if(!std::isfinite(a)||!std::isfinite(b)){nonfinite++;same=NO;break;}double delta=fabs(a-b);worst=fmax(worst,delta);same&=delta<=.004+.003*fabs(a);if(!same){refValue=a;gotValue=b;}}
|
||||
run.record([NSString stringWithFormat:@"cst-case-%02u-independent-pixels",index],same,@{@"inputCurve":@(p.input.inputTransfer),@"inputGamut":@(p.input.inputGamut),@"workingCurve":@(p.input.outputTransfer),@"maximumError":@(worst),@"referenceValue":@(refValue),@"actualValue":@(gotValue),@"nonfinite":@(nonfinite),@"components":@(actual.size())});
|
||||
@@ -211,6 +262,14 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
monochrome.cm.blackWhiteMix=.5;Pixels halfMono=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-half-render");BOOL smooth=YES;for(NSUInteger i=0;i<mono.size();i++)smooth&=fabs((float)halfMono[i]-.5f*((float)mono[i]+(float)neutral[i]))<.001;
|
||||
run.record(@"blackwhite-half-mix-is-continuous",smooth);
|
||||
monochrome.blackWhiteSectionEnabled=0;Pixels monoOff=render(run,renderer,source,destination,gpu,monochrome,@{},@"blackwhite-eye-off-render");run.record(@"blackwhite-eye-bypasses-retained-mix",difference(neutral,monoOff).maximum==0);
|
||||
for(int hues:{6,12,24})for(int saturation:{6,8,24}){@autoreleasepool{
|
||||
auto mesh=dy::neutralMesh(hues,saturation);std::bitset<dy::SpiderMeshCapacity>selected;selected[2]=1;mesh=dy::moveMesh(mesh,selected,-.035f,.04f);NSData *data=[NSData dataWithBytes:&mesh length:sizeof(mesh)];DYUniforms warped=defaults;
|
||||
error=nil;BOOL ok=[renderer renderSource:source destination:destination uniforms:warped paths:@{} spider:data error:&error];Pixels frame=read(destination,gpu);auto samples=dy::meshSamples(mesh);BOOL parity=ok;double maximum=0;NSUInteger affected=0;
|
||||
for(NSUInteger i=0;i<width*height;i++){float alpha=input[i*4+3];float3 rgb={0,0,0};if(alpha>0)for(int c=0;c<3;c++)rgb[c]=(__fp16)((float)input[i*4+c]/alpha);float3 expected=dyLimit(dyVariableSpider(rgb,hues,saturation-1,samples.data()));for(int c=0;c<3;c++){float value=alpha>0?(__fp16)((float)(__fp16)expected[c]*alpha):0;double delta=fabs(value-(float)frame[i*4+c]);maximum=fmax(maximum,delta);parity&=std::isfinite(frame[i*4+c])&&delta<.003;affected+=fabs((float)frame[i*4+c]-(float)neutral[i*4+c])>.001;}}
|
||||
run.record([NSString stringWithFormat:@"spider-production-cpu-parity-%d-%d",hues,saturation],parity&&affected>0,@{@"maximumError":@(maximum),@"affectedComponents":@(affected),@"error":reason(error)});
|
||||
warped.spiderSectionEnabled=0;[renderer renderSource:source destination:destination uniforms:warped paths:@{} spider:data error:&error];run.record([NSString stringWithFormat:@"spider-eye-retains-but-bypasses-%d-%d",hues,saturation],difference(neutral,read(destination,gpu)).maximum==0);
|
||||
}}
|
||||
DYUniforms masterProbe=defaults;masterProbe.cm.configured=1;masterProbe.cm.exposure=.7;Pixels masterOn=render(run,renderer,source,destination,gpu,masterProbe,@{},@"primary-master-active-render");masterProbe.primarySectionEnabled=0;Pixels masterOff=render(run,renderer,source,destination,gpu,masterProbe,@{},@"primary-master-inactive-render");run.record(@"primary-master-controls-complete-cst-pipeline",difference(neutral,masterOn).different>100&&difference(neutral,masterOff).maximum==0);
|
||||
auto checkFoldedGroup=[&](DYUniforms active,NSUInteger offset,NSDictionary *paths,NSString *name){
|
||||
*(float *)((uint8_t *)&active+offset)=0;
|
||||
Pixels folded=render(run,renderer,source,destination,gpu,active,paths,[name stringByAppendingString:@"-render"]);
|
||||
@@ -259,6 +318,12 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
BOOL cstCubeMatches=cstExported&&cubeValues.size()==33*33*33*3;for(int c=0;c<3&&cstCubeMatches;c++){float code=cubeValues[((16*33+16)*33+16)*3+c];float linear=code<=.04045f?code/12.92f:powf((code+.055f)/1.055f,2.4f);cstCubeMatches&=fabs(linear-(float)grayRendered[c])<.002&&fabs(code-.5f)>.01;}
|
||||
run.record(@"cube-export-includes-cst-primary-and-matches-production",cstCubeMatches,@{@"error":reason(error),@"triples":@(cubeValues.size()/3)});
|
||||
[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:input.data() bytesPerRow:width*8];
|
||||
auto exportMesh=dy::neutralMesh();for(int i=0;i<dy::meshCount(exportMesh);i++){exportMesh.x[i]+=.02f;exportMesh.y[i]-=.01f;}NSData *exportMeshData=[NSData dataWithBytes:&exportMesh length:sizeof(exportMesh)];
|
||||
NSURL *meshCube=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"spider-export.cube"]];BOOL meshExported=[renderer exportLUT:meshCube uniforms:defaults paths:@{} spider:exportMeshData error:&error];NSString *meshText=meshExported?[NSString stringWithContentsOfURL:meshCube encoding:NSUTF8StringEncoding error:&error]:nil;std::vector<float>meshValues;
|
||||
for(NSString *line in [meshText componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet]){float r,g,b;if(sscanf(line.UTF8String,"%f %f %f",&r,&g,&b)==3){meshValues.push_back(r);meshValues.push_back(g);meshValues.push_back(b);}}
|
||||
auto meshSamples=dy::meshSamples(exportMesh);float3 exportInput={0,0,0};float codes[3]={.5f,.25f,.75f};for(int c=0;c<3;c++)exportInput[c]=(__fp16)powf((codes[c]+.055f)/1.055f,2.4f);float3 exportExpected=dyLimit(dyVariableSpider(exportInput,6,5,meshSamples.data()));BOOL meshCubeMatches=meshValues.size()==33*33*33*3;
|
||||
for(int c=0;c<3&&meshCubeMatches;c++){float code=meshValues[((24*33+8)*33+16)*3+c],linear=code<=.04045f?code/12.92f:powf((code+.055f)/1.055f,2.4f);meshCubeMatches&=fabs(linear-exportExpected[c])<.002;}
|
||||
run.record(@"cube-export-includes-spider-warp",meshCubeMatches,@{@"triples":@(meshValues.size()/3),@"error":reason(error)});
|
||||
DYUniforms u=defaults;u.exposure=.8f;Pixels exposed=render(run,renderer,source,destination,gpu,u,@{},@"renderer-exposure-pass");Difference exposureDifference=difference(neutral,exposed);run.record(@"exposure-affects-actual-frame",exposureDifference.nonfinite==0&&exposureDifference.different>100,measure(exposureDifference));
|
||||
u.baseSectionEnabled=0;Pixels bypass=render(run,renderer,source,destination,gpu,u,@{},@"renderer-base-bypass-pass");Difference bypassDifference=difference(neutral,bypass);run.record(@"base-group-bypass",bypassDifference.nonfinite==0&&bypassDifference.maximum==0,measure(bypassDifference));
|
||||
u=defaults;u.temperature=35;u.tint=-20;Pixels wb=render(run,renderer,source,destination,gpu,u,@{},@"renderer-white-balance-pass");Difference wbDifference=difference(neutral,wb);run.record(@"white-balance-real-table-frame",wbDifference.nonfinite==0&&wbDifference.different>100,measure(wbDifference));
|
||||
@@ -292,9 +357,10 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
|
||||
[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]];
|
||||
double activationEnd=NSProcessInfo.processInfo.systemUptime;maxGap=std::max(maxGap,activationEnd-last);
|
||||
[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)});
|
||||
run.record(@"external-activation-main-loop-responsive",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");
|
||||
|
||||
@@ -845,7 +845,7 @@ static NSImage *DYWheelImage(void) {
|
||||
}
|
||||
- (void)useCST:(id)sender {
|
||||
id<FxCustomParameterActionAPI_v4> a=[self actionAPI];if(!a)return;[a startAction:self];
|
||||
@try{id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:1 toParameter:2236 atTime:a.currentTime];} @finally{[a endAction:self];}[self postChanged];
|
||||
@try{id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:1 toParameter:2236 atTime:a.currentTime];[self clearPrimaryBypasses:set time:a.currentTime];} @finally{[a endAction:self];}[self postChanged];
|
||||
}
|
||||
- (void)resetSection:(NSButton *)sender {
|
||||
[self cancelAssetLoads];
|
||||
|
||||
在新工单中引用
屏蔽一个用户