feat: add STEP-113 Android PBF fast gate diagnostics
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
tei
2026-10-11 09:11:27 +09:00
parent c6d13e1059
commit 92efa36f4c
14 changed files with 1368 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <array>
#include <cstdint>
#include <optional>
#include <set>
@@ -237,6 +238,72 @@ struct RenderSegmentDiagnosticsEntry {
std::optional<RenderSegmentCacheDiagnostics> cache;
};
// Platform-neutral, bounded diagnostic samples. No pointers to mutable renderer objects.
struct FastGateRetainedSample {
uint32_t segmentIndex = 0;
RenderSegmentCacheDiagnostics cache;
bool placementGatePassed = false;
std::string actualExecution;
};
struct FastGateCacheInputSample {
uint32_t segmentIndex = 0;
bool exists = false;
bool valid = false;
uint64_t buildRevision = 0;
uint64_t staticRevision = 0;
};
struct FastGatePhaseSample {
// Placement changed/fade come from the last completed render-tree snapshot
// in pre-fast. Fast tree flags do not imply a fresh Placement calculation.
// They are never substituted for the current controller gate #13.
bool hasPlacementSnapshot = false;
bool placementChanged = false;
float symbolFadeChange = 0;
bool placementTransitionActive = false;
bool retainedSamplesTruncated = false;
uint64_t contentRevision = 0;
uint64_t topologyRevision = 0;
uint64_t configRevision = 0;
uint64_t fullCpuFrame = 0;
std::optional<uint64_t> processSimulationAdvance;
std::vector<FastGateRetainedSample> retained;
};
struct FastGateFrameSample {
uint64_t sequence = 0;
uint64_t frame = 0;
int64_t updateTimeNs = 0;
uint32_t failMask = 0;
uint32_t knownMask = 0x00ffffff;
std::string firstFailure;
bool decisionConsistent = true;
bool candidate = false;
bool preFastPlacementTransition = false;
bool placementTransitionsEnabled = true;
bool completed = false;
std::string outcome{"pending"};
bool cacheInputsTruncated = false;
std::vector<FastGateCacheInputSample> cacheInputs;
FastGatePhaseSample pre;
FastGatePhaseSample post;
};
struct FastGateTraceDiagnostics {
uint32_t schemaVersion = 1;
uint64_t lifecycle = 0;
uint64_t attempts = 0;
uint64_t overwritten = 0;
uint64_t decisionMismatch = 0;
uint64_t fullRendered = 0;
uint64_t fastRendered = 0;
uint64_t noRender = 0;
std::array<uint64_t, 24> failureCounts{};
std::array<uint64_t, 24> firstFailureCounts{};
std::vector<FastGateFrameSample> frames;
};
struct RenderSegmentDiagnostics {
uint32_t schemaVersion = 1;
bool enabled = true;
@@ -274,6 +341,7 @@ struct RenderSegmentDiagnostics {
RenderMutationDiagnostics lastMutation;
std::vector<StyleLayerDiagnostics> styleLayers;
std::vector<RenderSegmentDiagnosticsEntry> segments;
std::optional<FastGateTraceDiagnostics> fastGateTrace;
};
struct ResolvedRenderSegment {