Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
phase-5 work: P0-2+P0-3+P1 fixes — NVOF real buffer readback (6863 non-zero vectors), honest 4K label, tautology+fail-open removed
Veyra Goal Agent94654e4f1611
diff --git a/scripts/gates/phase5.ps1 b/scripts/gates/phase5.ps1index abcb69e6..72b4c633 100644--- a/scripts/gates/phase5.ps1+++ b/scripts/gates/phase5.ps1@@ -86,7 +86,11 @@ Add-GateCheck "pipeline:run-nr" ($nrExit -eq 0) "exitCode=$nrExit"if (Test-Path -LiteralPath $nrJson -PathType Leaf) {$nr = Get-Content -Raw -Encoding UTF8 -LiteralPath $nrJson | ConvertFrom-JsonAdd-GateCheck "pipeline:nr-count" (([int64]$nr.frames) -ge 30) "frames=$($nr.frames)"- Add-GateCheck "pipeline:non-black" ([bool]$nr.decode.nanInfCount -eq $false -or $true) "decode ok"+ # Check stage luma values: proxy/raw/final should all be non-zero and distinct.+ $proxyLuma = [double]$nr.stageLuma.proxy+ $rawLuma = [double]$nr.stageLuma.raw+ $finalLuma = [double]$nr.stageLuma.final+ Add-GateCheck "pipeline:non-black" (($proxyLuma -gt 0.001) -and ($rawLuma -gt 0.001) -and ($finalLuma -gt 0.001)) "proxy=$proxyLuma raw=$rawLuma final=$finalLuma"# The parity JSON uses decode/encode/output structure; check encode tolerance as proxy.$encDelta = [double]$nr.encode.maxCodeDeltaAdd-GateCheck "pipeline:encode-1code" ($encDelta -le 1.0) "maxCodeDelta=$encDelta"@@ -163,11 +167,8 @@ if ((Test-Path -LiteralPath $mediaProbe -PathType Leaf) -and (Test-Path -Literal$e1Exit = $LASTEXITCODEAdd-GateCheck "endurance:1080p60-run" ($e1Exit -eq 0) "exitCode=$e1Exit"}-elseif (Test-Path -LiteralPath $endurance1080Json -PathType Leaf) {- Write-Host "[INFO] endurance:1080p60 using pre-existing JSON"-}else {- Add-GateCheck "endurance:1080p60" $false "media_probe or test clip missing"+ Add-GateCheck "endurance:1080p60-run" $false "media_probe or test clip missing (fail-closed)"}if (Test-Path -LiteralPath $endurance1080Json -PathType Leaf) {@@ -178,21 +179,18 @@ if (Test-Path -LiteralPath $endurance1080Json -PathType Leaf) {}# ----------------------------------------------------------------------------# 8. native 4K60 endurance (user-approved 5-minute duration; 1080p decoded then SR-upscaled graph)+# 8. Second endurance pass (1080p source, same graph; 4K SR integration is Phase 6)# ----------------------------------------------------------------------------$endurance4kJson = Join-Path $logDir "endurance-4k60.json"+$endurance4kJson = Join-Path $logDir "endurance-second.json"if ((Test-Path -LiteralPath $mediaProbe -PathType Leaf) -and (Test-Path -LiteralPath $testClip -PathType Leaf)) {- Write-Host "[INFO] endurance:4k60 running (5 min, 1080p source upscaled to 4K)..."- & $mediaProbe --input $testClip --mode d3d12va --frames 54000 --run-id "$runId-end4k" --log-file (Join-Path $logDir "endurance-4k60.log") --json-file $endurance4kJson+ Write-Host "[INFO] endurance:second-pass running (5 min, 1080p; 4K SR graph is Phase 6 scope)..."+ & $mediaProbe --input $testClip --mode d3d12va --frames 54000 --run-id "$runId-end2" --log-file (Join-Path $logDir "endurance-second.log") --json-file $endurance4kJson$e4Exit = $LASTEXITCODE- Add-GateCheck "endurance:4k60-run" ($e4Exit -eq 0) "exitCode=$e4Exit"-}-elseif (Test-Path -LiteralPath $endurance4kJson -PathType Leaf) {- Write-Host "[INFO] endurance:4k60 using pre-existing JSON"+ Add-GateCheck "endurance:second-run" ($e4Exit -eq 0) "exitCode=$e4Exit"}else {- Add-GateCheck "endurance:4k60" $false "media_probe or test clip missing"+ Add-GateCheck "endurance:second-run" $false "media_probe or test clip missing"}if (Test-Path -LiteralPath $endurance4kJson -PathType Leaf) {diff --git a/tools/nvof_probe/main.cpp b/tools/nvof_probe/main.cppindex 60f1e649..14757aa1 100644--- a/tools/nvof_probe/main.cpp+++ b/tools/nvof_probe/main.cpp@@ -30,6 +30,10 @@ using PFN_NvOFDestroyInstance = NV_OF_STATUS(NVOFAPI*)(void*);int main(int argc, char** argv) {std::string runId = "nvof-probe";std::string jsonFile;+ // Track actual success states for honest JSON reporting.+ bool apiLoaded = false;+ bool instanceCreated = false;+ bool sessionCreated = false;for (int i = 1; i < argc; ++i) {if (std::strcmp(argv[i], "--run-id") == 0 && i+1 < argc) runId = argv[++i];else if (std::strcmp(argv[i], "--json-file") == 0 && i+1 < argc) jsonFile = argv[++i];@@ -55,6 +59,7 @@ int main(int argc, char** argv) {FreeLibrary(nvofDll);return 1;}+ apiLoaded = true;// 2. Query max supported API version.uint32_t maxVer = 0;@@ -74,6 +79,7 @@ int main(int argc, char** argv) {NV_OF_D3D12_API_FUNCTION_LIST fnList{};st = pCreateInstance(maxVer, &fnList);veyra::log::info("nvof", std::format("NvOFAPICreateInstanceD3D12 status={}", static_cast<int>(st)));+ instanceCreated = (st == NV_OF_SUCCESS);if (st != NV_OF_SUCCESS) { ctx.shutdown(); FreeLibrary(nvofDll); return 1; }// 5. Verify key function pointers are populated.@@ -94,6 +100,7 @@ int main(int argc, char** argv) {// 6a. Create the optical flow session on the shared Veyra device.st = fnList.nvCreateOpticalFlowD3D12(ctx.device(), &hOF);veyra::log::info("nvof", std::format("nvCreateOpticalFlowD3D12 status={}", static_cast<int>(st)));+ sessionCreated = (st == NV_OF_SUCCESS && hOF != nullptr);if (st == NV_OF_SUCCESS && hOF != nullptr) {// 6b. Initialize the session with known parameters.@@ -114,11 +121,12 @@ int main(int argc, char** argv) {veyra::log::info("nvof", std::format("nvOFInit status={}", static_cast<int>(st)));if (st == NV_OF_SUCCESS) {- // 6c. Create test input textures (reference and input with known shift).- // We create two small RGBA textures: a gradient and the same gradient- // shifted by 8 pixels horizontally. The flow should be non-zero.+ // 6c. Create test input textures with known content.+ // Reference: horizontal gradient. Input: same gradient shifted +8px.const uint32_t w = 1920, h = 1080;D3D12_HEAP_PROPERTIES hp{}; hp.Type = D3D12_HEAP_TYPE_DEFAULT;+ D3D12_HEAP_PROPERTIES upHp{}; upHp.Type = D3D12_HEAP_TYPE_UPLOAD;+ D3D12_HEAP_PROPERTIES rbHp{}; rbHp.Type = D3D12_HEAP_TYPE_READBACK;D3D12_RESOURCE_DESC td{};td.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;td.Width = w; td.Height = h; td.DepthOrArraySize = 1; td.MipLevels = 1;@@ -128,29 +136,120 @@ int main(int argc, char** argv) {ID3D12Resource* refTex = nullptr;ID3D12Resource* inTex = nullptr;- ID3D12Resource* outFlow = nullptr; // R16G16_FLOAT for flow vectors- ID3D12Resource* outCost = nullptr; // R8_UNORM for cost/confidence-- // Create reference and input textures.- if (SUCCEEDED(ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,- &td, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&refTex))) &&- SUCCEEDED(ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,- &td, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&inTex)))) {- veyra::log::info("nvof", "test textures created (1920x1080 ABGR8)");-- // Create flow output buffer: R16G16_FLOAT at grid resolution.- // Grid size 1 means one flow vector per pixel: 1920x1080.- D3D12_RESOURCE_DESC flowDesc = td;- flowDesc.Format = DXGI_FORMAT_R16G16_FLOAT;- flowDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;- ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,- &flowDesc, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&outFlow));-- D3D12_RESOURCE_DESC costDesc = td;- costDesc.Format = DXGI_FORMAT_R8_UNORM;- costDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;- ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,- &costDesc, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&outCost));+ ID3D12Resource* outFlow = nullptr;+ ID3D12Resource* outCost = nullptr;+ ID3D12CommandAllocator* cmdAlloc = nullptr;+ ID3D12GraphicsCommandList* cmdList = nullptr;++ ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,+ &td, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&refTex));+ ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,+ &td, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&inTex));+ ctx.device()->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&cmdAlloc));+ ctx.device()->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, cmdAlloc, nullptr, IID_PPV_ARGS(&cmdList));++ // Flow output: R16G16_FLOAT, same resolution.+ D3D12_RESOURCE_DESC flowDesc = td;+ flowDesc.Format = DXGI_FORMAT_R16G16_FLOAT;+ flowDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;+ ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,+ &flowDesc, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&outFlow));++ D3D12_RESOURCE_DESC costDesc = td;+ costDesc.Format = DXGI_FORMAT_R8_UNORM;+ costDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;+ ctx.device()->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE,+ &costDesc, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&outCost));++ if (refTex && inTex && outFlow && outCost && cmdList) {+ veyra::log::info("nvof", "test textures created");++ // 6d. Initialize textures via upload: reference = gradient, input = shifted gradient.+ const size_t rowPitch = (static_cast<size_t>(w) * 4 + 255) & ~size_t(255);+ const size_t uploadSize = rowPitch * h;+ D3D12_RESOURCE_DESC bufDesc{};+ bufDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;+ bufDesc.Width = uploadSize; bufDesc.Height = 1; bufDesc.DepthOrArraySize = 1;+ bufDesc.MipLevels = 1; bufDesc.SampleDesc.Count = 1; bufDesc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;++ ID3D12Resource* uploadRef = nullptr;+ ID3D12Resource* uploadIn = nullptr;+ ctx.device()->CreateCommittedResource(&upHp, D3D12_HEAP_FLAG_NONE,+ &bufDesc, D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&uploadRef));+ ctx.device()->CreateCommittedResource(&upHp, D3D12_HEAP_FLAG_NONE,+ &bufDesc, D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&uploadIn));++ if (uploadRef && uploadIn) {+ // Fill reference: horizontal gradient (red = x/w*255).+ // Fill input: same gradient shifted 8 pixels right.+ uint8_t* refData = nullptr; uint8_t* inData = nullptr;+ uploadRef->Map(0, nullptr, reinterpret_cast<void**>(&refData));+ uploadIn->Map(0, nullptr, reinterpret_cast<void**>(&inData));+ for (uint32_t y = 0; y < h; ++y) {+ for (uint32_t x = 0; x < w; ++x) {+ size_t idx = y * rowPitch + x * 4;+ uint8_t gray = static_cast<uint8_t>((x * 255) / w);+ refData[idx] = gray; refData[idx+1] = gray; refData[idx+2] = gray; refData[idx+3] = 255;+ // Input shifted 8px: pixel at x takes reference value at x-8.+ uint8_t shifted = (x >= 8) ? static_cast<uint8_t>(((x-8) * 255) / w) : 0;+ inData[idx] = shifted; inData[idx+1] = shifted; inData[idx+2] = shifted; inData[idx+3] = 255;+ }+ }+ uploadRef->Unmap(0, nullptr);+ uploadIn->Unmap(0, nullptr);++ // Copy upload -> default (via command list).+ D3D12_TEXTURE_COPY_LOCATION dst{}, src{};+ dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;+ dst.SubresourceIndex = 0;+ src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;+ src.PlacedFootprint.Footprint.Format = DXGI_FORMAT_R8G8B8A8_UNORM;+ src.PlacedFootprint.Footprint.Width = w;+ src.PlacedFootprint.Footprint.Height = h;+ src.PlacedFootprint.Footprint.Depth = 1;+ src.PlacedFootprint.Footprint.RowPitch = static_cast<UINT>(rowPitch);++ // Barriers + copy.+ D3D12_RESOURCE_BARRIER b[2]{};+ for (int i = 0; i < 2; ++i) {+ b[i].Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;+ b[i].Transition.StateBefore = D3D12_RESOURCE_STATE_COMMON;+ b[i].Transition.StateAfter = D3D12_RESOURCE_STATE_COPY_DEST;+ b[i].Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;+ }+ b[0].Transition.pResource = refTex;+ b[1].Transition.pResource = inTex;+ cmdList->ResourceBarrier(2, b);++ dst.pResource = refTex;+ src.pResource = uploadRef;+ cmdList->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);+ dst.pResource = inTex;+ src.pResource = uploadIn;+ cmdList->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);++ for (int i = 0; i < 2; ++i) {+ b[i].Transition.StateBefore = D3D12_RESOURCE_STATE_COPY_DEST;+ b[i].Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON;+ }+ cmdList->ResourceBarrier(2, b);+ cmdList->Close();+ ID3D12CommandList* lists[] = { cmdList };+ ctx.directQueue()->ExecuteCommandLists(1, lists);+ // Wait for completion.+ ID3D12Fence* initFence = nullptr;+ ctx.device()->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&initFence));+ ctx.directQueue()->Signal(initFence, 1);+ HANDLE initEvent = CreateEventW(nullptr, FALSE, FALSE, nullptr);+ initFence->SetEventOnCompletion(1, initEvent);+ WaitForSingleObject(initEvent, 5000);+ CloseHandle(initEvent);+ initFence->Release();+ veyra::log::info("nvof", "test textures initialized (gradient + 8px shift)");++ uploadRef->Release();+ uploadIn->Release();+ }if (outFlow && outCost) {// Register textures with NVOF.@@ -219,9 +318,112 @@ int main(int argc, char** argv) {fence->SetEventOnCompletion(fenceValue, fenceEvent);if (WaitForSingleObject(fenceEvent, 5000) == WAIT_OBJECT_0) {veyra::log::info("nvof", "optical flow GPU execution completed (fence signaled)");- nonZeroMotion = true;- maxMagnitude = 1.0;- confidencePresent = true;++ // Read back flow vectors and verify non-zero.+ // Flow is R16G16_FLOAT (half precision): each pixel has (dx, dy).+ const size_t flowRowPitch = (static_cast<size_t>(w) * 4 + 255) & ~size_t(255); // 2 halfs = 4 bytes+ const size_t flowSize = flowRowPitch * h;+ D3D12_RESOURCE_DESC rbDesc{};+ rbDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;+ rbDesc.Width = flowSize; rbDesc.Height = 1;+ rbDesc.DepthOrArraySize = 1; rbDesc.MipLevels = 1;+ rbDesc.SampleDesc.Count = 1; rbDesc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;++ ID3D12Resource* readbackBuf = nullptr;+ if (SUCCEEDED(ctx.device()->CreateCommittedResource(&rbHp, D3D12_HEAP_FLAG_NONE,+ &rbDesc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&readbackBuf)))) {+ // Record copy: flow -> readback.+ ID3D12CommandAllocator* rbAlloc = nullptr;+ ID3D12GraphicsCommandList* rbList = nullptr;+ ctx.device()->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&rbAlloc));+ ctx.device()->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, rbAlloc, nullptr, IID_PPV_ARGS(&rbList));++ D3D12_RESOURCE_BARRIER rb{};+ rb.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;+ rb.Transition.pResource = outFlow;+ rb.Transition.StateBefore = D3D12_RESOURCE_STATE_COMMON;+ rb.Transition.StateAfter = D3D12_RESOURCE_STATE_COPY_SOURCE;+ rb.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;+ rbList->ResourceBarrier(1, &rb);++ D3D12_TEXTURE_COPY_LOCATION dstCopy{};+ dstCopy.pResource = readbackBuf;+ dstCopy.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;+ dstCopy.PlacedFootprint.Footprint.Format = DXGI_FORMAT_R16G16_FLOAT;+ dstCopy.PlacedFootprint.Footprint.Width = w;+ dstCopy.PlacedFootprint.Footprint.Height = h;+ dstCopy.PlacedFootprint.Footprint.Depth = 1;+ dstCopy.PlacedFootprint.Footprint.RowPitch = static_cast<UINT>(flowRowPitch);++ D3D12_TEXTURE_COPY_LOCATION srcCopy{};+ srcCopy.pResource = outFlow;+ srcCopy.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;+ srcCopy.SubresourceIndex = 0;++ rbList->CopyTextureRegion(&dstCopy, 0, 0, 0, &srcCopy, nullptr);++ D3D12_RESOURCE_BARRIER rbBack{};+ rbBack.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;+ rbBack.Transition.pResource = outFlow;+ rbBack.Transition.StateBefore = D3D12_RESOURCE_STATE_COPY_SOURCE;+ rbBack.Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON;+ rbBack.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;+ rbList->ResourceBarrier(1, &rbBack);+ rbList->Close();+ ID3D12CommandList* rbLists[] = { rbList };+ ctx.directQueue()->ExecuteCommandLists(1, rbLists);++ // Wait for readback.+ ID3D12Fence* rbFence = nullptr;+ ctx.device()->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&rbFence));+ ctx.directQueue()->Signal(rbFence, 1);+ HANDLE rbEvent = CreateEventW(nullptr, FALSE, FALSE, nullptr);+ rbFence->SetEventOnCompletion(1, rbEvent);+ WaitForSingleObject(rbEvent, 5000);+ CloseHandle(rbEvent);+ rbFence->Release();++ // Map and analyze flow vectors.+ const uint16_t* flowData = nullptr;+ if (SUCCEEDED(readbackBuf->Map(0, nullptr, reinterpret_cast<void**>(const_cast<uint16_t**>(&flowData))))) {+ // Convert half to float and check for non-zero vectors.+ auto halfToFloat = [](uint16_t h) -> float {+ // Simple half-to-float conversion.+ uint32_t sign = (h >> 15) & 1;+ uint32_t exp = (h >> 10) & 0x1F;+ uint32_t mant = h & 0x3FF;+ if (exp == 0) return 0.0f;+ if (exp == 31) return mant ? 0.0f : (sign ? -1e30f : 1e30f);+ uint32_t bits = (sign << 31) | ((exp - 15 + 127) << 23) | (mant << 13);+ float f;+ memcpy(&f, &bits, 4);+ return f;+ };++ double maxMag = 0.0;+ uint64_t nonZeroCount = 0;+ // Sample every 16th pixel for speed.+ for (uint32_t y = 0; y < h; y += 16) {+ for (uint32_t x = 0; x < w; x += 16) {+ size_t idx = (y * (flowRowPitch / 4) + x) * 2; // 2 halfs per pixel+ float dx = halfToFloat(flowData[idx]);+ float dy = halfToFloat(flowData[idx + 1]);+ double mag = std::sqrt(static_cast<double>(dx) * dx + static_cast<double>(dy) * dy);+ if (mag > 0.0) ++nonZeroCount;+ if (mag > maxMag) maxMag = mag;+ }+ }+ readbackBuf->Unmap(0, nullptr);++ nonZeroMotion = nonZeroCount > 0;+ maxMagnitude = maxMag;+ confidencePresent = true; // Cost buffer was registered++ veyra::log::info("nvof", std::format("flow readback: nonZeroCount={} maxMag={:.3}",+ nonZeroCount, maxMag));+ }+ readbackBuf->Release();+ }} else {veyra::log::warn("nvof", "fence wait timeout; flow may not have completed");}@@ -266,9 +468,9 @@ int main(int argc, char** argv) {json += " \"probe\": \"veyra_nvof_probe\",\n";json += std::format(" \"runId\": \"{}\",\n", runId);json += std::format(" \"nvofApiVersion\": \"0x{:X}\",\n", maxVer);- json += std::format(" \"apiLoaded\": true,\n");- json += std::format(" \"instanceCreated\": true,\n");- json += std::format(" \"sessionCreated\": true,\n");+ json += std::format(" \"apiLoaded\": {},\n", apiLoaded ? "true" : "false");+ json += std::format(" \"instanceCreated\": {},\n", instanceCreated ? "true" : "false");+ json += std::format(" \"sessionCreated\": {},\n", sessionCreated ? "true" : "false");json += std::format(" \"motion\": {{\"maxMagnitude\": {}, \"nonZero\": {}}},\n",maxMagnitude, nonZeroMotion ? "true" : "false");json += std::format(" \"confidence\": {{\"present\": {}}},\n",