Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd5e38594f | ||
|
|
87b0e5d8cd | ||
|
|
212814a75c | ||
|
|
dd9bfd3217 | ||
|
|
b90d63d0f7 | ||
|
|
e7586a1256 | ||
|
|
8440adc742 | ||
|
|
5eb9ee76ff | ||
|
|
b9c13c37c0 | ||
|
|
c0596c5f24 |
No files matched your search
@@ -578,7 +578,19 @@ driven by `EditorBrush*` props.
|
||||
the result through the normal MPSC queue; the game thread reads the token again before applying.
|
||||
`FChunkResult::Epoch` still guards the generation epoch. Desired work is sorted from the true pawn
|
||||
position, with the occupied/support LOD0 tile and the next tile along the heading in an absolute
|
||||
high-priority prefix. Stationary player ≈ free. (Old per-frame O(loaded×desired) scan = 22ms.)
|
||||
high-priority prefix. Admission counts queued/running `ActiveTaskCount`; `PendingTiles` stays until
|
||||
game-thread apply for duplicate suppression and result bookkeeping, but completed MPSC results do
|
||||
not occupy a worker slot. `voxel.StreamingLegacyPendingResultCap=1` restores the old result-inclusive
|
||||
admission count. `voxel.StreamingDynamicNearReserve=1` holds the authored near reserve while moving
|
||||
or before the walkable gate, then releases it to coarse work after the stationary ring is ready.
|
||||
Stationary player ≈ free. (Old per-frame O(loaded×desired) scan = 22ms.)
|
||||
Core region compilation is a separate resource gate. With the default
|
||||
`voxel.CoreRegionConcurrentAdmission=1`, tile keys that need the pending region are withheld, while
|
||||
independent keys may use remaining worker slots. `0` restores the all-admission wait. Region pages
|
||||
are built off the lookup map, published as immutable shared pages, and reclaimed when the final
|
||||
reader releases its shared owner. `voxel.StreamingResultBacklogCap=256` independently bounds queued
|
||||
result payloads plus active tile tasks and held prequeue results; `0` disables this memory backstop.
|
||||
Result count is not used as a worker-slot count.
|
||||
- **LOD** changes HOT-SWAP (`LoadTile` only, never unload-first) → no holes. LOD
|
||||
reconciliation lives in the PERSISTENT per-frame submit loop (same loop as new-chunk loads),
|
||||
NOT as a one-shot on the boundary-cross frame — a one-shot drops every chunk past the task
|
||||
@@ -1435,6 +1447,337 @@ LOD7/8 shell repair is skipped for certified SurfaceWorld tiles, the renderer do
|
||||
backfaces, and the strips predate S4 in S2/S3. Refining all steep faces would multiply far mesh work;
|
||||
S4 leaves that cost/quality tradeoff open.
|
||||
|
||||
### 8.26 Streaming readiness gates and admission order — World Assembler S5 / M3 Round 9
|
||||
|
||||
Do not use “every tile in the current desired clipmap is resident” as a moving-player readiness
|
||||
gate: the center and desired keys change continuously, so that condition can remain false even when
|
||||
the player has safe ground and a closed view. Report three independent gates from the first actor
|
||||
tick: (1) **walkable now** — the support tile and collision-required level-0 tiles in the 3×3 XY
|
||||
neighborhood have installed collision (or are explicitly collision-not-required); (2) **enclosed
|
||||
now** — the active view has ground, horizon and the family-appropriate ceiling, with no exposed
|
||||
coverage hole or unexpected sky; (3) **refined soon** — each target LOD resolves within its stated
|
||||
time or travel distance after entering range. While moving, report the largest frame/time gap in
|
||||
enclosure and maximum distance that unresolved work trails the pawn. FloatingIslands has open sky by
|
||||
design, so its enclosure check excludes a planar roof.
|
||||
|
||||
The shared `AVoxelWorld::UpdateChunksAroundPosition` scheduler serves both the Core snapshot path and
|
||||
Core-off legacy path. It admits the collision-critical 3×3 ring first. The measured S5 order remains
|
||||
opt-in because it did not beat the legacy order on the gates and the viewer could not confirm screen
|
||||
presentation: set `voxel.StreamingCoarseFirst=1` to admit coarse desired levels from the maximum LOD
|
||||
down to `max(2, FullResClipLevels)`, favoring tiles ahead of travel and then nearer tiles within each
|
||||
LOD; LOD0/1 refinement follows. Default `0` preserves the S4 LOD0-to-LOD8 order.
|
||||
`voxel.StreamingDynamicNearReserve=1` keeps the authored near-task reserve while the pawn moves or
|
||||
until the stationary walkable ring is ready; this is now the default. Set it to `0` only for the
|
||||
legacy-admission negative control. After the stationary nine-tile ring is ready, coarse work can use
|
||||
the formerly reserved slots.
|
||||
The standalone queue defaults to legacy order; `--coarse-first-stream-order` opts into the S5 tiers
|
||||
and `--legacy-stream-order` explicitly selects the legacy order.
|
||||
|
||||
This order changes only which key starts first. Tile field arithmetic, hashes, `Epoch`, cancellation
|
||||
checks, `ModsLock`, the four `EQueueMode::Mpsc` result queues and `EndPlay` draining remain unchanged.
|
||||
The clipmap remains a non-overlapping partition, and `TransitionHold` still performs load-before-
|
||||
unload reconciliation. No duplicate coarse placeholder is admitted: the current transition rules
|
||||
do not make a temporary overlapping parent safe at initial spawn without a separate all-descendants
|
||||
hide/swap gate. A coarse tile completion count alone is not proof of enclosure; verify the actual
|
||||
view and family-specific ground/ceiling coverage.
|
||||
|
||||
`VoxelStartupTrace` records request and worker-start ordinals, LOD, priority, epoch, resident-at-
|
||||
request, queue wait, build time, result wait, apply time and discarded/cancelled result reasons.
|
||||
Use `-voxel.StartupTraceUntilEndPlay=1` for a moving trace. Round 9 found similar cold walkable-gate
|
||||
times, no demonstrated enclosure win, and fewer cancellations at 60 m/s, while that route's center
|
||||
deltas were invalid. DXGI marked the capture window occluded, so its images are back-buffer evidence
|
||||
rather than proof of screen presentation. Keep S5 opt-in until an owner-visible run measures the
|
||||
three gates and closes that gap. Full results and limits are in
|
||||
`Standalone/Research/WorldAssemblerM3/Round9/REPORT.md`.
|
||||
|
||||
### 8.27 Cold-view throughput trace and gated coarse admission — World Assembler S6 / M3 Round 10
|
||||
|
||||
`UpdateChunksAroundPosition` samples residency at intervals of at least 0.25 seconds. A `streaming_sample`
|
||||
timestamp is therefore a quantized observation, not a tile-completion timestamp or an admission throttle.
|
||||
Use the direct per-tile apply records for completion time, and `apply_frame` records for the game-thread
|
||||
budget, queued-result estimate and running-worker count. `collision_ready` measures the asynchronous
|
||||
RealtimeMesh submit-to-body-update interval; it is not an isolated Chaos CPU-cook timer.
|
||||
|
||||
The staged SurfaceWorld actor trace contained 2,578 desired keys. With legacy order and the authored
|
||||
4-visible-mesh / 2 ms apply budget, the full desired set became resident at 17.412 s and the required
|
||||
collision ring became walkable at 0.632 s. `voxel.StreamingCoarseFirst=1` with
|
||||
`voxel.StreamingDynamicNearReserve=1` completed the same set at 11.704 s while the ring gate remained
|
||||
0.627 s. Coarse admissions begin only after the nine-tile walkable gate. This reduces measured cold
|
||||
residency by about one third on the staged plan, but null-RHI residency does not prove rendered
|
||||
enclosure. Keep coarse-first opt-in until that view is checked in a rendered owner-plan run.
|
||||
|
||||
The separate `voxel.StreamingStartupApplyBoost` switch stays default-off. At `1`, it temporarily allows
|
||||
12 visible mesh submissions / 14 ms while the initial desired set and walkable ring are incomplete,
|
||||
with a 30 second ceiling; at `0`, the authored budget is unchanged. On the matched legacy-order test,
|
||||
the boost changed full-set readiness from 17.412 s to 17.346 s and removed count-cap frames, but did
|
||||
not improve end-to-end residency. Keep the normal 4 / 2 ms guard for play.
|
||||
|
||||
The S6 trace found the shared pool was not saturated: its 10-slot idle estimate was about 132
|
||||
slot-seconds on legacy order and 73 on gated coarse-first, while game-thread tile applies totaled only
|
||||
about 0.24 seconds. S7's frame-level admission and cumulative worker-task accounting revisited that
|
||||
open question; see §8.28.
|
||||
|
||||
The report records per-LOD worker, queue, result-queue and apply totals, collision latency, frame
|
||||
percentiles, hashes, regressions and the command lines. The standalone 60 m/s viewer now counts
|
||||
forward +Y center crossings across multi-chunk deltas; that route reports valid crossing deltas, but
|
||||
its latency gate still fails. These are scheduling and instrumentation changes only: deterministic
|
||||
W1/W8/W16 world and LOD hashes are unchanged, as are `Epoch`, cancellation, `ModsLock`, MPSC queue,
|
||||
shutdown-drain and game-thread UObject-creation rules. See
|
||||
[`Standalone/Research/WorldAssemblerM3/Round10/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round10/REPORT.md).
|
||||
|
||||
### 8.28 Shared admission accounting and worker supply — World Assembler S7 / M3 Round 11
|
||||
|
||||
`PendingTiles` is a game-thread result-bookkeeping set: its entry lasts from task submission until
|
||||
`ApplyTileResult`, so it can include work that has finished and is waiting in one of the MPSC result
|
||||
queues. It is not the count of active generation tasks. The S6 admission path used
|
||||
`PendingTiles.Num()` for that cap. On the S7 old-path control, after LOD0 had no missing keys, 877
|
||||
admission frames still had LOD1+ work missing and hit the four-slot near reserve; at a representative
|
||||
frame, occupancy was 6/10 while only four tasks were queued/running and two completed results were
|
||||
waiting to apply. 806 of those 877 frames had a positive completed-result estimate.
|
||||
|
||||
Admission now uses `ActiveTaskCount`, which is incremented before launching the UE task and released
|
||||
by its RAII guard when the worker lambda exits. This still counts queued and running work, but completed
|
||||
results do not consume an admission slot. `voxel.StreamingLegacyPendingResultCap=1` restores the old
|
||||
`PendingTiles` accounting; the test harness's `NearReserveMode=Legacy` also sets
|
||||
`voxel.StreamingDynamicNearReserve=0`, reproducing the S6 path. `StreamingDynamicNearReserve` now
|
||||
defaults to `1`; `StreamingCoarseFirst` remains `0`, and the apply boost remains `0` in the matched
|
||||
measurement.
|
||||
|
||||
On the 2,578-key owner SurfaceWorld trace, the old-path control reached the full set in 17.527 s,
|
||||
walkable ring in 0.650 s, and full LOD0 in 2.281 s. Dynamic admission reached them in 7.780 s,
|
||||
0.581 s, and 1.439 s. Its first-request-to-ready interval was 7.342 s with 41.364 worker-seconds,
|
||||
or 5.63 integrated busy-worker equivalents. Using the S6 10-slot idle formula on that same interval
|
||||
gives 32.06 slot-seconds, versus 133.01 on the S7 old-path control and 132.1 in S6. The ten S7
|
||||
spawn samples that ended with free admission capacity and missing keys all recorded a submission
|
||||
stop at the 10-task cap (one worker could finish before the end-of-pass sample); the frame trace
|
||||
found no near-reserve decline, all-loaded latch, walkable gate failure, or inner `LoadTile` rejection
|
||||
in those passes. Result-aware admission therefore removes the measured cold-set blocker and
|
||||
reproduces the legacy control within 0.7%, but the 7.78 s full-set result still misses the rough
|
||||
4.14 s `worker-seconds / 10 slots` estimate. Across the full 45 s trace, free-capacity frames with
|
||||
missing keys were classified by LOD as near reserve or full cap; none was unclassified.
|
||||
|
||||
The per-frame `running_workers` value is biased high when sampled only at admission/apply boundaries;
|
||||
S7 added cumulative task intervals and found 5.63 busy-worker equivalents over the first-request-to-
|
||||
ready span, with eight sustained overlaps in the reconstructed intervals; a zero-duration endpoint
|
||||
tie briefly counts nine. This locates
|
||||
the remaining gap downstream of an admission refusal, but does not distinguish UE task-pool dispatch
|
||||
from work internal to a tile. Measured worker task time rose 9.7% versus the negative control
|
||||
(16.04 ms versus 14.62 ms per initial tile); hashes match and the trace records elapsed task time,
|
||||
not CPU cycles. During the later +Y move, the loader's `bCoreRegionCompilePending` guard also
|
||||
blocked 10 legacy and 11 dynamic submission passes despite free tasks; each inner-decline record
|
||||
had that flag set. The tick trace reports aggregate `TestWorld->Tick()` only: spawn p95/max was
|
||||
2.262/5.230 ms and walk p95/max was 2.512/28.893 ms; no subsystem marker names the walk
|
||||
maximum. The nine-tile ring and full LOD0 are faster than S6. Tile output hashes did not change, so
|
||||
the recipe version remains unchanged. Null-RHI runs do not prove player-visible enclosure. See
|
||||
[`Standalone/Research/WorldAssemblerM3/Round11/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round11/REPORT.md)
|
||||
for the audit counts, RMC review, quality matrix, commands and binary hashes.
|
||||
|
||||
### 8.29 Concurrent region admission and bounded result backlog — World Assembler S8 / M3 Round 12
|
||||
|
||||
The S7 moving trace found `bCoreRegionCompilePending` returning before all tile submissions. Each
|
||||
such update could leave most slots unused while a new player center requested a region page. The
|
||||
default `voxel.CoreRegionConcurrentAdmission=1` lets `LoadCoreTile` continue for keys outside the
|
||||
pending and in-flight region sets. Keys that need those sets wait for publication; setting the CVar
|
||||
to `0` restores the old all-admission gate for an A/B control. This changes scheduling only.
|
||||
|
||||
`World::compileTileRegion` builds region pages without mutating pages already in use, then publishes
|
||||
them under the region-map lock. `generateTile` copies a `shared_ptr` while holding the map's shared
|
||||
lock and keeps it for the whole mesh read. Evicting or replacing a map entry therefore cannot free a
|
||||
page under an existing worker. The actor's shared `WorldLock` prevents a world edit/reset while a
|
||||
tile reader or region compiler is active; `EndPlay` waits for the shared active-task count before
|
||||
destroying the actor's UObject state.
|
||||
|
||||
The result backlog has its own backpressure control. `voxel.StreamingResultBacklogCap=256` counts
|
||||
queued MPSC results, active tile-generation tasks and held visible-LOD0 prequeue results. Reaching
|
||||
the cap stops new tile admissions until apply drains results or active tasks retire. It does not make
|
||||
finished results consume worker slots in the normal admission count. `0` is the uncapped negative
|
||||
control; the Core-off legacy test also exercises the default cap.
|
||||
|
||||
On the 25 cm owner SurfaceWorld plan, the matched 6 m/s CVar-off/on runs both completed 11 region
|
||||
requests (one initial desired set plus ten center moves). The old gate recorded 11 global scheduler
|
||||
skips; concurrent admission recorded none and submitted 110 unrelated tiles with no dependent-key
|
||||
declines. All eleven changing support centers had the nine-tile walkable ring ready immediately.
|
||||
Accumulated pending windows were about 0.43 s, but measured compiler wall time totaled about 11 ms.
|
||||
At 60 m/s with a 400 m teleport, the trace recorded 113 region requests, 782 independent submissions
|
||||
and 983 dependent-key declines. Most support centers advanced before their nine-tile ring could
|
||||
become ready, so the high-speed gate still fails its travel-time target.
|
||||
|
||||
The shared result trace now records `queued_peak`, peak payload bytes, the configurable cap, and cap
|
||||
stops. A slow-apply teleport stress run peaked at 256 results / 76.2 MB with the default cap; the
|
||||
uncapped control reached 1,577 / 125.1 MB. Payload bytes exclude queue-node and allocator overhead.
|
||||
The cap kept the observed backlog finite without reinstating the S6/S7 finished-result worker-slot
|
||||
decline. Full timings, per-center records, quality checks and hashes are in
|
||||
[`Standalone/Research/WorldAssemblerM3/Round12/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round12/REPORT.md).
|
||||
|
||||
### 8.30 Velocity-scaled support-ring lookahead — World Assembler S9 / M3 Round 13
|
||||
|
||||
The ring gate uses the support tile, which can sit one tile below the clipmap center on a surface
|
||||
world. Both scheduler branches must use the same `GetPlayerSupportTile` result for the active 3x3
|
||||
collision-critical ring and its predicted rings. Predicting from the stream center can spend work on
|
||||
the wrong vertical slice, so the trace includes both `center` and `walkable_center`.
|
||||
|
||||
`voxel.StreamingCollisionLookahead` defaults to `1`; `0` disables only the prediction and is the
|
||||
negative control. `GetStreamingHeadingStep` transforms velocity into actor space and selects its
|
||||
dominant axis, including Z for a fall; when motion is zero it falls back to pawn forward. The
|
||||
lookahead targets 350 ms of travel, rounds up to whole active LOD0 tiles, and clamps the lead to one
|
||||
or two rings. The scheduler adds the future 3x3 keys only when they already belong to the desired
|
||||
clipmap, then moves those collision keys into `CriticalDesiredTiles`. It does not reserve more worker
|
||||
slots, expand the clipmap, cancel in-flight jobs, or change tile arithmetic. `collision_lookahead`
|
||||
records speed, direction, stream/support centers, promoted-key count and missing desired keys.
|
||||
|
||||
On the staged SurfaceWorld owner plan at 25 cm, the S9 `+Y` trace found the ring ready at all 74/74
|
||||
support-center arrivals through 40 m/s; the corrected-source CVar-off control found 15/74. The
|
||||
S8 no-lookahead baseline was 25/74. At 50 m/s scripted downward motion, 93/93 support-center
|
||||
arrivals were ready. The 40 m/s matched on/off initial-ready times were 7.743/7.778 s, so the
|
||||
prediction did not slow spawn in this pair. These figures support 40 m/s as the highest horizontal
|
||||
speed tested; they do not measure a higher horizontal ceiling. The vertical trace is a scripted
|
||||
actor move through the owner plan, not a free-fall physics replay.
|
||||
|
||||
For 108 critical LOD0 tile jobs with complete stage joins at 40 m/s, request-to-worker start was
|
||||
0.02/9.59 ms p50/p95, generation 66.6/84.0 ms, result wait 9.3/17.7 ms, game-thread apply to mesh
|
||||
submit 0.17/0.24 ms, RMC collision submit 0.01/0.02 ms, and RMC submit-to-body-update 37.6/85.9 ms.
|
||||
The latter is the observable body-ready interval, not a Chaos-only CPU timer. The current trace saw
|
||||
no scheduler skips, a 113-result peak under the 256 cap and 33 ms maximum region-page compile with
|
||||
concurrent admission. Generation and body update dominate the measured tile path; the lookahead
|
||||
gives those stages time to finish before the support center changes. LOD0-missing clipmap frames
|
||||
remain separately visible in the Round 13 table; they are not equivalent to a missing support ring.
|
||||
|
||||
The scheduler change does not alter field, mesh or collision output, so `WorldAssemblerPlanV1` and
|
||||
the far-horizon recipe versions stay unchanged. Core-off legacy, M2 fixtures, SurfaceWorld and
|
||||
FloatingIslands checks passed; the S3/S4 ground, cap and coverage audit passed. The full sweep,
|
||||
negative control, hashes, stage ledger and the deferred LOD8 optimization plan are in
|
||||
[`Standalone/Research/WorldAssemblerM3/Round13/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round13/REPORT.md).
|
||||
|
||||
### 8.31 LOD8 planar far-horizon sampling — World Assembler S10 / M3 Round 14
|
||||
|
||||
The planar far horizon is already built from a `Heightfield2D` column profile, but LOD8 previously
|
||||
refined ground and cap at a 128-voxel grid even though a 25 cm LOD8 marching-cubes cell spans 512
|
||||
voxels (128 m). `BuildNativeHorizonGridCoordinates` now keeps the globally aligned 128-voxel edge
|
||||
strips and uses the marching-cubes step through the LOD8 interior. The boundary strips preserve
|
||||
shared edge samples; the interior does not build detail smaller than the LOD8 cell spacing. LOD4–7
|
||||
retain their prior sample coordinates. No agreement tolerance was relaxed.
|
||||
|
||||
This applies to native horizon plans that declare a planar heightfield. Ground and cap still run in
|
||||
separate refinement passes, using the same deterministic coordinate lattice. `Heightfield2D` keeps
|
||||
its thread-local column cache: S10 records remaining duplicate evaluations across LOD8 tiles and
|
||||
workers but does not share cache pages between workers. The `--far-horizon-lod8-step=128` Standalone
|
||||
override restores the old sampling density for an A/B control; it does not restore the old v2 hash
|
||||
salt. The default sampling change bumps the far recipe hash version from 2 to 3. LOD0–3 hashes and
|
||||
density are unchanged.
|
||||
|
||||
`VoxelForgeSharedFeatureCost` now reports column evaluation, marching-cubes, ground-refine,
|
||||
cap-refine and output-assembly timings separately. Column evaluation is subtracted from each
|
||||
overlapping MC/refinement wall interval; output assembly includes the final payload flattening and
|
||||
optional diagnostic hashing. Percentiles are computed independently and are not additive. The
|
||||
optional LOD8 XY capture uses worker-local vectors and records only diagnostics; it does not affect
|
||||
mesh generation or recipe identity.
|
||||
|
||||
On the staged 25 cm SurfaceWorld plan, the warmed LOD8 full-tile p95 fell from 59.848 ms to
|
||||
13.933 ms. Column evaluation fell from 31.319 ms to 7.478 ms; ground and cap refinement fell from
|
||||
11.666/10.029 ms to 1.690/1.330 ms. The S3 ground agreement, S4 cap agreement and 100% cap-ray
|
||||
coverage gates still pass at their existing tolerances. BuildHost actor startup, the W1/W8/W16
|
||||
matrix, W1/W8/W12 Standalone hashes, the 40 m/s support-ring trace and the S10/S9 captures are
|
||||
recorded in [`Standalone/Research/WorldAssemblerM3/Round14/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round14/REPORT.md).
|
||||
|
||||
### 8.32 Bounded spawn-phase mesh applies — World Assembler S11 / M3 Round 15
|
||||
|
||||
The shared `AVoxelWorld::ProcessPendingChunks` startup budget now defaults on for the initial desired
|
||||
set: up to 12 visible mesh applies or 14 ms in one frame, with a 30 second ceiling. It ends as soon
|
||||
as the first desired set and stationary walkable ring are ready, the desired epoch changes, an
|
||||
explicit per-step apply override is supplied, or the ceiling expires. Normal play uses the authored
|
||||
`MaxMeshAppliesPerFrame` and `MaxMeshApplyMilliseconds` values. Set
|
||||
`voxel.StreamingStartupApplyBoost=0` for the matched authored-budget control. `startup_apply_config`
|
||||
records the actor-read CVar and both budgets; `startup_apply_budget` records when the bounded phase
|
||||
starts and ends.
|
||||
|
||||
On the matched 25 cm SurfaceWorld trace, both fresh processes handled 2,578 initial tiles. With the
|
||||
authored 4-mesh/2 ms budget, readiness was 7.118 s, the nine-tile walkable ring was ready at 0.495 s,
|
||||
and full LOD0 at 1.444 s. The four-mesh limit hit 305 of 399 apply frames; result backlog peaked at
|
||||
252/256 and result-wait p95/max was 847/1,119 ms. The last LOD8 worker ended at 6.068 s, but its
|
||||
result applied at 7.182 s. With the shared startup budget enabled, readiness was 5.960 s, the ring
|
||||
was ready at 0.486 s, and full LOD0 at 1.403 s. No apply-count frame hit its limit; backlog peaked
|
||||
at 10 and result-wait p95/max fell to 16.6/19.3 ms. The last LOD8 worker/apply times were 6.015/6.019 s.
|
||||
|
||||
The remaining worker-generation span is frame-paced: 2,578 requests arrived over 310 submission
|
||||
passes (8.32 per pass) in 5.58 s. The trace integrates 4.8 busy workers out of 10, while sampled
|
||||
active task guards averaged 9.9/10 and sampled running workers peaked at 8. The LOD4 group used the
|
||||
most worker time (6.590 s) but finished at 4.276 s; the final LOD8 group applied at 6.019 s. The 60
|
||||
initial RMC body updates had an 18.4 ms p95 submit-to-body-update interval, and the walkable ring was
|
||||
ready well before that far-LOD tail. Geometry and collision arithmetic do not change, so recipe
|
||||
versions stay unchanged.
|
||||
See [`Standalone/Research/WorldAssemblerM3/Round15/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round15/REPORT.md).
|
||||
|
||||
### 8.33 Streaming worker supply and tick-independent task pickup — World Assembler S12 / M3 Round 16
|
||||
|
||||
The S11 trace showed that admission was paced by the actor tick: typical tiles finished within one
|
||||
18 ms frame, while the eight TaskGraph background workers waited for the next scheduler pass to
|
||||
receive another task. The host exposed ten TaskGraph workers (two foreground, eight background),
|
||||
and the tile tasks ran only on the eight background workers. The shared scheduler now admits up to
|
||||
one additional worker-set of prioritized tile tasks (`voxel.StreamingReadyQueueDepth`, default 8,
|
||||
clamped to the effective worker count). These tasks are still selected and submitted on the game
|
||||
thread through the existing desired-tile ordering; UE's background executor dispatches queued work
|
||||
as each worker becomes free. There is no worker-owned continuation list, and no UObject, RMC, or
|
||||
desired-set mutation moves off the game thread.
|
||||
|
||||
`voxel.StreamingBackgroundWorkerCap=1` sizes the streaming admission slots to
|
||||
`FTaskGraphInterface::GetNumBackgroundThreads()`. It does not lower `GetMaxConcurrentTasks()` or the
|
||||
worker limit used inside Core's parallel generation. `0` restores the old logical-core-derived
|
||||
streaming cap. The `worker_backend_config` and `streaming_worker_cap_readback` trace events record
|
||||
the CVar readback, logical core count, TaskGraph and global queued-pool sizes, task API, and effective
|
||||
slot count. Each tile row records its submission, worker start/end, and OS thread ID. The external
|
||||
BuildHost sample also records process thread count and working set; its eight tile IDs match the
|
||||
TaskGraph background pool. RMC's inspected async collision path queues through `GThreadPool`, which
|
||||
is a separate 10-thread pool; it does not occupy those eight TaskGraph worker IDs. Arbitrary UE
|
||||
background tasks can share TaskGraph background workers, so the pool count alone does not imply
|
||||
those workers are idle outside the measured tile task intervals.
|
||||
|
||||
Admission remains shared by `LoadTile` and `LoadCoreTile`. The queue-aware dynamic near reserve is
|
||||
at least the ready-queue depth while moving or before the stationary walkable gate is ready, capped
|
||||
at one less than the worker slots. Horizon work uses a separate coarse cap; while moving, ordinary
|
||||
LOD0 admission stops at the actual worker-slot count and critical collision/edit work retains its
|
||||
existing higher admission cap. Thus queued far work cannot consume the reserved near capacity.
|
||||
`bStreamingPlayerMoving` is captured on the game thread for both admission paths. Existing
|
||||
`GenerationEpoch` / `DesiredEpoch` and per-request cancellation checks still reject stale tasks and
|
||||
results; no preprepared desired list survives a set change.
|
||||
|
||||
On the matched 25 cm SurfaceWorld startup trace, queue depth 8 plus the 8-worker slot cap brought the
|
||||
2,578-tile ready time to 4.911 s (the matched queue-depth-zero control took 7.024 s). The LOD0
|
||||
worker tail ended at trace time 1.167 s; its last apply was at 1.087 s on the actor startup clock,
|
||||
against S11's 1.403 s. The stationary 3×3 collision-ready ring was ready at 0.509 s, close to the S11
|
||||
0.488 s measurement. The per-tile trace contains all 2,578 initial requests and shows eight active
|
||||
workers at peak, 29.432 worker-seconds, and 6.573 seconds of inter-task idle time summed across the
|
||||
eight slots. 500 ms busy-worker equivalents, per-LOD completion and each slot's inter-task gap are
|
||||
saved under `Saved/BuildHost/Round16/`. The full table and matched controls are in the Round 16
|
||||
report.
|
||||
|
||||
Foreground task priorities were tested and rejected: they increased spawn/walk `UWorld::Tick`
|
||||
tails despite occupying more TaskGraph workers. The shipped priorities stay `BackgroundHigh` for
|
||||
near and `BackgroundNormal` for horizon tasks. The task-pickup changes do not alter density,
|
||||
triangulation, collision, or Core output, so no recipe version changes.
|
||||
See [`Standalone/Research/WorldAssemblerM3/Round16/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round16/REPORT.md).
|
||||
|
||||
### 8.34 Tile cost and column reuse audit — World Assembler S13 / M3 Round 17
|
||||
|
||||
The owner SurfaceWorld uses 32 marching-cubes cells only at LOD0–1; LOD2 and farther use 16
|
||||
coarse cells. Including the normal halo, those are 35³ and 19³ density samples, respectively.
|
||||
Round 17 added exclusive timing for classification, column evaluations during MC/ground/cap,
|
||||
non-column MC/refinement work, and mesh assembly. Percentiles are independent. The measured
|
||||
owner route is a planar `Heightfield2D` surface: its recipe noise is evaluated while computing XY
|
||||
columns, with no volumetric cave, tunnel, room, or route density term. The two-tile interpolation
|
||||
probe reduced measured column-compute time by about 71–74% at stride two, but exceeded the 2 cm error gate at
|
||||
LOD1 and every tested coarse LOD; stride four also exceeded it on LOD0. It had no near-zero fallback
|
||||
and was not enabled in generation.
|
||||
|
||||
LOD4 is the first far-cap refinement level: its cap grid is 16 voxels (4 m), while LOD5–7 use the
|
||||
128-voxel boundary grid (32 m); ground refinement begins at LOD5. LOD4's cap pass costs about
|
||||
4.87 ms of column evaluation plus 1.26 ms exclusive at the eight-tile p95, but its largest measured
|
||||
cost is 29.36 ms of column evaluation during MC. LOD4 also has 8,224 column-cache misses per sampled
|
||||
tile p95 versus 1,634 at LOD3 and 1,916 at LOD5. The cache remains thread-local. The all-LOD overlap
|
||||
probe found substantial cross-worker duplicate XY evaluations, which is evidence for a future
|
||||
shared-page A/B test, not proof that a shared cache will pay after synchronization and lifetime
|
||||
costs. Round 17 changed no density, mesh, collision, or recipe output; recipe versions remain
|
||||
unchanged. See [`Standalone/Research/WorldAssemblerM3/Round17/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round17/REPORT.md).
|
||||
|
||||
## 9. Multiplayer model (listen-server first, dedicated-friendly)
|
||||
|
||||
> **Status: transport is DESIGN ONLY — nothing is networked in-tree yet** (no `Replicated`/`HasAuthority`/RPCs; a
|
||||
|
||||
@@ -328,6 +328,14 @@ the four MPSC result queues `CriticalProcessQueue` / `EditedProcessQueue` / `Nea
|
||||
`ProcessQueue`, and `PendingTiles` (TSet) (VoxelWorld.h:908-912).
|
||||
**Async state:** `bShuttingDown`, `ActiveTaskCount` (atomics), `GenerationEpoch`, and the
|
||||
game-thread `PendingTileCancellation` map whose per-request atomic flags are read-only on workers.
|
||||
S5 assigns request and worker-start ordinals to each tile, preserving epoch, resident-at-request,
|
||||
priority, queue-wait and build timing in the opt-in startup trace. All four result queues remain MPSC;
|
||||
EndPlay still waits for workers and drains every queue.
|
||||
S8 adds `StartPendingCoreRegionCompile`: by default `voxel.CoreRegionConcurrentAdmission=1` lets
|
||||
`LoadCoreTile` admit keys independent of a pending region page; `0` restores the global compile gate.
|
||||
`voxel.StreamingResultBacklogCap=256` limits queued result payloads + active tile tasks + held
|
||||
prequeue results without folding completed results back into worker-slot admission; `0` disables it.
|
||||
Core region pages are immutable shared owners while readers are active. See §8.29 and §3.15.
|
||||
|
||||
**⭐ Espace ACTEUR / ACTOR SPACE (2026-08-17).** Le champ de densite est defini en espace **acteur** :
|
||||
`(0,0)` est l origine de l acteur `AVoxelWorld`, pas celle du monde Unreal. `WorldToLocalCm` /
|
||||
@@ -349,6 +357,8 @@ casse cette arithmetique *structurellement* — `BeginPlay` loggue une **Error**
|
||||
| `ValidateDeterminism()` | — | **F2 CallInEditor button (PIE)**: re-samples boundary points under left- vs right-chunk cache warm-ups + a same-alignment repeat; any non-zero delta = window-invariance regression (§8.4). Run after every "bit-identical" hot-path refactor. |
|
||||
| `GetMaxConcurrentTasks()` | — | T2.d — asset `MaxConcurrentTasks` capped to logical cores − 2 (all three budget checks use it). |
|
||||
| `GetActiveGenerationTaskCount()` | — | Normal mode returns the existing pending count. With `voxel.Step1PrequeueVisibleLOD0>0`, completed held results are excluded from active worker admission so a full render corpus can be generated before the upload release. |
|
||||
| `StartPendingCoreRegionCompile()` / `LoadCoreTile()` | — | Background Core region-page compile. `voxel.CoreRegionConcurrentAdmission=0` is the global-stop control; default `1` withholds only keys in the pending/in-flight region sets. Independent tiles can proceed. Core pages use immutable `shared_ptr` ownership under a separate shared mutex. §8.29. |
|
||||
| `EnqueueStreamingResult()` / `IsStreamingResultBacklogCapped()` | — | Central result accounting for all four MPSC queues. `voxel.StreamingResultBacklogCap=256` caps queued results + active tile tasks + held prequeue results; `0` disables the cap. This bounds result-payload growth separately from worker-slot admission. §8.29. |
|
||||
| `PostEditChangeProperty` | 1000 | Editor live-edit hook. |
|
||||
| `OnObjectModifiedInEditor` | 1022 | Regenerates when a strate asset is edited (if `bLiveEditStrates`). |
|
||||
| `EndPlay` | 1118 | Sets `bShuttingDown`, **waits for `ActiveTaskCount`→0**, unbinds delegate. |
|
||||
@@ -359,7 +369,7 @@ casse cette arithmetique *structurellement* — `BeginPlay` loggue une **Error**
|
||||
| `AdvanceHeadlessDigMotionTest` / `RecordHeadlessDigMotionFrame` | 3060 / 3217 | Explicit `-voxel.TestDigMotion=1` repro: optional near digs, then repeats underfoot digs and samples `Generator->GetDensityAt` immediately after each edit, on its first subsequent simulated frame, and on every following observation frame. `-voxel.TestDigMotionFieldOverride=1` is a measurement-only prototype that clears `CurrentFloor` and switches CMC to falling when the sampled post-edit density is air; it is inactive by default. The test counts false support, false air and downward velocity beyond one gravity step. `-voxel.TestDigMotionUnderfootDigCount` is clamped to 1–100; `-voxel.TestDigMotionUnderfootIntervalSeconds=0` performs per-frame rapid edits. The accompanying gap audit is scoped to the dig session. |
|
||||
| `MaybeFinishHeadlessStreamingTest` | — | The existing `voxel.TestExitSeconds` diagnostic emits `VoxelForgeStreamingExitDiag` at most every 30 elapsed seconds, including threshold and early-return test flags; no output when the timer is unconfigured. |
|
||||
| `UpdateVisualStalenessAudit` | 5034 | Test-only camera-frustum coverage audit: tracks up to 24 real pre-skirt isosurface points per visible component, then counts frames where no visible tile component covers a previously visible, still-desired point (excluding edited bounds). `voxel.TestVisualGapInjectEarlyHide=1` hides a valid component for three frames and must be caught. `voxel.TestGapAuditLegacyHandoff=1` restores old handoff culling for A/B baselines. |
|
||||
| `ProcessPendingChunks` | 7435 | Drains critical, edited, near, then ordinary result queues under the per-frame budget; reads the per-request cancellation token before removing its map entry, drops obsolete/aborted results, then applies each live result via `ApplyTileResult`. Collision profiling timestamps the result's arrival here to separate worker completion from game-thread apply wait. Step 1's `voxel.Step1PrequeueVisibleLOD0` holds completed results until the requested non-empty L0 count is ready, then releases them through this same drain and emits the `VFStep1UploadCorpusReleased` CSV event for UE's delayed CSV capture. |
|
||||
| `ProcessPendingChunks` | 7435 | Drains `CriticalProcessQueue`, `EditedProcessQueue`, `NearProcessQueue`, then `ProcessQueue`; applies under the authored 4-mesh/2 ms budget during normal play and the bounded shared startup budget (12 meshes/14 ms) until the initial desired set and walkable ring are ready. `voxel.StreamingStartupApplyBoost=0` restores the authored budget. `startup_apply_config` traces the actor-read CVar and both budgets; `startup_apply_budget` records activation/end. Reads per-request cancellation before removing its map entry, traces stale/obsolete/aborted discards with epoch and ordinal, then applies via `ApplyTileResult`. Step 1 prequeue still releases here and emits `VFStep1UploadCorpusReleased`. |
|
||||
| `ApplyTileResult` | — | **Shared game-thread apply** for one `FChunkResult` (async drain + sync carve): discards stale generation epochs and keys no longer desired, marks loaded, ingests capture, EMPTY releases the tile's existing component (a re-gen can flip content→empty on band change — old geometry must not linger), else `ApplyMeshToTile`. Returns true iff a visible mesh uploaded (counts the budget). Doesn't touch `PendingTiles` (caller's). |
|
||||
| `FVoxelStackSampler` / `FScopedVoxelStackRegistration` (`VoxelStackSampler.h/.cpp`) | — | **Diagnostic raw stack sampler, off by default.** A sampler thread captures registered generation workers' stacks (`CaptureThreadStackBackTrace`) every N µs and tags each with the tile's LOD. It writes bounded raw PCs to CSV plus a symbolization-free summary under `Saved/`; symbol resolution is deferred until after process exit so the measured process never initializes/calls DbgHelp for this diagnostic. Lifecycle teardown is serialized and registration TLS is session-tagged. Registration is per tile TASK in `LoadTile` (and the export's tasks), never per sample; disabled costs one relaxed atomic load. Game `-voxel.SampleStacks=<us>`, commandlet `-samplestacks[=us]`. |
|
||||
| Room-cache performance (2026-09-13): `VF_FindPlayerFitPointForRoomMemoized` / `GPlayerFitMemo` (`VoxelCaveMorphology.cpp`), `voxel.TileCacheWindow` + `VoxelGenLOD::TileOriginVoxels/TileCellsPerAxis` (`VoxelGenerator.h`), `FChunkSDFSpatialIndex` | — | **Player-fit memo:** exact 97-word key, process-wide, `voxel.PlayerFitMemo`. **Tile cache window:** the room cache covers the requesting tile's footprint plus a fixed collect margin. It is set via `TGuardValue` in `GenerateMesh`/classify, and is window-invariant by construction (the margin does not grow with the tile). **LOD-gated:** fused path at LOD ≥ `voxel.TileCacheWindowMinLOD` (3), op-stack at LOD ≥ `voxel.TileCacheWindowOpStackMinLOD` (4); lower LODs keep the 4-chunk worker window, because the tile window slowed LOD0 evaluation ~6%. Strates whose authored terrain ops exceed the proven 256-voxel extent (or are malformed/unloaded) fall back to the legacy window (`VF_ComputeTerrainOpEnvelope`). `voxel.SpatialIndex` is -1 auto (off at fused LOD0, on elsewhere), 0 or 1. **Spatial index:** ordered XY buckets over cache primitives, exact rejection. The `static_assert` in `VoxelStrateTypes.h` ties `VF_STRATE_PARAM_FIELDS` to `FStrateGenerationParams` (83 fields + 8 B padding). |
|
||||
@@ -367,7 +377,7 @@ casse cette arithmetique *structurellement* — `BeginPlay` loggue une **Error**
|
||||
| `RecordTileHash` / `WriteTileHashDump` | — | Headless `-voxel.TileHashDump=<absolute path>` parity instrument. Records the exact `FVoxelMeshData` used by the streaming result, including empty/classified tiles, then writes sorted absolute tile keys, LOD step/cells, content-band limits, settings digest context, and the shared `VoxelGeometryHash` at `EndPlay`. |
|
||||
| `SyncRemeshTile` | — | **INSTANT DIG**: level-0 same-frame re-mesh on the game thread. Uses `PreEditDensityCache` when the tile is resident in the bounded local cache, replays the current DiffLayer over that exact procedural lattice, then meshes/applies inline so a carve is visible THIS frame. A cache miss uses normal generation; it captures the unedited lattice if the tile needs meshing, while uniform-tile proofs remain enabled. |
|
||||
| `PreEditDensityCache` / `VoxelForgePreEditDensityCache::BuildEditedGrid` | — | Per-world cache of the pawn's current L0 tile: exact 35³ pre-edit samples, max **171,500 bytes**. It is pruned when the pawn crosses chunk boundaries and cleared on `RegenerateAllChunks`. `BuildEditedGrid` snapshots touched diff chunks once and reproduces `GetDensityAt`'s final `pre-edit - EvaluateMods` operation before the per-call shared-grid mesher path. |
|
||||
| `UpdateChunksAroundPosition` | 8603 | Builds desired set, cancels pending keys that left it, sorts from the **true pawn position**, submits the occupied/support LOD0 tile and the next tile along the pawn heading as an absolute `BackgroundHigh` prefix, then loads/unloads and handles LOD changes. **Delta cull**: `BuildDesiredTiles` returns the LEAVERS (stamped `DesiredStamped` map, one sweep) — only those + `TransitionHold` are considered per crossing, not every loaded tile. `BuildDesiredTiles` also applies `RenderDistanceChunks`: the outermost shell widens to cover the distance as level-MaxClipLevel MC tiles (`VF_OuterShell` shared with `IsTileInClipRange` so the cull sees the same horizon), dz pre-clamped to the vertical band. **§9.3 anchors:** also prunes dead `StreamingAnchors` + detects their chunk crossings → rebuilds the desired set when an anchor moves/(un)registers (`bAnchorsMoved`/`bForceDesiredRebuild`), same cadence as player movement. §8.10. |
|
||||
| `UpdateChunksAroundPosition` / `GetGenerationAdmissionCount` | 10990 / 10971 | Shared Core/legacy scheduler. Builds the desired set and delta-culls leavers; admits the occupied/support tile plus collision-required LOD0 tiles in the pawn's 3×3 XY ring as `CollisionCritical`. S5 coarse-first admission stays opt-in (`voxel.StreamingCoarseFirst=1`). `voxel.StreamingDynamicNearReserve=1` is now the default: it keeps the authored near reserve while moving or until the stationary walkable ring is ready, then makes those slots available to coarse work. Admission counts submitted queued/running tasks, not completed results waiting in the MPSC result queues; `voxel.StreamingLegacyPendingResultCap=1` restores the old `PendingTiles`-based cap for the negative control. `PendingTiles` still lasts through game-thread apply for duplicate suppression and result bookkeeping. The clipmap stays non-overlapping and load-before-unload / `TransitionHold` reconciliation remains authoritative. Standalone has no mirror of this actor scheduler. §8.10 + §8.26–8.28. |
|
||||
| `AdvanceHeadlessCollisionGateStressTest` / `ObserveHeadlessCollisionGateStressTest` / `MaybeFinishHeadlessCollisionGateStressTest` / `MeasureHeadlessCollisionGateStressTerrain` | — | Explicit `-voxel.TestCollisionGateStress=1` harness only. The normal spawn-height cvar offsets from the measured density surface; `voxel.TestCollisionGateStressDeepDrop=1` carves a process-local box shaft from above the top to just above the floor tile, extending along the post-landing route so the pawn does not run into the shaft sidewall, temporarily raises only the transient test DiffLayer brush-radius allowance for that fixture, removes only the local pawn's redundant streaming anchor for this isolated repro, proves every sample in two complete outside-ring level-0 tiles is air before seeding their known-empty status, prewarms the known-empty in-ring column, and asserts that the support walk reaches the in-layout floor outside the aligned level-0 render ring before the pawn drops. The log reports whether the fixed gate retains that otherwise out-of-ring target. Other streaming anchors remain active. The fixture rejects a target or floor outside the layout, a non-air empty-tile proof, or a floor inside the aligned level-0 ring. The `GetDensityAt` column at capsule feet defines the local air/solid surface; the deep-drop column crossing is cached after its first exact scan. Each frame records actor position, velocity, direct foot tile and gate support readiness, gate state, signed feet clearance, and a ≤0.5-voxel sweep between positions. PASS requires no measured clearance below −5 cm; deep-drop gate-on also requires horizontal travel during a hold. Result logs include the terminal density column, first crossing below spawn height, hold count/time, and gated horizontal progress. |
|
||||
| `BuildDesiredTiles` | 6482 | Builds `DesiredSorted`+`DesiredStamped` (player clipmap shells), then adds streaming anchors and the pending player's collision-only support column before the leaver sweep. It orders from the true local pawn position and builds `CriticalDesiredTiles` for the unresolved support target, occupied/support and heading tiles. Also rebuilds `DesiredTransitionDescendants` (ancestor → desired descendants, including face/edge-touching replacements) for the reconcile pass. |
|
||||
| `CollisionGateDesiredTiles` / `RequestCollisionGateSupportTile` | 5062 | Retains an unresolved support target and up to three level-0 tiles below it across desired-set rebuilds. The additional keys are hidden collision-only tiles, queued ahead of ordinary streaming, and pruned once resolved or outside the active column. |
|
||||
@@ -380,7 +390,8 @@ casse cette arithmetique *structurellement* — `BeginPlay` loggue une **Error**
|
||||
| `AddAnchorDesiredTiles` | — | **§9.3 multi-anchor:** folds each `FVoxelStreamingAnchor`'s thin level-0 box (`XYRadiusChunks`/`ZBelowChunks`/`ZAboveChunks`) into the SAME desired set and the independent collision set, so AI/remote players keep collision loaded around them; delta cull releases them on move/unregister. **§9.4:** a tile only a CollisionOnly anchor wants (clipmap didn't stamp it) → `CollisionOnlyTiles` → hidden at apply. Zero cost when no anchors. |
|
||||
| `ReconcileAnchorTileVisibility` | — | **§9.4:** after each rebuild, toggle `SetVisibility` on ALREADY-LOADED tiles that flipped render↔collision-only (diff `CollisionOnlyTiles` vs prev — bounded, no O(loaded) scan; unhide only if still desired). No-op without CollisionOnly anchors. |
|
||||
| `RegisterStreamingAnchor` / `UnregisterStreamingAnchor` | — | **BlueprintCallable §9.3:** add/remove an actor as a streaming anchor (`EVoxelAnchorPolicy` CollisionOnly/FullVisual + XY/ZBelow/ZAbove box). Idempotent; forces a rebuild next Tick. §9.4: CollisionOnly tiles cook collision but are hidden (no draw/VSM) unless the player clipmap wants them too. |
|
||||
| `LoadTile` | 9033 | Budget check → `UE::Tasks::Launch` background gen+mesh; RAII task guard. Worker runs `Generator->ClassifyTile` first (T1.d): AllSolid/AllAir ⇒ skip `GenerateMesh`, tile stays empty (capture tiles always generate). It carries `GenerationEpoch`/desired epoch and checks `bShuttingDown`, generation pause, and its read-only cancellation token between expensive stages; obsolete work returns through `ProcessQueue`. STRATE CONTENT CUT: tiles ≥ `StrateContentCutMinLevel` pass the player-strate band (`MeshBandChunkLo/Hi` → voxels) to `GenerateMesh` + stamp it on `FChunkResult::BandChunkLo/Hi`; band change re-queues via `BandRemeshQueue` (see `UpdateChunksAroundPosition`). `voxel.TestFullResClipLevels` is a measurement-only runtime override; default -1 uses the authored setting. TOO-COARSE SKIP: if one cell is taller than the band (`Step > band height` — level ≥7 territory) the tile is enqueued EMPTY without launching a task (cell-granular cut could only render garbage). §8.10. |
|
||||
| `LoadTile` / `LoadCoreTile` | 9033 / 11633 | Budget check → background generation; RAII task guard. Both paths preserve `Epoch`, desired/modification epochs, cancellation state and MPSC result routing. Requests receive a monotonic request ordinal; workers assign a generation-start ordinal. `VoxelStartupTrace` joins those with priority, resident-at-request, queue wait, worker build, result wait, apply time and discard reason. Legacy `LoadTile` retains its classify/mesh and strate-band behavior; Core delegates to the resolved immutable snapshot. `EndPlay` still drains workers/results. §8.10. |
|
||||
| `VoxelStartupTrace::RecordRequest` / `RecordTile` | — | Opt-in JSONL via `-voxel.StartupTraceFile=...`; `-voxel.StartupTraceUntilEndPlay=1` keeps tracing through movement, otherwise it stops at initial settle. Each request is keyed by epoch and ordinal; applied tile records add worker-start order, priority, queue/build/apply timings. Discard events identify stale epoch, obsolete, no-longer-desired and aborted results. |
|
||||
| `UnloadTile` | — | Clears tile state; marks any matching generation request obsolete without removing its pending slot, so a late result cannot clear a replacement request; the component is PARKED in the pool (T2.c), not destroyed. |
|
||||
| `ApplyMeshToTile` | 9838 | Upload geometry. One component per tile (clipmap keeps count low; supersedes the old region batching); worker-built streams (T1.f) → `CreateSectionGroup(MoveTemp)`. Reuses the component's existing `URealtimeMesh` (no per-apply mesh alloc). **F17: two polygroups** (0 ground / 1 sky-cap, per-triangle class from the mesher) → RMC auto-section per non-empty group; slot 0 = override/default material, slot 1 = `CeilingMaterial` (fallback ground); config gated by `FChunkResult::bHasGroundTris/bHasCeilingTris`. Takes `FChunkResult&`; strate lookups clamp Z into `Result.BandChunkLo/Hi` (strate content cut) — ground at clamped bottom chunk, cap at clamped top (mid = gap fallback). Collision level-0 only (T1.c) both groups; shadow per SECTION: ground casts at level≤1, cap never. Ordinary same-tile re-cooks retain the installed body while it is valid. A carve intersecting the pawn's current support tile and capsule bounds suppresses that old body until the replacement cook is installed. `voxel.ProfileCollisionCookStages` reports generation/apply waits, combined RMC time, completion hops, triangle/skirt counts and collision settings. With `voxel.Step1PrequeueVisibleLOD0>0`, logs apply frame and waits for `GetLastRenderTime` to advance for first-visible frame; `voxel.Step1UploadDisableCollision=1` isolates render upload. Routes each terrain base through shared MIDs; disabled volume MIDs bind neutral `VolP*` and null `VolTex*`. **§9.4:** `SetVisibility(false)` when the tile is in `CollisionOnlyTiles` (anchor-only, hidden — collision still cooks). §8.10 + ARCHITECTURE SurfaceWorld row. |
|
||||
| `HandleRealtimeMeshCollisionBodyUpdated` / `HandleTileCollisionCookComplete` / `PollStep1SupportSweepProbes` | 6964 / 7192 / — | Correlate RMC body-install event and collision-future completion. `voxel.ProfileCollisionCookStages=1` logs worker queue/gen, result wait, apply/upload/config submission, RMC submit→body update, body event→future, future→game-thread hop, submit frames, pending VoxelForge cooks, priority, collision flags, and triangle/skirt totals; it also reports mesh-generation-end→ready. `voxel.Step1CollisionProbe=1` sweeps the pawn capsule against the exact component pointer, logs both the first hit and whether it is the target body, and checks every body in the captured support cohort. RMC's end-frame dequeue, async worker start, geometry extraction and core cook remain inside the external plugin and are not individually timestampable from this module. |
|
||||
@@ -992,6 +1003,98 @@ exact-density-root LOD7/8 agreement audit with its datum-offset negative control
|
||||
ARCHITECTURE §8.25 and
|
||||
[`Standalone/Research/WorldAssemblerM3/Round8/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round8/REPORT.md).
|
||||
|
||||
### 3.14 Cold streaming admission and apply trace — World Assembler S7 / M3 Round 11
|
||||
|
||||
`AVoxelWorld::UpdateChunksAroundPosition` writes a `scheduler_admission` record on each submission
|
||||
pass, plus `scheduler_skip` for core-readiness bypasses and all-loaded latches that still have missing
|
||||
work. The admission record includes desired/missing/pending keys by LOD, task caps, submitted attempts,
|
||||
stop level, decline reason, `bCoreRegionCompilePending`, pending-result estimate, and cumulative
|
||||
worker-task time. Rule codes are 1=full task cap, 2=near reserve, 3=all-loaded latch, 4=inner
|
||||
`LoadTile`/`LoadCoreTile` rejection, and 5=desired work still missing with apparent capacity.
|
||||
This is the trace used to separate the
|
||||
old near-reserve stop from completed-but-unapplied results counted as active. The default admission
|
||||
count uses queued/running `ActiveTaskCount`; `voxel.StreamingLegacyPendingResultCap=1` restores the
|
||||
old pending-result cap. The negative-control harness sets that together with
|
||||
`voxel.StreamingDynamicNearReserve=0`. `ProcessPendingChunks` still records result draining,
|
||||
visible-mesh applies, per-LOD counts and budget use; direct `tile` events separate worker queue,
|
||||
task time, result queue and game-thread apply. `collision_ready` records RealtimeMesh submit-to-body
|
||||
update latency. The per-frame `running_workers` sample aliases short task bursts, so use the
|
||||
cumulative task intervals for worker-seconds. `VoxelForgeExploreCommandlet.cpp` drives the staged
|
||||
owner-plan trace and moving actor check. See ARCHITECTURE §8.27–8.28 and
|
||||
[`Standalone/Research/WorldAssemblerM3/Round11/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round11/REPORT.md).
|
||||
|
||||
### 3.15 Moving region admission and result-backlog safety trace — World Assembler S8 / M3 Round 12
|
||||
|
||||
`core_region_compile_request/start/complete` record why the desired region is being built (initial
|
||||
set, player-center move, or same-center desired-set change), center delta, pending tiles, compile wall
|
||||
time, accumulated pending interval, independent submissions and dependent-key declines. While a
|
||||
compile is pending, `scheduler_skip.reason=core_region_compile_pending` records per-LOD missing
|
||||
counts, motion and speed. The default concurrent mode should have no global region-pending skip;
|
||||
its negative control is `voxel.CoreRegionConcurrentAdmission=0`.
|
||||
|
||||
`walkable_gate` logs every support-center change and whether all nine required LOD0 collision tiles
|
||||
are ready there. `result_queue_frame` samples queued results, payload bytes, active tile tasks and
|
||||
the cap; `result_queue_summary` stores peak queue length/bytes and admission stops. These counters
|
||||
include slow-apply, teleport and high-speed controls added to `VoxelForgeExploreCommandlet.cpp` and
|
||||
`Tools/TestVoxelForgeCoreWorldHost.ps1`. Keep the cap negative control (`voxel.StreamingResultBacklogCap=0`)
|
||||
separate from the region-gate control. Round12 found 11/11 ready support centers at 6 m/s and 8/113
|
||||
immediately ready at 60 m/s with a 400 m teleport; see the traces under `Saved/BuildHost` and
|
||||
[`Standalone/Research/WorldAssemblerM3/Round12/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round12/REPORT.md).
|
||||
|
||||
### 3.16 Velocity-scaled support-ring lookahead — World Assembler S9 / M3 Round 13
|
||||
|
||||
`voxel.StreamingCollisionLookahead` defaults on; `0` is the negative control. The shared
|
||||
`GetStreamingHeadingStep` uses actor-local motion, including vertical speed. The support tile from
|
||||
`GetPlayerSupportTile` is the reference for both the active 3x3 critical ring and up to two future
|
||||
3x3 rings. `GetStreamingCollisionLookaheadTiles` aims 350 ms ahead, rounded up to whole LOD0 tiles
|
||||
and capped at two. Prediction only promotes keys already inside the desired clipmap. The
|
||||
`collision_lookahead` trace records stream/support centers, direction, speed, ring count and any
|
||||
missing desired keys. `VoxelForgeExploreCommandlet.cpp` and `Tools/TestVoxelForgeCoreWorldHost.ps1`
|
||||
accept a movement vector so the same trace covers horizontal and vertical travel. See ARCHITECTURE
|
||||
§8.30 and [`Standalone/Research/WorldAssemblerM3/Round13/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round13/REPORT.md).
|
||||
|
||||
### 3.17 LOD8 planar far-horizon sampling — World Assembler S10 / M3 Round 14
|
||||
|
||||
Native planar SurfaceWorld horizon refinement uses the LOD8 marching-cubes step for its interior
|
||||
grid (512 voxels / 128 m at 25 cm), retaining globally aligned 128-voxel boundary strips for tile
|
||||
and LOD joins. LOD4–LOD7 keep their previous grids. Far recipe version 3 salts changed LOD4–LOD8
|
||||
mesh outputs; density and LOD0–LOD3 output are unchanged. The ground and cap passes use the same
|
||||
coordinate lattice but still sample separately. The per-thread column cache remains local to each
|
||||
worker; no cross-worker page cache was added. Diagnostics report exclusive column, MC, ground,
|
||||
cap and output-assembly costs, plus opt-in duplicated LOD8 XY evaluations. The Standalone-only
|
||||
`--far-horizon-lod8-step=128` restores S9 sampling for the negative control. See ARCHITECTURE §8.31
|
||||
and [`Standalone/Research/WorldAssemblerM3/Round14/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round14/REPORT.md).
|
||||
|
||||
### 3.18 Streaming worker supply and ready queue — World Assembler S12 / M3 Round 16
|
||||
|
||||
`AVoxelWorld::LoadTile` and `LoadCoreTile` retain the existing `UE::Tasks::Launch` background
|
||||
priorities (`BackgroundHigh` for near work, `BackgroundNormal` for horizon work). The shared
|
||||
scheduler now sizes streaming admission to the TaskGraph background worker count by default
|
||||
(`voxel.StreamingBackgroundWorkerCap=1`) and admits a bounded ready queue of up to one worker-set
|
||||
(`voxel.StreamingReadyQueueDepth=8` on the 8-background-worker host). This lets UE dispatch the next
|
||||
already-admitted task as a worker becomes free without waiting for the next actor tick. Setting the
|
||||
worker cap to `0` restores the prior logical-core cap; setting queue depth to `0` restores one-slot-per
|
||||
worker admission. The moving near reserve grows with the ready queue, coarse/horizon work remains
|
||||
under its separate cap, and moving LOD0 admission is limited to the actual worker slots so far work
|
||||
cannot occupy reserved headroom. `bStreamingPlayerMoving` is a game-thread scheduler snapshot used
|
||||
by both admission helpers. `worker_backend_config`, `streaming_worker_cap_readback`, and
|
||||
`scheduler_admission` record the pool counts and effective CVar values. Per-tile trace rows record
|
||||
submit/start/end times and the OS worker thread ID. No tile generation, mesh, density, collision, or
|
||||
Core recipe output changes; recipe versions remain unchanged. See ARCHITECTURE §8.33 and
|
||||
[`Standalone/Research/WorldAssemblerM3/Round16/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round16/REPORT.md).
|
||||
|
||||
### 3.19 Exclusive tile cost and all-LOD column overlap — World Assembler S13 / M3 Round 17
|
||||
|
||||
`VoxelForgeCore::TileGenerationStats` now exposes classification-exclusive time and the column
|
||||
evaluation performed during marching cubes, ground refinement, and cap refinement. The BuildHost
|
||||
shared-feature audit reports these p95 stages and per-density-sample costs for owner SurfaceWorld
|
||||
tiles at LOD0, 1, 3, 4, 5, and 8. Standalone `--profile-column-overlap` opts into XY miss-coordinate
|
||||
capture for all LODs and reports repeated evaluations across same-LOD tiles and workers; the older
|
||||
`--profile-far-column-overlap` spelling remains an alias. `--profile-column-overlap` changes no
|
||||
generation output. Measurement-only stride and octave probes are confined to the shared-feature
|
||||
audit and are not runtime controls. The result and limits are recorded in
|
||||
[`Standalone/Research/WorldAssemblerM3/Round17/REPORT.md`](Standalone/Research/WorldAssemblerM3/Round17/REPORT.md).
|
||||
|
||||
## 4. The density pipeline (most-edited hot path)
|
||||
|
||||
### 4.1 `GetDensityWithParams` (TunnelNetwork) — VoxelGenerator.cpp:3749
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "Misc/CommandLine.h"
|
||||
#include "Misc/Parse.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace VoxelForgeStartupTrace
|
||||
{
|
||||
namespace
|
||||
@@ -18,6 +20,7 @@ namespace
|
||||
int32 TileRecordsSeen = 0;
|
||||
int32 TileRecordsWritten = 0;
|
||||
int32 TileRecordsSuppressed = 0;
|
||||
int32 ApplyFrameRecords = 0;
|
||||
TArray<FTileSample> Samples;
|
||||
TMap<FString, double> StageStarts;
|
||||
TMap<FString, double> StageTotals;
|
||||
@@ -27,6 +30,7 @@ namespace
|
||||
|
||||
FCriticalSection GTraceLock;
|
||||
TUniquePtr<FState> GState;
|
||||
std::atomic<bool> GTraceActive{false};
|
||||
|
||||
FString JsonEscape(const FString& In)
|
||||
{
|
||||
@@ -49,9 +53,8 @@ namespace
|
||||
const FString WithNewline = Line + TEXT("\n");
|
||||
FTCHARToUTF8 Utf8(*WithNewline);
|
||||
State.Archive->Serialize(const_cast<ANSICHAR*>(Utf8.Get()), Utf8.Length());
|
||||
// The trace is intended to remain readable if a harness terminates the editor after
|
||||
// the steady-state record. This is bounded I/O (startup only), not the shared UE log.
|
||||
State.Archive->Flush();
|
||||
// The file archive buffers records; flushing every tile/request can stall the game thread.
|
||||
// L'archive tamponne les lignes ; vider apres chaque tuile/requete peut bloquer le thread de jeu.
|
||||
}
|
||||
|
||||
void WriteEventLocked(FState& State, const TCHAR* Type, const FString& FieldsJson)
|
||||
@@ -92,7 +95,7 @@ namespace
|
||||
|
||||
FString BuildTileGroupJson(const TArray<FTileSample>& Samples, int32 Level)
|
||||
{
|
||||
TArray<double> Request, Queue, Generation, Classify, Mesh, Apply;
|
||||
TArray<double> Request, Queue, WorkerTask, Generation, Classify, Mesh, Apply;
|
||||
int32 Count = 0;
|
||||
int32 Empty = 0;
|
||||
int32 AllAir = 0;
|
||||
@@ -115,6 +118,7 @@ namespace
|
||||
GeometryBytes += Sample.GeometryBytes;
|
||||
Request.Add(Sample.RequestToApplySeconds);
|
||||
Queue.Add(Sample.QueueWaitSeconds);
|
||||
WorkerTask.Add(Sample.WorkerTaskSeconds);
|
||||
Generation.Add(Sample.GenerationSeconds);
|
||||
Classify.Add(Sample.ClassifySeconds);
|
||||
Mesh.Add(Sample.MeshSeconds);
|
||||
@@ -125,6 +129,7 @@ namespace
|
||||
TEXT("{\"count\":%d,\"empty\":%d,\"all_air\":%d,\"all_solid\":%d,\"mixed\":%d,\"vertices\":%lld,\"triangles\":%lld,\"geometry_bytes\":%llu,"
|
||||
"\"request_apply_s\":{\"p50\":%s,\"p95\":%s,\"max\":%s},"
|
||||
"\"queue_s\":{\"p50\":%s,\"p95\":%s,\"max\":%s},"
|
||||
"\"worker_task_s\":{\"p50\":%s,\"p95\":%s,\"max\":%s},"
|
||||
"\"generation_s\":{\"p50\":%s,\"p95\":%s,\"max\":%s},"
|
||||
"\"classify_s\":{\"p50\":%s,\"p95\":%s,\"max\":%s},"
|
||||
"\"mesh_s\":{\"p50\":%s,\"p95\":%s,\"max\":%s},"
|
||||
@@ -134,6 +139,7 @@ namespace
|
||||
static_cast<unsigned long long>(GeometryBytes),
|
||||
*Number(Percentile(Request, 0.50)), *Number(Percentile(Request, 0.95)), *Number(Maximum(Request)),
|
||||
*Number(Percentile(Queue, 0.50)), *Number(Percentile(Queue, 0.95)), *Number(Maximum(Queue)),
|
||||
*Number(Percentile(WorkerTask, 0.50)), *Number(Percentile(WorkerTask, 0.95)), *Number(Maximum(WorkerTask)),
|
||||
*Number(Percentile(Generation, 0.50)), *Number(Percentile(Generation, 0.95)), *Number(Maximum(Generation)),
|
||||
*Number(Percentile(Classify, 0.50)), *Number(Percentile(Classify, 0.95)), *Number(Maximum(Classify)),
|
||||
*Number(Percentile(Mesh, 0.50)), *Number(Percentile(Mesh, 0.95)), *Number(Maximum(Mesh)),
|
||||
@@ -171,11 +177,12 @@ namespace
|
||||
return FString::Printf(
|
||||
TEXT("\"reason\":\"%s\",\"wall_s\":%s,\"tile_records_seen\":%d,"
|
||||
"\"tile_records_written\":%d,\"tile_records_suppressed\":%d,"
|
||||
"\"tile_record_cap\":%d,\"stage_seconds\":%s,\"tile_percentiles\":{%s}"),
|
||||
"\"tile_record_cap\":%d,\"apply_frame_records\":%d,"
|
||||
"\"stage_seconds\":%s,\"tile_percentiles\":{%s}"),
|
||||
*JsonEscape(Reason ? FString(Reason) : FString(TEXT("unknown"))),
|
||||
*Number(FPlatformTime::Seconds() - State.StartSeconds),
|
||||
State.TileRecordsSeen, State.TileRecordsWritten, State.TileRecordsSuppressed,
|
||||
State.TileRecordCap, *Stages, *Groups);
|
||||
State.TileRecordCap, State.ApplyFrameRecords, *Stages, *Groups);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,6 +210,7 @@ void BeginFromCommandLine()
|
||||
NewState->StartSeconds = FPlatformTime::Seconds();
|
||||
NewState->bActive = true;
|
||||
GState = MoveTemp(NewState);
|
||||
GTraceActive.store(true, std::memory_order_release);
|
||||
WriteEventLocked(*GState, TEXT("header"), FString::Printf(
|
||||
TEXT("\"schema\":1,\"path\":\"%s\",\"tile_record_cap\":%d"),
|
||||
*JsonEscape(GState->Path), GState->TileRecordCap));
|
||||
@@ -210,8 +218,7 @@ void BeginFromCommandLine()
|
||||
|
||||
bool IsActive()
|
||||
{
|
||||
FScopeLock Lock(>raceLock);
|
||||
return GState.IsValid() && GState->bActive;
|
||||
return GTraceActive.load(std::memory_order_acquire);
|
||||
}
|
||||
|
||||
void RecordEvent(const TCHAR* Type, const FString& FieldsJson)
|
||||
@@ -221,6 +228,18 @@ void RecordEvent(const TCHAR* Type, const FString& FieldsJson)
|
||||
WriteEventLocked(*GState, Type, FieldsJson);
|
||||
}
|
||||
|
||||
void RecordRequest(const FTileSample& Sample, uint32 Epoch)
|
||||
{
|
||||
FScopeLock Lock(>raceLock);
|
||||
if (!GState.IsValid() || !GState->bActive) return;
|
||||
WriteEventLocked(*GState, TEXT("request"), FString::Printf(
|
||||
TEXT("\"tile\":[%d,%d,%d],\"level\":%d,\"priority\":%d,"
|
||||
"\"request_ordinal\":%llu,\"epoch\":%u,\"resident_at_request\":%d"),
|
||||
Sample.TileX, Sample.TileY, Sample.TileZ, Sample.Level, Sample.WorkPriority,
|
||||
static_cast<unsigned long long>(Sample.RequestOrdinal), Epoch,
|
||||
Sample.bResidentAtRequest ? 1 : 0));
|
||||
}
|
||||
|
||||
void StageBegin(const TCHAR* Name)
|
||||
{
|
||||
if (Name == nullptr) return;
|
||||
@@ -265,24 +284,92 @@ void RecordTile(const FTileSample& Sample)
|
||||
|
||||
GState->Samples.Add(Sample);
|
||||
++GState->TileRecordsWritten;
|
||||
const double TraceNowSeconds = FPlatformTime::Seconds() - GState->StartSeconds;
|
||||
const double SubmittedAtSeconds = Sample.RequestStartCycles != 0
|
||||
? TraceNowSeconds - Sample.RequestToApplySeconds : -1.0;
|
||||
const double WorkerStartedAtSeconds = Sample.WorkerTaskStartCycles != 0
|
||||
? SubmittedAtSeconds + Sample.WorkerQueueSeconds : -1.0;
|
||||
const double WorkerEndedAtSeconds = Sample.WorkerTaskEndCycles != 0
|
||||
? WorkerStartedAtSeconds + Sample.WorkerTaskSeconds : -1.0;
|
||||
WriteEventLocked(*GState, TEXT("tile"), FString::Printf(
|
||||
TEXT("\"tile\":[%d,%d,%d],\"level\":%d,\"verdict\":%d,\"proof\":%d,\"empty\":%d,\"vertices\":%d,\"triangles\":%d,\"geometry_bytes\":%llu,"
|
||||
"\"request_to_apply_s\":%s,\"queue_wait_s\":%s,\"worker_queue_s\":%s,\"result_queue_s\":%s,"
|
||||
TEXT("\"tile\":[%d,%d,%d],\"level\":%d,\"priority\":%d,"
|
||||
"\"request_ordinal\":%llu,\"generation_ordinal\":%llu,\"resident_at_request\":%d,"
|
||||
"\"submitted_t_s\":%s,\"worker_start_t_s\":%s,\"worker_end_t_s\":%s,\"worker_thread_id\":%u,"
|
||||
"\"verdict\":%d,\"proof\":%d,\"empty\":%d,\"vertices\":%d,\"triangles\":%d,\"geometry_bytes\":%llu,"
|
||||
"\"request_to_apply_s\":%s,\"queue_wait_s\":%s,\"worker_queue_s\":%s,\"result_queue_s\":%s,\"worker_task_s\":%s,"
|
||||
"\"generation_s\":%s,\"classify_s\":%s,\"mesh_s\":%s,\"stream_s\":%s,\"apply_s\":%s"),
|
||||
Sample.TileX, Sample.TileY, Sample.TileZ,
|
||||
Sample.Level, Sample.Verdict, Sample.bSealedSolidProof ? 1 : 0,
|
||||
Sample.Level, Sample.WorkPriority,
|
||||
static_cast<unsigned long long>(Sample.RequestOrdinal),
|
||||
static_cast<unsigned long long>(Sample.GenerationOrdinal),
|
||||
Sample.bResidentAtRequest ? 1 : 0,
|
||||
*Number(SubmittedAtSeconds),
|
||||
*Number(WorkerStartedAtSeconds),
|
||||
*Number(WorkerEndedAtSeconds),
|
||||
Sample.WorkerThreadId,
|
||||
Sample.Verdict, Sample.bSealedSolidProof ? 1 : 0,
|
||||
Sample.bEmpty ? 1 : 0, Sample.Vertices, Sample.Triangles,
|
||||
static_cast<unsigned long long>(Sample.GeometryBytes),
|
||||
*Number(Sample.RequestToApplySeconds), *Number(Sample.QueueWaitSeconds),
|
||||
*Number(Sample.WorkerQueueSeconds), *Number(Sample.ResultQueueSeconds),
|
||||
*Number(Sample.WorkerTaskSeconds),
|
||||
*Number(Sample.GenerationSeconds), *Number(Sample.ClassifySeconds),
|
||||
*Number(Sample.MeshSeconds), *Number(Sample.StreamSeconds), *Number(Sample.ApplySeconds)));
|
||||
}
|
||||
|
||||
void RecordApplyFrame(const FApplyFrameSample& Sample)
|
||||
{
|
||||
FScopeLock Lock(>raceLock);
|
||||
if (!GState.IsValid() || !GState->bActive) return;
|
||||
|
||||
FString PendingByLevel = TEXT("[");
|
||||
FString ApplyResultsByLevel = TEXT("[");
|
||||
FString MeshesByLevel = TEXT("[");
|
||||
FString ApplyMillisecondsByLevel = TEXT("[");
|
||||
for (int32 Level = 0; Level < 9; ++Level)
|
||||
{
|
||||
if (Level > 0)
|
||||
{
|
||||
PendingByLevel += TEXT(",");
|
||||
ApplyResultsByLevel += TEXT(",");
|
||||
MeshesByLevel += TEXT(",");
|
||||
ApplyMillisecondsByLevel += TEXT(",");
|
||||
}
|
||||
PendingByLevel += FString::FromInt(Sample.PendingByLevel[Level]);
|
||||
ApplyResultsByLevel += FString::FromInt(Sample.ApplyResultsByLevel[Level]);
|
||||
MeshesByLevel += FString::FromInt(Sample.MeshesAppliedByLevel[Level]);
|
||||
ApplyMillisecondsByLevel += Number(Sample.ApplySecondsByLevel[Level] * 1000.0);
|
||||
}
|
||||
PendingByLevel += TEXT("]");
|
||||
ApplyResultsByLevel += TEXT("]");
|
||||
MeshesByLevel += TEXT("]");
|
||||
ApplyMillisecondsByLevel += TEXT("]");
|
||||
|
||||
++GState->ApplyFrameRecords;
|
||||
WriteEventLocked(*GState, TEXT("apply_frame"), FString::Printf(
|
||||
TEXT("\"frame\":%llu,\"frame_ms\":%s,\"speed_cm_s\":%s,\"apply_ms\":%s,\"drain_ms\":%s,"
|
||||
"\"active_tasks\":%d,\"running_workers\":%d,\"task_cap\":%d,"
|
||||
"\"pending_tiles\":%d,\"pending_results_estimate\":%d,"
|
||||
"\"results_drained\":%d,\"apply_results\":%d,\"meshes_applied\":%d,\"max_applies\":%d,"
|
||||
"\"apply_budget_ms\":%s,\"count_limit_reached\":%d,\"time_limit_reached\":%d,"
|
||||
"\"pending_by_lod\":%s,\"apply_results_by_lod\":%s,"
|
||||
"\"meshes_by_lod\":%s,\"apply_ms_by_lod\":%s"),
|
||||
static_cast<unsigned long long>(Sample.Frame),
|
||||
*Number(Sample.FrameSeconds * 1000.0), *Number(Sample.SpeedCmPerSecond),
|
||||
*Number(Sample.ApplySeconds * 1000.0), *Number(Sample.DrainSeconds * 1000.0), Sample.ActiveTasks,
|
||||
Sample.RunningWorkerTasks, Sample.TaskCap, Sample.PendingTiles,
|
||||
Sample.PendingResultsEstimate, Sample.ResultsDrained, Sample.ApplyResultsByLevelTotal,
|
||||
Sample.MeshesApplied,
|
||||
Sample.MaxApplies, *Number(Sample.ApplyBudgetMilliseconds),
|
||||
Sample.bCountLimitReached ? 1 : 0, Sample.bTimeLimitReached ? 1 : 0,
|
||||
*PendingByLevel, *ApplyResultsByLevel, *MeshesByLevel, *ApplyMillisecondsByLevel));
|
||||
}
|
||||
|
||||
void Finish(const TCHAR* Reason)
|
||||
{
|
||||
FScopeLock Lock(>raceLock);
|
||||
if (!GState.IsValid() || !GState->bActive) return;
|
||||
GTraceActive.store(false, std::memory_order_release);
|
||||
|
||||
// Close any stage left open by an abnormal early exit so the summary remains useful.
|
||||
const double Now = FPlatformTime::Seconds();
|
||||
|
||||
@@ -13,7 +13,15 @@ namespace VoxelForgeStartupTrace
|
||||
int32 TileY = 0;
|
||||
int32 TileZ = 0;
|
||||
int32 Level = -1;
|
||||
int32 WorkPriority = 0;
|
||||
int32 Verdict = -1; // Mixed=0, AllSolid=1, AllAir=2, -1=not classified (early path)
|
||||
uint64 RequestOrdinal = 0;
|
||||
uint64 GenerationOrdinal = 0;
|
||||
uint64 RequestStartCycles = 0;
|
||||
uint64 WorkerTaskStartCycles = 0;
|
||||
uint64 WorkerTaskEndCycles = 0;
|
||||
uint32 WorkerThreadId = 0;
|
||||
bool bResidentAtRequest = false;
|
||||
bool bSealedSolidProof = false;
|
||||
bool bEmpty = true;
|
||||
int32 Vertices = 0;
|
||||
@@ -25,6 +33,7 @@ namespace VoxelForgeStartupTrace
|
||||
double QueueWaitSeconds = 0.0;
|
||||
double WorkerQueueSeconds = 0.0;
|
||||
double ResultQueueSeconds = 0.0;
|
||||
double WorkerTaskSeconds = 0.0;
|
||||
double GenerationSeconds = 0.0;
|
||||
double ClassifySeconds = 0.0;
|
||||
double MeshSeconds = 0.0;
|
||||
@@ -32,6 +41,31 @@ namespace VoxelForgeStartupTrace
|
||||
double ApplySeconds = 0.0;
|
||||
};
|
||||
|
||||
struct VOXELFORGE_API FApplyFrameSample
|
||||
{
|
||||
uint64 Frame = 0;
|
||||
double FrameSeconds = 0.0;
|
||||
double SpeedCmPerSecond = 0.0;
|
||||
double ApplySeconds = 0.0;
|
||||
double DrainSeconds = 0.0;
|
||||
int32 ActiveTasks = 0;
|
||||
int32 RunningWorkerTasks = 0;
|
||||
int32 TaskCap = 0;
|
||||
int32 PendingTiles = 0;
|
||||
int32 PendingResultsEstimate = 0;
|
||||
int32 ResultsDrained = 0;
|
||||
int32 ApplyResultsByLevelTotal = 0;
|
||||
int32 MeshesApplied = 0;
|
||||
int32 MaxApplies = 0;
|
||||
double ApplyBudgetMilliseconds = 0.0;
|
||||
bool bCountLimitReached = false;
|
||||
bool bTimeLimitReached = false;
|
||||
TStaticArray<int32, 9> PendingByLevel{};
|
||||
TStaticArray<int32, 9> ApplyResultsByLevel{};
|
||||
TStaticArray<int32, 9> MeshesAppliedByLevel{};
|
||||
TStaticArray<double, 9> ApplySecondsByLevel{};
|
||||
};
|
||||
|
||||
/** Starts when -voxel.StartupTraceFile=<absolute path> is present. */
|
||||
VOXELFORGE_API void BeginFromCommandLine();
|
||||
|
||||
@@ -40,11 +74,17 @@ namespace VoxelForgeStartupTrace
|
||||
/** FieldsJson is the contents after the type/timestamp object prefix, without braces. */
|
||||
VOXELFORGE_API void RecordEvent(const TCHAR* Type, const FString& FieldsJson = FString());
|
||||
|
||||
VOXELFORGE_API void RecordRequest(const FTileSample& Sample, uint32 Epoch);
|
||||
|
||||
VOXELFORGE_API void StageBegin(const TCHAR* Name);
|
||||
VOXELFORGE_API void StageEnd(const TCHAR* Name);
|
||||
|
||||
VOXELFORGE_API void RecordTile(const FTileSample& Sample);
|
||||
|
||||
/** One game-thread result-drain sample, including worker occupancy and per-LOD applies. */
|
||||
/** Echantillon de vidage des resultats, avec occupation des travailleurs et applications par LOD. */
|
||||
VOXELFORGE_API void RecordApplyFrame(const FApplyFrameSample& Sample);
|
||||
|
||||
/** Writes the final bounded summary and closes the file. Safe to call more than once. */
|
||||
VOXELFORGE_API void Finish(const TCHAR* Reason);
|
||||
|
||||
|
||||
@@ -132,6 +132,14 @@ struct FChunkResult
|
||||
// opt-in profile. It is carried through the worker queue so the report can separate scheduler
|
||||
// wait from generation time.
|
||||
uint64 RequestStartCycles = 0;
|
||||
// Full background-task boundaries include stream conversion and result packaging around the
|
||||
// generator call; they let the trace reconcile per-tile worker-seconds with worker occupancy.
|
||||
// Les bornes de tâche incluent la conversion et la préparation du résultat autour du générateur.
|
||||
uint64 WorkerTaskStartCycles = 0;
|
||||
uint64 WorkerTaskEndCycles = 0;
|
||||
// Operating-system thread id identifies the physical worker slot used by this tile.
|
||||
// L'identifiant du thread systeme repere le slot worker utilise par cette tuile.
|
||||
uint32 WorkerThreadId = 0;
|
||||
// Worker timing boundaries for separating scheduler wait from generation and result/apply wait.
|
||||
// These are captured with low overhead for the clean streaming-latency summary; expensive
|
||||
// per-tile profiling remains opt-in.
|
||||
@@ -139,6 +147,11 @@ struct FChunkResult
|
||||
uint64 GenerationEndCycles = 0;
|
||||
uint64 ApplyStartCycles = 0;
|
||||
EVoxelTileWorkPriority WorkPriority = EVoxelTileWorkPriority::Horizon;
|
||||
// Ordinals make admitted order and actual worker start order auditable across MPSC results.
|
||||
// Les numeros d'ordre rendent auditables l'admission et le demarrage des workers via MPSC.
|
||||
uint64 RequestOrdinal = 0;
|
||||
uint64 GenerationOrdinal = 0;
|
||||
bool bResidentAtRequest = false;
|
||||
// Step-1-only tag captured on the game thread for the pawn's bounded support cohort.
|
||||
bool bStep1SupportCohort = false;
|
||||
int32 ClassifyVerdict = -1; double ClassifySeconds = 0.0; double MeshSeconds = 0.0; double StreamSeconds = 0.0; int32 NumTriangles = 0; int32 NumCeilingTriangles = 0; int32 NumSkirtTriangles = 0;
|
||||
@@ -433,7 +446,13 @@ public:
|
||||
* capped to (logical cores − 2) so small CPUs don't thrash on a flat 16 (background
|
||||
* priority stops frame starvation, not the context-switch overhead). */
|
||||
int32 GetMaxConcurrentTasks() const;
|
||||
int32 GetMaxConcurrentStreamingTasks() const;
|
||||
/** Submitted generation tasks still queued or running; completed MPSC results do not occupy admission.
|
||||
* Taches de generation soumises, en file ou en cours ; les resultats MPSC termines ne bloquent pas l'admission. */
|
||||
int32 GetActiveGenerationTaskCount() const;
|
||||
/** Count queued/running work for admission; the legacy CVar can include finished results awaiting apply.
|
||||
* Compter le travail en file/en cours ; le CVar de compatibilite peut inclure les resultats finis en attente. */
|
||||
int32 GetGenerationAdmissionCount() const;
|
||||
/** Reserve task slots for collision-critical/edit/LOD0 work; far work uses the remainder. */
|
||||
int32 GetNearTaskReserve(int32 MaxTasks) const;
|
||||
|
||||
@@ -687,8 +706,17 @@ private:
|
||||
void BuildCoreDesiredTiles(const FIntVector& Center, const FVector& PlayerPosition,
|
||||
APawn* PlayerPawn, const FVector& PlayerHeading,
|
||||
TArray<FVoxelTileKey>& OutLeavers);
|
||||
FIntVector GetStreamingHeadingStep(const FVector& PlayerHeading,
|
||||
const APawn* PlayerPawn) const;
|
||||
int32 GetStreamingCollisionLookaheadTiles(const FVector& PlayerHeading,
|
||||
const FIntVector& HeadingStep) const;
|
||||
void StartPendingCoreRegionCompile();
|
||||
void LoadCoreTile(const FVoxelTileKey& Tile, EVoxelTileWorkPriority WorkPriority);
|
||||
void EnqueueStreamingResult(FChunkResult&& Result);
|
||||
void RecordStreamingResultDequeued(const FChunkResult& Result);
|
||||
uint64 GetStreamingResultPayloadBytes(const FChunkResult& Result) const;
|
||||
int32 GetStreamingResultBacklogCount() const;
|
||||
bool IsStreamingResultBacklogCapped() const;
|
||||
void ApplyCoreModification(const FVoxelModification& Modification);
|
||||
void BuildDesiredTransitionIndex();
|
||||
float GetActiveVoxelSizeCm() const;
|
||||
@@ -753,7 +781,20 @@ private:
|
||||
FVector CoreFallbackCenterLocalCm = FVector::ZeroVector;
|
||||
bool bCoreRegionCompilePending = false;
|
||||
TArray<FVoxelTileKey> PendingCoreRegionTiles;
|
||||
TSet<FVoxelTileKey> PendingCoreRegionTileSet;
|
||||
TArray<FVoxelTileKey> PendingCoreRetainedTiles;
|
||||
TSet<FVoxelTileKey> CoreRegionCompileTilesInFlight;
|
||||
FIntVector LastCoreRegionRequestCenter = FIntVector(MAX_int32, MAX_int32, MAX_int32);
|
||||
FIntVector PendingCoreRegionRequestCenter = FIntVector::ZeroValue;
|
||||
FIntVector ActiveCoreRegionCompileCenter = FIntVector::ZeroValue;
|
||||
bool bHasLastCoreRegionRequestCenter = false;
|
||||
double CoreRegionPendingSinceSeconds = 0.0;
|
||||
double ActiveCoreRegionCompileStartSeconds = 0.0;
|
||||
uint64 ActiveCoreRegionCompileStartCycles = 0;
|
||||
uint64 CoreRegionIndependentSubmissions = 0;
|
||||
uint64 CoreRegionDependentDeclines = 0;
|
||||
int32 CoreRegionCompileRequestSerial = 0;
|
||||
int32 ActiveCoreRegionCompileRequestSerial = 0;
|
||||
|
||||
public:
|
||||
|
||||
@@ -1083,7 +1124,19 @@ public:
|
||||
TQueue<FChunkResult, EQueueMode::Mpsc> EditedProcessQueue;
|
||||
TQueue<FChunkResult, EQueueMode::Mpsc> NearProcessQueue;
|
||||
TQueue<FChunkResult, EQueueMode::Mpsc> ProcessQueue;
|
||||
TSet<FVoxelTileKey> PendingTiles; // tiles with a gen task in flight
|
||||
// The cap counts completed MPSC results plus admitted tile tasks, so a slow game-thread apply
|
||||
// cannot accumulate an unbounded payload queue while completed work never consumes worker slots.
|
||||
// Le plafond compte les resultats MPSC et les taches admises; un apply lent ne peut donc pas
|
||||
// accumuler sans limite, et les resultats termines ne reprennent pas de slot worker.
|
||||
std::atomic<int32> QueuedStreamingResultCount{0};
|
||||
std::atomic<uint64> QueuedStreamingResultBytes{0};
|
||||
std::atomic<int32> PeakQueuedStreamingResultCount{0};
|
||||
std::atomic<uint64> PeakQueuedStreamingResultBytes{0};
|
||||
std::atomic<int32> ActiveTileTaskCount{0};
|
||||
std::atomic<uint64> StreamingResultBacklogCapStops{0};
|
||||
// Keys stay pending from task submission until the game thread applies the result; completed results can wait here.
|
||||
// Les cles restent en attente de la soumission jusqu'a l'application sur le thread de jeu ; les resultats termines y attendent.
|
||||
TSet<FVoxelTileKey> PendingTiles;
|
||||
// Game-thread-owned map; workers retain the shared token and only read its atomic flag.
|
||||
TMap<FVoxelTileKey, TSharedPtr<FVoxelTileCancellationState, ESPMode::ThreadSafe>>
|
||||
PendingTileCancellation;
|
||||
@@ -1111,8 +1164,12 @@ public:
|
||||
// Active pendant les mutations de génération lancées par l'éditeur, sans signifier la destruction.
|
||||
std::atomic<bool> bGenerationPaused{false};
|
||||
|
||||
// Number of async tasks currently running — EndPlay waits for this to reach 0
|
||||
// Submitted async tasks (including UE-queued work) — EndPlay waits for this to reach 0.
|
||||
// Taches asynchrones soumises (y compris la file UE) — EndPlay attend que le compteur revienne a 0.
|
||||
std::atomic<int32> ActiveTaskCount{0};
|
||||
// Active workers are counted inside the launched tile task, distinct from tasks queued by UE.
|
||||
// Les travailleurs actifs sont comptes dans la tache de tuile, distincts des taches en attente UE.
|
||||
std::atomic<int32> ActiveGenerationWorkerCount{0};
|
||||
|
||||
FORCEINLINE bool ShouldAbortWork(const std::atomic<bool>* ObsoleteFlag = nullptr) const
|
||||
{
|
||||
@@ -1170,6 +1227,12 @@ public:
|
||||
bool bAllChunksLoaded = false;
|
||||
bool bStartupTraceDesiredRecorded = false;
|
||||
bool bSampleStacksStarted = false;
|
||||
bool bStartupApplyBoostStarted = false;
|
||||
bool bStartupApplyBoostEnded = false;
|
||||
// Trace the resolved startup budget once per world. / Tracer une fois le budget de demarrage resolu par monde.
|
||||
bool bStartupApplyConfigTraced = false;
|
||||
uint64 LastApplyFrameCycles = 0;
|
||||
float StartupTraceSpeedCmPerSecond = 0.0f;
|
||||
TArray<FVoxelTileKey> DesiredSorted; // critical floor prefix, then true-pawn distance-first
|
||||
TArray<FVoxelTileKey> CriticalDesiredTiles; // occupied/support tile, then heading tile
|
||||
// Ancestor -> desired descendants, rebuilt with DesiredSorted. Reconciliation uses this
|
||||
@@ -1179,6 +1242,15 @@ public:
|
||||
uint32 DesiredEpoch = 0; // increments whenever DesiredStamped is rebuilt
|
||||
int32 ObsoleteTileAbortCount = 0; // cumulative per-world moving-session cancellation count
|
||||
float PeakObservedPawnSpeedCmPerSecond = 0.0f;
|
||||
int32 EffectiveNearTaskReserve = -1;
|
||||
bool bStreamingPlayerMoving = false; // GT snapshot consumed by admission helpers / instantane GT pour les admissions
|
||||
uint64 NextStreamingRequestOrdinal = 0;
|
||||
std::atomic<uint64> NextStreamingGenerationOrdinal{0};
|
||||
// Cumulative worker-task wall cycles avoid aliasing the instantaneous per-frame counter.
|
||||
// Les cycles cumules des taches evitent l'aliasing du compteur instantane echantillonne par frame.
|
||||
std::atomic<uint64> TotalGenerationWorkerTaskCycles{0};
|
||||
double LastStreamingSchedulerSampleSeconds = 0.0;
|
||||
uint64 LastStreamingSchedulerWorkerCycles = 0;
|
||||
|
||||
struct FReadyTransitionVisibilitySample
|
||||
{
|
||||
@@ -1257,6 +1329,11 @@ public:
|
||||
bool bHeadlessStreamingTestExitOnSteady = false;
|
||||
bool bHeadlessStreamingTestExitRequested = false;
|
||||
bool bStartupTraceThroughCrossing = false;
|
||||
bool bStartupTraceUntilEndPlay = false;
|
||||
bool bHasLastWalkableGateSample = false;
|
||||
bool bLastWalkableGateReady = false;
|
||||
FIntVector LastWalkableGateCenter = FIntVector::ZeroValue;
|
||||
double LastStreamingTraceSampleSeconds = 0.0;
|
||||
bool bHeadlessStreamingTestCenterOverride = false;
|
||||
FVector HeadlessStreamingTestCenterVoxel = FVector::ZeroVector;
|
||||
int32 HeadlessStreamingTestMoveAttempts = 0;
|
||||
@@ -1264,6 +1341,9 @@ public:
|
||||
float HeadlessStreamingTestSpeedCmPerSecond = 0.0f;
|
||||
float HeadlessStreamingTestStartSeconds = 0.0f;
|
||||
float HeadlessStreamingTestExitSeconds = 0.0f;
|
||||
float HeadlessStreamingTestTeleportAtSeconds = 0.0f;
|
||||
float HeadlessStreamingTestTeleportDistanceCm = 0.0f;
|
||||
bool bHeadlessStreamingTestTeleportDone = false;
|
||||
FVector HeadlessStreamingTestDirection = FVector::XAxisVector;
|
||||
FVector HeadlessStreamingTestLastActualPosition = FVector::ZeroVector;
|
||||
double HeadlessStreamingTestBeginSeconds = 0.0;
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include "VoxelTerrainOpDefinition.h"
|
||||
#include "VoxelTypes.h"
|
||||
#include "VoxelWorld.h"
|
||||
#include "VoxelStartupTrace.h"
|
||||
#include "VoxelForgeCoreAssetAdapter.h"
|
||||
#include "VoxelForgeCore/VoxelForgeCore.h"
|
||||
|
||||
@@ -878,6 +879,7 @@ struct FExploreArguments
|
||||
int32 PassageFloorWrites = 1;
|
||||
bool bStandaloneWorldExport = false;
|
||||
bool bCoreWorldTest = false;
|
||||
bool bCoreWorldStreamTraceOnly = false;
|
||||
bool bRenderCameraOverride = false;
|
||||
FVector RenderCamera = FVector::ZeroVector;
|
||||
bool bRenderTargetOverride = false;
|
||||
@@ -923,6 +925,9 @@ bool ParseArguments(const FString& Params, FExploreArguments& OutArguments, FStr
|
||||
int32 CoreWorldTest = 0;
|
||||
FParse::Value(*Params, TEXT("coreworldtest="), CoreWorldTest);
|
||||
OutArguments.bCoreWorldTest = CoreWorldTest != 0;
|
||||
int32 CoreWorldStreamTraceOnly = 0;
|
||||
FParse::Value(*Params, TEXT("coreworldstreamtrace="), CoreWorldStreamTraceOnly);
|
||||
OutArguments.bCoreWorldStreamTraceOnly = CoreWorldStreamTraceOnly != 0;
|
||||
FParse::Value(*Params, TEXT("corevoxelsizecm="), OutArguments.CoreVoxelSizeCm);
|
||||
if (!FMath::IsFinite(OutArguments.CoreVoxelSizeCm)
|
||||
|| OutArguments.CoreVoxelSizeCm < VOXEL_SIZE
|
||||
@@ -1499,6 +1504,11 @@ bool ParseArguments(const FString& Params, FExploreArguments& OutArguments, FStr
|
||||
OutError = TEXT("coreworldtest requires settingsref and must omit strateref.");
|
||||
return false;
|
||||
}
|
||||
if (OutArguments.bCoreWorldStreamTraceOnly && !OutArguments.bCoreWorldTest)
|
||||
{
|
||||
OutError = TEXT("coreworldstreamtrace requires coreworldtest.");
|
||||
return false;
|
||||
}
|
||||
if ((OutArguments.bCoreHybridMesher || OutArguments.bCoreHybridFixturePlacement
|
||||
|| OutArguments.bCoreHybridCliffOnly || OutArguments.bCoreHybridFixturesOnly
|
||||
|| OutArguments.bCoreFloatingIslandTest || OutArguments.bCoreFallbackTest
|
||||
@@ -15930,11 +15940,282 @@ bool RunCoreSharedFeatureCostAudit(VoxelForgeCore::World& World,
|
||||
const std::vector<VoxelForgeCore::TileKey>& Keys,const TCHAR* Label,
|
||||
const VoxelForgeCore::WorldAssemblyManifest* Assembly,FString& OutError)
|
||||
{
|
||||
for (const int32 LOD : {0,1,7,8})
|
||||
if(Assembly!=nullptr&&FCString::Stricmp(Label,TEXT("surface"))==0)
|
||||
{
|
||||
struct FProbeColumn
|
||||
{
|
||||
std::int64_t Ground=0;
|
||||
std::int64_t Cap=0;
|
||||
};
|
||||
const auto P95=[](TArray<double> Values)
|
||||
{ Values.Sort(); return Values.IsEmpty() ? 0.0 : Values[FMath::Clamp(
|
||||
FMath::CeilToInt(Values.Num()*0.95f)-1,0,Values.Num()-1)]; };
|
||||
const auto MaxValue=[](const TArray<double>& Values)
|
||||
{ return Values.IsEmpty() ? 0.0 : *std::max_element(Values.GetData(),Values.GetData()+Values.Num()); };
|
||||
const std::int32_t TileVoxelCount=static_cast<std::int32_t>(
|
||||
World.configuration().tileVoxelCount);
|
||||
constexpr std::int64_t Subvoxels=VoxelForgeCore::WorldAssemblySubvoxelsPerVoxel;
|
||||
constexpr double CoreVoxelSizeCm=25.0;
|
||||
for(const std::int32_t LOD:{0,1,3,4,5,8})
|
||||
{
|
||||
for(const std::int32_t Stride:{2,4})
|
||||
{
|
||||
const std::int32_t Cells=LOD<World.configuration().fullResolutionLodCount
|
||||
?TileVoxelCount:std::max(1,World.configuration().coarseTileCells);
|
||||
TArray<double> GroundErrorsCm,CapErrorsCm,BaselineColumnMs,CandidateColumnMs;
|
||||
std::uint64_t BaselineColumns=0,CandidateColumns=0,FiniteFeatureTiles=0;
|
||||
std::int32_t Tiles=0;
|
||||
for(const auto& Key:Keys)
|
||||
{
|
||||
if(Key.lod!=LOD||Tiles>=2)continue;
|
||||
const std::int64_t TileExtent=static_cast<std::int64_t>(TileVoxelCount)<<LOD;
|
||||
const std::int64_t TileStep=TileExtent/Cells;
|
||||
const std::int64_t OriginX=static_cast<std::int64_t>(Key.coordinate.x)*TileExtent;
|
||||
const std::int64_t OriginY=static_cast<std::int64_t>(Key.coordinate.y)*TileExtent;
|
||||
const std::int64_t OriginZ=static_cast<std::int64_t>(Key.coordinate.z)*TileExtent;
|
||||
const std::int64_t TileMinimumZ=OriginZ;
|
||||
const std::int64_t TileMaximumZ=OriginZ+TileExtent;
|
||||
const auto PlanIt=std::find_if(Assembly->plan.strates.begin(),
|
||||
Assembly->plan.strates.end(),[TileMinimumZ,TileMaximumZ,TileVoxelCount](const auto& Plan)
|
||||
{
|
||||
const std::int64_t PlanMinimumZ=static_cast<std::int64_t>(
|
||||
std::min(Plan.bottomChunkZ,Plan.topChunkZ))*TileVoxelCount;
|
||||
const std::int64_t PlanMaximumZ=(static_cast<std::int64_t>(
|
||||
std::max(Plan.bottomChunkZ,Plan.topChunkZ))+1)*TileVoxelCount;
|
||||
return TileMinimumZ<=PlanMaximumZ&&TileMaximumZ>=PlanMinimumZ;
|
||||
});
|
||||
if(PlanIt==Assembly->plan.strates.end())continue;
|
||||
|
||||
const VoxelForgeCore::Heightfield2D Field(Assembly->recipe,*PlanIt);
|
||||
if(!Field.isValid())continue;
|
||||
const std::array<std::int64_t,3> Minimum={
|
||||
(OriginX-TileStep)*Subvoxels,(OriginY-TileStep)*Subvoxels,
|
||||
(OriginZ-TileStep)*Subvoxels};
|
||||
const std::array<std::int64_t,3> Maximum={
|
||||
(OriginX+TileExtent+TileStep)*Subvoxels,
|
||||
(OriginY+TileExtent+TileStep)*Subvoxels,
|
||||
(OriginZ+TileExtent+TileStep)*Subvoxels};
|
||||
std::vector<VoxelForgeCore::WorldAssemblyFeatureQueryV1> Queries;
|
||||
Queries.push_back({Field.recipe(),Field.plan(),Field.buildFeatureTileList(Minimum,Maximum)});
|
||||
const VoxelForgeCore::ScopedWorldAssemblyFeatureQueriesV1 QueryScope{
|
||||
std::span<const VoxelForgeCore::WorldAssemblyFeatureQueryV1>(Queries)};
|
||||
const bool bHasFiniteFeature=std::any_of(PlanIt->features.begin(),
|
||||
PlanIt->features.end(),[&](const auto& Feature)
|
||||
{
|
||||
return (Feature.type==2||Feature.type==4)
|
||||
&&Feature.minimumSubvoxels[0]<=Maximum[0]
|
||||
&&Feature.maximumSubvoxels[0]>=Minimum[0]
|
||||
&&Feature.minimumSubvoxels[1]<=Maximum[1]
|
||||
&&Feature.maximumSubvoxels[1]>=Minimum[1]
|
||||
&&Feature.minimumSubvoxels[2]<=Maximum[2]
|
||||
&&Feature.maximumSubvoxels[2]>=Minimum[2];
|
||||
});
|
||||
if(bHasFiniteFeature)++FiniteFeatureTiles;
|
||||
|
||||
std::vector<FProbeColumn> Exact(static_cast<std::size_t>(Cells+1)*(Cells+1));
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true);
|
||||
for(std::int32_t Y=0;Y<=Cells;++Y)
|
||||
for(std::int32_t X=0;X<=Cells;++X)
|
||||
{
|
||||
const auto Sample=Field.point((OriginX+X*TileStep)*Subvoxels,
|
||||
(OriginY+Y*TileStep)*Subvoxels,0);
|
||||
Exact[static_cast<std::size_t>(Y)*(Cells+1)+X]={
|
||||
Sample.groundHeightSubvoxels,Sample.capHeightSubvoxels};
|
||||
}
|
||||
const auto& BaselineStats=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
BaselineColumnMs.Add(BaselineStats.columnComputeMilliseconds);
|
||||
BaselineColumns+=BaselineStats.columnMisses;
|
||||
|
||||
std::vector<std::int32_t> Axis;
|
||||
for(std::int32_t Index=0;Index<=Cells;Index+=Stride)Axis.push_back(Index);
|
||||
if(Axis.empty()||Axis.back()!=Cells)Axis.push_back(Cells);
|
||||
std::vector<FProbeColumn> Coarse(static_cast<std::size_t>(Axis.size())*Axis.size());
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true);
|
||||
for(std::size_t Y=0;Y<Axis.size();++Y)
|
||||
for(std::size_t X=0;X<Axis.size();++X)
|
||||
{
|
||||
const auto Sample=Field.point((OriginX+Axis[X]*TileStep)*Subvoxels,
|
||||
(OriginY+Axis[Y]*TileStep)*Subvoxels,0);
|
||||
Coarse[Y*Axis.size()+X]={Sample.groundHeightSubvoxels,
|
||||
Sample.capHeightSubvoxels};
|
||||
}
|
||||
const auto& CandidateStats=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
CandidateColumnMs.Add(CandidateStats.columnComputeMilliseconds);
|
||||
CandidateColumns+=CandidateStats.columnMisses;
|
||||
const auto Bracket=[&Axis](std::int32_t Value)
|
||||
{
|
||||
const auto Upper=std::upper_bound(Axis.begin(),Axis.end(),Value);
|
||||
const std::size_t High=Upper==Axis.end()?Axis.size()-1
|
||||
:static_cast<std::size_t>(Upper-Axis.begin());
|
||||
const std::size_t Low=High==0?0:High-1;
|
||||
return std::pair<std::size_t,std::size_t>{Low,High};
|
||||
};
|
||||
const auto Lerp=[](double A,double B,double T){return A+(B-A)*T;};
|
||||
for(std::int32_t Y=0;Y<=Cells;++Y)
|
||||
for(std::int32_t X=0;X<=Cells;++X)
|
||||
{
|
||||
const auto [X0,X1]=Bracket(X);
|
||||
const auto [Y0,Y1]=Bracket(Y);
|
||||
const double TX=Axis[X1]==Axis[X0]?0.0
|
||||
:static_cast<double>(X-Axis[X0])/(Axis[X1]-Axis[X0]);
|
||||
const double TY=Axis[Y1]==Axis[Y0]?0.0
|
||||
:static_cast<double>(Y-Axis[Y0])/(Axis[Y1]-Axis[Y0]);
|
||||
const auto& C00=Coarse[Y0*Axis.size()+X0];
|
||||
const auto& C10=Coarse[Y0*Axis.size()+X1];
|
||||
const auto& C01=Coarse[Y1*Axis.size()+X0];
|
||||
const auto& C11=Coarse[Y1*Axis.size()+X1];
|
||||
const double Ground=Lerp(Lerp(static_cast<double>(C00.Ground),
|
||||
static_cast<double>(C10.Ground),TX),Lerp(static_cast<double>(C01.Ground),
|
||||
static_cast<double>(C11.Ground),TX),TY);
|
||||
const double Cap=Lerp(Lerp(static_cast<double>(C00.Cap),
|
||||
static_cast<double>(C10.Cap),TX),Lerp(static_cast<double>(C01.Cap),
|
||||
static_cast<double>(C11.Cap),TX),TY);
|
||||
const auto& Reference=Exact[static_cast<std::size_t>(Y)*(Cells+1)+X];
|
||||
GroundErrorsCm.Add(std::abs(Ground-Reference.Ground)*CoreVoxelSizeCm/Subvoxels);
|
||||
CapErrorsCm.Add(std::abs(Cap-Reference.Cap)*CoreVoxelSizeCm/Subvoxels);
|
||||
}
|
||||
++Tiles;
|
||||
}
|
||||
std::uint64_t GroundOver2Cm=0,CapOver2Cm=0;
|
||||
for(const double Error:GroundErrorsCm)if(Error>2.0)++GroundOver2Cm;
|
||||
for(const double Error:CapErrorsCm)if(Error>2.0)++CapOver2Cm;
|
||||
double BaselineAverageMs=0.0,CandidateAverageMs=0.0;
|
||||
for(const double Value:BaselineColumnMs)BaselineAverageMs+=Value;
|
||||
for(const double Value:CandidateColumnMs)CandidateAverageMs+=Value;
|
||||
if(!BaselineColumnMs.IsEmpty())BaselineAverageMs/=BaselineColumnMs.Num();
|
||||
if(!CandidateColumnMs.IsEmpty())CandidateAverageMs/=CandidateColumnMs.Num();
|
||||
UE_LOG(LogTemp,Display,
|
||||
TEXT("[WorldAssemblerInterpolationProbe] label=%s lod=%d tiles=%d stride_samples=%d exact_column_evals=%llu coarse_column_evals=%llu column_eval_saving_pct=%.2f baseline_column_avg_ms=%.5f coarse_column_avg_ms=%.5f ground_error_p95_cm=%.4f ground_error_max_cm=%.4f ground_over_2cm=%llu/%d cap_error_p95_cm=%.4f cap_error_max_cm=%.4f cap_over_2cm=%llu/%d finite_feature_tiles=%llu fallback=none"),
|
||||
TEXT("surface"),LOD,Tiles,Stride,
|
||||
static_cast<unsigned long long>(BaselineColumns),
|
||||
static_cast<unsigned long long>(CandidateColumns),
|
||||
BaselineAverageMs>0.0?100.0*(1.0-CandidateAverageMs/BaselineAverageMs):0.0,
|
||||
BaselineAverageMs,CandidateAverageMs,
|
||||
P95(GroundErrorsCm),MaxValue(GroundErrorsCm),
|
||||
static_cast<unsigned long long>(GroundOver2Cm),GroundErrorsCm.Num(),
|
||||
P95(CapErrorsCm),MaxValue(CapErrorsCm),
|
||||
static_cast<unsigned long long>(CapOver2Cm),CapErrorsCm.Num(),
|
||||
static_cast<unsigned long long>(FiniteFeatureTiles));
|
||||
}
|
||||
}
|
||||
for(const std::int32_t LOD:{0,1,3,4,5,8})
|
||||
for(const std::uint32_t Drop:{1u,2u})
|
||||
{
|
||||
const std::int32_t Cells=LOD<World.configuration().fullResolutionLodCount
|
||||
?TileVoxelCount:std::max(1,World.configuration().coarseTileCells);
|
||||
TArray<double> GroundErrorsCm,CapErrorsCm,BaselineColumnMs,CandidateColumnMs;
|
||||
std::uint64_t BaselineColumns=0,CandidateColumns=0,FiniteFeatureTiles=0;
|
||||
std::int32_t Tiles=0;
|
||||
for(const auto& Key:Keys)
|
||||
{
|
||||
if(Key.lod!=LOD||Tiles>=2)continue;
|
||||
const std::int64_t TileExtent=static_cast<std::int64_t>(TileVoxelCount)<<LOD;
|
||||
const std::int64_t TileStep=TileExtent/Cells;
|
||||
const std::int64_t OriginX=static_cast<std::int64_t>(Key.coordinate.x)*TileExtent;
|
||||
const std::int64_t OriginY=static_cast<std::int64_t>(Key.coordinate.y)*TileExtent;
|
||||
const std::int64_t OriginZ=static_cast<std::int64_t>(Key.coordinate.z)*TileExtent;
|
||||
const std::int64_t TileMinimumZ=OriginZ,TileMaximumZ=OriginZ+TileExtent;
|
||||
const auto PlanIt=std::find_if(Assembly->plan.strates.begin(),
|
||||
Assembly->plan.strates.end(),[TileMinimumZ,TileMaximumZ,TileVoxelCount](const auto& Plan)
|
||||
{
|
||||
const std::int64_t PlanMinimumZ=static_cast<std::int64_t>(
|
||||
std::min(Plan.bottomChunkZ,Plan.topChunkZ))*TileVoxelCount;
|
||||
const std::int64_t PlanMaximumZ=(static_cast<std::int64_t>(
|
||||
std::max(Plan.bottomChunkZ,Plan.topChunkZ))+1)*TileVoxelCount;
|
||||
return TileMinimumZ<=PlanMaximumZ&&TileMaximumZ>=PlanMinimumZ;
|
||||
});
|
||||
if(PlanIt==Assembly->plan.strates.end())continue;
|
||||
const VoxelForgeCore::Heightfield2D Field(Assembly->recipe,*PlanIt);
|
||||
if(!Field.isValid())continue;
|
||||
const std::array<std::int64_t,3> Minimum={
|
||||
(OriginX-TileStep)*Subvoxels,(OriginY-TileStep)*Subvoxels,
|
||||
(OriginZ-TileStep)*Subvoxels};
|
||||
const std::array<std::int64_t,3> Maximum={
|
||||
(OriginX+TileExtent+TileStep)*Subvoxels,
|
||||
(OriginY+TileExtent+TileStep)*Subvoxels,
|
||||
(OriginZ+TileExtent+TileStep)*Subvoxels};
|
||||
std::vector<VoxelForgeCore::WorldAssemblyFeatureQueryV1> Queries;
|
||||
Queries.push_back({Field.recipe(),Field.plan(),Field.buildFeatureTileList(Minimum,Maximum)});
|
||||
const VoxelForgeCore::ScopedWorldAssemblyFeatureQueriesV1 QueryScope{
|
||||
std::span<const VoxelForgeCore::WorldAssemblyFeatureQueryV1>(Queries)};
|
||||
const bool bHasFiniteFeature=std::any_of(PlanIt->features.begin(),
|
||||
PlanIt->features.end(),[&](const auto& Feature)
|
||||
{
|
||||
return (Feature.type==2||Feature.type==4)
|
||||
&&Feature.minimumSubvoxels[0]<=Maximum[0]
|
||||
&&Feature.maximumSubvoxels[0]>=Minimum[0]
|
||||
&&Feature.minimumSubvoxels[1]<=Maximum[1]
|
||||
&&Feature.maximumSubvoxels[1]>=Minimum[1]
|
||||
&&Feature.minimumSubvoxels[2]<=Maximum[2]
|
||||
&&Feature.maximumSubvoxels[2]>=Minimum[2];
|
||||
});
|
||||
if(bHasFiniteFeature)++FiniteFeatureTiles;
|
||||
std::vector<FProbeColumn> Exact(static_cast<std::size_t>(Cells+1)*(Cells+1));
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true,0);
|
||||
for(std::int32_t Y=0;Y<=Cells;++Y)
|
||||
for(std::int32_t X=0;X<=Cells;++X)
|
||||
{
|
||||
const auto Sample=Field.point((OriginX+X*TileStep)*Subvoxels,
|
||||
(OriginY+Y*TileStep)*Subvoxels,0);
|
||||
Exact[static_cast<std::size_t>(Y)*(Cells+1)+X]={
|
||||
Sample.groundHeightSubvoxels,Sample.capHeightSubvoxels};
|
||||
}
|
||||
const auto& BaselineStats=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
BaselineColumnMs.Add(BaselineStats.columnComputeMilliseconds);
|
||||
BaselineColumns+=BaselineStats.columnMisses;
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true,Drop);
|
||||
for(std::int32_t Y=0;Y<=Cells;++Y)
|
||||
for(std::int32_t X=0;X<=Cells;++X)
|
||||
{
|
||||
const auto Sample=Field.point((OriginX+X*TileStep)*Subvoxels,
|
||||
(OriginY+Y*TileStep)*Subvoxels,0);
|
||||
GroundErrorsCm.Add(std::abs(static_cast<double>(Sample.groundHeightSubvoxels)
|
||||
-Exact[static_cast<std::size_t>(Y)*(Cells+1)+X].Ground)
|
||||
*CoreVoxelSizeCm/Subvoxels);
|
||||
CapErrorsCm.Add(std::abs(static_cast<double>(Sample.capHeightSubvoxels)
|
||||
-Exact[static_cast<std::size_t>(Y)*(Cells+1)+X].Cap)
|
||||
*CoreVoxelSizeCm/Subvoxels);
|
||||
}
|
||||
const auto& CandidateStats=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
CandidateColumnMs.Add(CandidateStats.columnComputeMilliseconds);
|
||||
CandidateColumns+=CandidateStats.columnMisses;
|
||||
++Tiles;
|
||||
}
|
||||
std::uint64_t GroundOver2Cm=0,CapOver2Cm=0;
|
||||
for(const double Error:GroundErrorsCm)if(Error>2.0)++GroundOver2Cm;
|
||||
for(const double Error:CapErrorsCm)if(Error>2.0)++CapOver2Cm;
|
||||
double BaselineAverageMs=0.0,CandidateAverageMs=0.0;
|
||||
for(const double Value:BaselineColumnMs)BaselineAverageMs+=Value;
|
||||
for(const double Value:CandidateColumnMs)CandidateAverageMs+=Value;
|
||||
if(!BaselineColumnMs.IsEmpty())BaselineAverageMs/=BaselineColumnMs.Num();
|
||||
if(!CandidateColumnMs.IsEmpty())CandidateAverageMs/=CandidateColumnMs.Num();
|
||||
UE_LOG(LogTemp,Display,
|
||||
TEXT("[WorldAssemblerFrequencyProbe] label=surface lod=%d tiles=%d drop_highest_octaves=%d exact_column_evals=%llu reduced_column_evals=%llu column_eval_saving_pct=%.2f baseline_column_avg_ms=%.5f reduced_column_avg_ms=%.5f ground_error_p95_cm=%.4f ground_error_max_cm=%.4f ground_over_2cm=%llu/%d cap_error_p95_cm=%.4f cap_error_max_cm=%.4f cap_over_2cm=%llu/%d finite_feature_tiles=%llu"),
|
||||
LOD,Tiles,static_cast<std::int32_t>(Drop),
|
||||
static_cast<unsigned long long>(BaselineColumns),
|
||||
static_cast<unsigned long long>(CandidateColumns),
|
||||
BaselineAverageMs>0.0?100.0*(1.0-CandidateAverageMs/BaselineAverageMs):0.0,
|
||||
BaselineAverageMs,CandidateAverageMs,
|
||||
P95(GroundErrorsCm),MaxValue(GroundErrorsCm),
|
||||
static_cast<unsigned long long>(GroundOver2Cm),GroundErrorsCm.Num(),
|
||||
P95(CapErrorsCm),MaxValue(CapErrorsCm),
|
||||
static_cast<unsigned long long>(CapOver2Cm),CapErrorsCm.Num(),
|
||||
static_cast<unsigned long long>(FiniteFeatureTiles));
|
||||
}
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true,0);
|
||||
}
|
||||
for (const int32 LOD : {0,1,3,4,5,8})
|
||||
{
|
||||
TArray<double> FullTimes,CandidateTimes,FullShellTimes,CandidateShellTimes,ListTimes;
|
||||
TArray<double> UnknownBoxes,FieldCalls,ColumnMisses,StratumShellTimes,ConnectorShellTimes;
|
||||
TArray<double> ClassificationTimes,ColumnComputeTimes,MeshingTimes,HorizonTimes,RepairSkipped;
|
||||
TArray<double> DensitySamples,ClassificationTimes,ClassificationExclusiveTimes;
|
||||
TArray<double> ColumnComputeTimes,MeshingTimes,HorizonTimes,RepairSkipped;
|
||||
TArray<double> ColumnEvalExclusiveTimes,MarchingExclusiveTimes,GroundRefineExclusiveTimes;
|
||||
TArray<double> CapRefineExclusiveTimes,MeshAssemblyTimes;
|
||||
TArray<double> MarchingColumnTimes,GroundColumnTimes,CapColumnTimes;
|
||||
TArray<double> ClassificationNsPerSample,ColumnNsPerSample,MarchingNsPerSample;
|
||||
TArray<double> GroundNsPerSample,CapNsPerSample,AssemblyNsPerSample,ListNsPerSample;
|
||||
TArray<double> MarchingColumnNsPerSample,GroundColumnNsPerSample,CapColumnNsPerSample;
|
||||
TArray<double> StratumFieldCalls,ConnectorFieldCalls,ShellTriangles,GroundTriangles,GroundRemoved,CapTriangles;
|
||||
for (const auto& Key : Keys)
|
||||
{
|
||||
@@ -15943,50 +16224,98 @@ bool RunCoreSharedFeatureCostAudit(VoxelForgeCore::World& World,
|
||||
Options.hashDensity=true;
|
||||
Options.useAssemblyFeatureQueries=false;
|
||||
std::string Error;
|
||||
// Warm both routes before measuring: column/page caches must not favor the second route.
|
||||
// Chauffer les deux parcours : les caches ne doivent pas favoriser le second.
|
||||
if (!World.generateTile(Key,Options,Error)) return false;
|
||||
// Check density and mesh parity with hashes, then time uncached runtime generation.
|
||||
// Verifier la parite avec hashes, puis mesurer la generation sans cache de colonnes.
|
||||
const auto FullParity=World.generateTile(Key,Options,Error);
|
||||
if (!FullParity) return false;
|
||||
Options.useAssemblyFeatureQueries=true;
|
||||
if (!World.generateTile(Key,Options,Error)) return false;
|
||||
const auto CandidateParity=World.generateTile(Key,Options,Error);
|
||||
if (!CandidateParity||FullParity->densityHash!=CandidateParity->densityHash
|
||||
||FullParity->meshHash!=CandidateParity->meshHash
|
||||
||FullParity->payloadHash!=CandidateParity->payloadHash
|
||||
||FullParity->topologyHash!=CandidateParity->topologyHash)
|
||||
{ OutError=TEXT("Shared feature full/candidate tile hashes differ."); return false; }
|
||||
Options.hashDensity=false;
|
||||
Options.useAssemblyFeatureQueries=false;
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true);
|
||||
const double FullStart=FPlatformTime::Seconds();
|
||||
auto Full=World.generateTile(Key,Options,Error);
|
||||
FullTimes.Add((FPlatformTime::Seconds()-FullStart)*1000.0);
|
||||
Options.useAssemblyFeatureQueries=true;
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(false,true);
|
||||
const double CandidateStart=FPlatformTime::Seconds();
|
||||
auto Candidate=World.generateTile(Key,Options,Error);
|
||||
CandidateTimes.Add((FPlatformTime::Seconds()-CandidateStart)*1000.0);
|
||||
if (!Full||!Candidate||Full->densityHash!=Candidate->densityHash
|
||||
||Full->meshHash!=Candidate->meshHash||Full->payloadHash!=Candidate->payloadHash
|
||||
||Full->topologyHash!=Candidate->topologyHash)
|
||||
{ OutError=TEXT("Shared feature full/candidate tile hashes differ."); return false; }
|
||||
if (!Full||!Candidate)
|
||||
{ OutError=TEXT("Shared feature full/candidate measured generation failed."); return false; }
|
||||
FullShellTimes.Add(Full->diagnostics.farShellMilliseconds);
|
||||
CandidateShellTimes.Add(Candidate->diagnostics.farShellMilliseconds);
|
||||
ListTimes.Add(Candidate->diagnostics.featureListMilliseconds);
|
||||
UnknownBoxes.Add(static_cast<double>(Full->diagnostics.unknownBoxes));
|
||||
FieldCalls.Add(static_cast<double>(Full->diagnostics.fieldCalls));
|
||||
ColumnMisses.Add(static_cast<double>(Full->diagnostics.columnCacheMisses));
|
||||
ClassificationTimes.Add(Full->diagnostics.classificationMilliseconds);
|
||||
ColumnComputeTimes.Add(Full->diagnostics.columnComputeMilliseconds);
|
||||
MeshingTimes.Add(Full->diagnostics.meshingMilliseconds);
|
||||
HorizonTimes.Add(Full->diagnostics.farHorizonMilliseconds);
|
||||
RepairSkipped.Add(Full->diagnostics.farShellRepairSkipped?1.0:0.0);
|
||||
StratumShellTimes.Add(Full->diagnostics.farStratumShellMilliseconds);
|
||||
ConnectorShellTimes.Add(Full->diagnostics.farConnectorShellMilliseconds);
|
||||
StratumFieldCalls.Add(static_cast<double>(Full->diagnostics.farStratumFieldCalls));
|
||||
ConnectorFieldCalls.Add(static_cast<double>(Full->diagnostics.farConnectorFieldCalls));
|
||||
ShellTriangles.Add(static_cast<double>(Full->diagnostics.farShellTrianglesAdded));
|
||||
GroundTriangles.Add(static_cast<double>(Full->diagnostics.horizonGroundTriangles));
|
||||
GroundRemoved.Add(static_cast<double>(Full->diagnostics.horizonGroundTrianglesRemoved));
|
||||
CapTriangles.Add(static_cast<double>(Full->diagnostics.horizonCapTriangles));
|
||||
const auto& Diagnostics=Candidate->diagnostics;
|
||||
const double SampleCount=static_cast<double>(Candidate->densitySampleCount);
|
||||
DensitySamples.Add(static_cast<double>(Candidate->densitySampleCount));
|
||||
UnknownBoxes.Add(static_cast<double>(Diagnostics.unknownBoxes));
|
||||
FieldCalls.Add(static_cast<double>(Diagnostics.fieldCalls));
|
||||
ColumnMisses.Add(static_cast<double>(Diagnostics.columnCacheMisses));
|
||||
ClassificationTimes.Add(Diagnostics.classificationMilliseconds);
|
||||
ClassificationExclusiveTimes.Add(Diagnostics.classificationExclusiveMilliseconds);
|
||||
ColumnComputeTimes.Add(Diagnostics.columnComputeMilliseconds);
|
||||
ColumnEvalExclusiveTimes.Add(Diagnostics.columnEvaluationExclusiveMilliseconds);
|
||||
MarchingExclusiveTimes.Add(Diagnostics.marchingCubesExclusiveMilliseconds);
|
||||
MarchingColumnTimes.Add(Diagnostics.marchingCubesColumnComputeMilliseconds);
|
||||
GroundRefineExclusiveTimes.Add(Diagnostics.groundRefinementExclusiveMilliseconds);
|
||||
GroundColumnTimes.Add(Diagnostics.groundRefinementColumnComputeMilliseconds);
|
||||
CapRefineExclusiveTimes.Add(Diagnostics.capRefinementExclusiveMilliseconds);
|
||||
CapColumnTimes.Add(Diagnostics.capRefinementColumnComputeMilliseconds);
|
||||
MeshAssemblyTimes.Add(Diagnostics.meshAssemblyMilliseconds);
|
||||
MeshingTimes.Add(Diagnostics.meshingMilliseconds);
|
||||
HorizonTimes.Add(Diagnostics.farHorizonMilliseconds);
|
||||
RepairSkipped.Add(Diagnostics.farShellRepairSkipped?1.0:0.0);
|
||||
StratumShellTimes.Add(Diagnostics.farStratumShellMilliseconds);
|
||||
ConnectorShellTimes.Add(Diagnostics.farConnectorShellMilliseconds);
|
||||
StratumFieldCalls.Add(static_cast<double>(Diagnostics.farStratumFieldCalls));
|
||||
ConnectorFieldCalls.Add(static_cast<double>(Diagnostics.farConnectorFieldCalls));
|
||||
ShellTriangles.Add(static_cast<double>(Diagnostics.farShellTrianglesAdded));
|
||||
GroundTriangles.Add(static_cast<double>(Diagnostics.horizonGroundTriangles));
|
||||
GroundRemoved.Add(static_cast<double>(Diagnostics.horizonGroundTrianglesRemoved));
|
||||
CapTriangles.Add(static_cast<double>(Diagnostics.horizonCapTriangles));
|
||||
if(SampleCount>0.0)
|
||||
{
|
||||
ClassificationNsPerSample.Add(Diagnostics.classificationExclusiveMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
ColumnNsPerSample.Add(Diagnostics.columnEvaluationExclusiveMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
MarchingColumnNsPerSample.Add(Diagnostics.marchingCubesColumnComputeMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
MarchingNsPerSample.Add(Diagnostics.marchingCubesExclusiveMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
GroundColumnNsPerSample.Add(Diagnostics.groundRefinementColumnComputeMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
GroundNsPerSample.Add(Diagnostics.groundRefinementExclusiveMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
CapColumnNsPerSample.Add(Diagnostics.capRefinementColumnComputeMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
CapNsPerSample.Add(Diagnostics.capRefinementExclusiveMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
AssemblyNsPerSample.Add(Diagnostics.meshAssemblyMilliseconds
|
||||
*1000000.0/SampleCount);
|
||||
ListNsPerSample.Add(Diagnostics.featureListMilliseconds*1000000.0/SampleCount);
|
||||
}
|
||||
}
|
||||
const auto P95=[](TArray<double> Values)
|
||||
{ Values.Sort(); return Values.IsEmpty() ? 0.0 : Values[FMath::Clamp(
|
||||
FMath::CeilToInt(Values.Num()*0.95f)-1,0,Values.Num()-1)]; };
|
||||
UE_LOG(LogTemp,Display,
|
||||
TEXT("[VoxelForgeSharedFeatureCost] label=%s lod=%d tiles=%d hashes_identical=1 full_p95_ms=%.5f candidate_p95_ms=%.5f list_p95_ms=%.5f classification_p95_ms=%.5f column_compute_p95_ms=%.5f meshing_p95_ms=%.5f horizon_p95_ms=%.5f full_shell_p95_ms=%.5f candidate_shell_p95_ms=%.5f repair_skipped_p95=%.0f unknown_boxes_p95=%.0f field_calls_p95=%.0f column_misses_p95=%.0f stratum_shell_p95_ms=%.5f stratum_field_calls_p95=%.0f connector_shell_p95_ms=%.5f connector_field_calls_p95=%.0f shell_triangles_p95=%.0f horizon_ground_triangles_p95=%.0f horizon_ground_removed_p95=%.0f horizon_cap_triangles_p95=%.0f"),
|
||||
TEXT("[VoxelForgeSharedFeatureCost] label=%s lod=%d tiles=%d hashes_identical=1 full_p95_ms=%.5f candidate_p95_ms=%.5f list_p95_ms=%.5f classification_wall_p95_ms=%.5f classification_exclusive_p95_ms=%.5f column_compute_p95_ms=%.5f column_eval_exclusive_p95_ms=%.5f mc_column_compute_p95_ms=%.5f mc_exclusive_p95_ms=%.5f ground_column_compute_p95_ms=%.5f ground_refine_exclusive_p95_ms=%.5f cap_column_compute_p95_ms=%.5f cap_refine_exclusive_p95_ms=%.5f mesh_assembly_p95_ms=%.5f meshing_p95_ms=%.5f horizon_p95_ms=%.5f samples_p95=%.0f classification_ns_per_sample_p95=%.2f column_ns_per_sample_p95=%.2f mc_column_ns_per_sample_p95=%.2f mc_ns_per_sample_p95=%.2f ground_column_ns_per_sample_p95=%.2f ground_ns_per_sample_p95=%.2f cap_column_ns_per_sample_p95=%.2f cap_ns_per_sample_p95=%.2f assembly_ns_per_sample_p95=%.2f feature_list_ns_per_sample_p95=%.2f full_shell_p95_ms=%.5f candidate_shell_p95_ms=%.5f repair_skipped_p95=%.0f unknown_boxes_p95=%.0f field_calls_p95=%.0f column_misses_p95=%.0f stratum_shell_p95_ms=%.5f stratum_field_calls_p95=%.0f connector_shell_p95_ms=%.5f connector_field_calls_p95=%.0f shell_triangles_p95=%.0f horizon_ground_triangles_p95=%.0f horizon_ground_removed_p95=%.0f horizon_cap_triangles_p95=%.0f"),
|
||||
Label,LOD,FullTimes.Num(),P95(FullTimes),P95(CandidateTimes),P95(ListTimes),
|
||||
P95(ClassificationTimes),P95(ColumnComputeTimes),P95(MeshingTimes),P95(HorizonTimes),
|
||||
P95(ClassificationTimes),P95(ClassificationExclusiveTimes),P95(ColumnComputeTimes),
|
||||
P95(ColumnEvalExclusiveTimes),P95(MarchingColumnTimes),P95(MarchingExclusiveTimes),
|
||||
P95(GroundColumnTimes),P95(GroundRefineExclusiveTimes),P95(CapColumnTimes),
|
||||
P95(CapRefineExclusiveTimes),
|
||||
P95(MeshAssemblyTimes),P95(MeshingTimes),P95(HorizonTimes),P95(DensitySamples),
|
||||
P95(ClassificationNsPerSample),P95(ColumnNsPerSample),P95(MarchingColumnNsPerSample),
|
||||
P95(MarchingNsPerSample),P95(GroundColumnNsPerSample),P95(GroundNsPerSample),
|
||||
P95(CapColumnNsPerSample),P95(CapNsPerSample),P95(AssemblyNsPerSample),P95(ListNsPerSample),
|
||||
P95(FullShellTimes),P95(CandidateShellTimes),P95(RepairSkipped),P95(UnknownBoxes),P95(FieldCalls),
|
||||
P95(ColumnMisses),P95(StratumShellTimes),P95(StratumFieldCalls),
|
||||
P95(ConnectorShellTimes),P95(ConnectorFieldCalls),P95(ShellTriangles),
|
||||
@@ -17329,6 +17658,262 @@ bool RunCoreWorldActorIntegrationTest(const FExploreArguments& Arguments, FStrin
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arguments.bCoreWorldStreamTraceOnly)
|
||||
{
|
||||
const UWorld::InitializationValues WorldInitialization = UWorld::InitializationValues()
|
||||
.AllowAudioPlayback(false)
|
||||
.RequiresHitProxies(false)
|
||||
.CreatePhysicsScene(true)
|
||||
.CreateNavigation(false)
|
||||
.CreateAISystem(false)
|
||||
.ShouldSimulatePhysics(true)
|
||||
.SetDefaultGameMode(AGameModeBase::StaticClass())
|
||||
.SetTransactional(false);
|
||||
UWorld* TestWorld = UWorld::CreateWorld(
|
||||
EWorldType::Game, false, FName(TEXT("VoxelForgeCoreStreamTraceWorld")),
|
||||
GetTransientPackage(), false, ERHIFeatureLevel::Num, &WorldInitialization);
|
||||
if (TestWorld == nullptr)
|
||||
{
|
||||
OutError = TEXT("Could not create the transient BuildHost stream-trace world.");
|
||||
return false;
|
||||
}
|
||||
UGameInstance* TestGameInstance = NewObject<UGameInstance>(GEngine);
|
||||
FWorldContext& TestWorldContext = GEngine->CreateNewWorldContext(EWorldType::Game);
|
||||
TestWorldContext.OwningGameInstance = TestGameInstance;
|
||||
TestWorldContext.SetCurrentWorld(TestWorld);
|
||||
TestWorld->SetGameInstance(TestGameInstance);
|
||||
TestWorld->SetShouldTick(false);
|
||||
TestGameInstance->Init();
|
||||
TestWorld->AddToRoot();
|
||||
struct FStreamTraceWorldCleanup
|
||||
{
|
||||
UWorld* World = nullptr;
|
||||
uint64 PreviousFrameCounter = GFrameCounter;
|
||||
~FStreamTraceWorldCleanup()
|
||||
{
|
||||
if (World != nullptr)
|
||||
{
|
||||
if (World->HasBegunPlay())
|
||||
{
|
||||
World->BeginTearingDown();
|
||||
World->EndPlay(EEndPlayReason::Quit);
|
||||
}
|
||||
if (UGameInstance* GameInstance = World->GetGameInstance())
|
||||
{
|
||||
GameInstance->Shutdown();
|
||||
}
|
||||
if (GEngine != nullptr) GEngine->DestroyWorldContext(World);
|
||||
World->DestroyWorld(false);
|
||||
if (World->IsRooted()) World->RemoveFromRoot();
|
||||
}
|
||||
GFrameCounter = PreviousFrameCounter;
|
||||
}
|
||||
} Cleanup{TestWorld, GFrameCounter};
|
||||
|
||||
if (!TestWorld->SetGameMode(FURL()))
|
||||
{
|
||||
OutError = TEXT("Could not create the transient BuildHost GameMode for stream tracing.");
|
||||
return false;
|
||||
}
|
||||
if (AGameModeBase* GameMode = TestWorld->GetAuthGameMode())
|
||||
{
|
||||
GameMode->DefaultPawnClass = nullptr;
|
||||
}
|
||||
UPlayer* TestPlayer = NewObject<UPlayer>(GEngine, NAME_None, RF_Transient);
|
||||
APlayerController* PlayerController = TestWorld->SpawnActor<APlayerController>(
|
||||
APlayerController::StaticClass(), FTransform::Identity, FActorSpawnParameters());
|
||||
if (TestPlayer == nullptr || PlayerController == nullptr)
|
||||
{
|
||||
OutError = TEXT("Could not create the BuildHost stream-trace player controller.");
|
||||
return false;
|
||||
}
|
||||
PlayerController->SetPlayer(TestPlayer);
|
||||
TestWorld->AddController(PlayerController);
|
||||
APawn* PlayerPawn = TestWorld->SpawnActor<APawn>(
|
||||
APawn::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator);
|
||||
if (PlayerPawn == nullptr)
|
||||
{
|
||||
OutError = TEXT("Could not create the BuildHost stream-trace pawn.");
|
||||
return false;
|
||||
}
|
||||
USceneComponent* PawnRoot = NewObject<USceneComponent>(PlayerPawn, NAME_None, RF_Transient);
|
||||
if (PawnRoot == nullptr)
|
||||
{
|
||||
OutError = TEXT("Could not create the BuildHost stream-trace pawn root.");
|
||||
return false;
|
||||
}
|
||||
PlayerPawn->SetRootComponent(PawnRoot);
|
||||
PawnRoot->RegisterComponent();
|
||||
PlayerPawn->SetActorLocation(FVector::ZeroVector, false, nullptr, ETeleportType::TeleportPhysics);
|
||||
PlayerController->Possess(PlayerPawn);
|
||||
if (TestWorld->GetFirstPlayerController() != PlayerController
|
||||
|| PlayerController->GetPawn() != PlayerPawn)
|
||||
{
|
||||
OutError = TEXT("BuildHost stream-trace controller did not retain its pawn.");
|
||||
return false;
|
||||
}
|
||||
|
||||
const FTransform ActorTransform = FTransform::Identity;
|
||||
AVoxelWorld* Actor = TestWorld->SpawnActorDeferred<AVoxelWorld>(
|
||||
AVoxelWorld::StaticClass(), ActorTransform, nullptr, nullptr,
|
||||
ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
|
||||
if (Actor == nullptr)
|
||||
{
|
||||
OutError = TEXT("Could not spawn the transient AVoxelWorld for stream tracing.");
|
||||
return false;
|
||||
}
|
||||
Actor->Settings = AuthoredSettings;
|
||||
Actor->bManageAtmosphere = false;
|
||||
Actor->bUseVoxelForgeCore = true;
|
||||
Actor->CoreVoxelSizeCm = Arguments.CoreVoxelSizeCm;
|
||||
Actor->CoreMesherRecipe = Arguments.CoreHybridMesherVersion == 2
|
||||
? EVoxelForgeCoreMesherRecipe::WorldAssemblerHybridV2
|
||||
: (Arguments.CoreHybridMesherVersion == 1
|
||||
? EVoxelForgeCoreMesherRecipe::WorldAssemblerHybridV1
|
||||
: EVoxelForgeCoreMesherRecipe::MarchingCubesV1);
|
||||
Actor->CoreClipRadius = 3;
|
||||
Actor->CoreMaxClipLevel = 8;
|
||||
Actor->bCaptureVoxelForgeCoreHashesForValidation = true;
|
||||
Actor->FinishSpawning(ActorTransform);
|
||||
TestWorld->InitializeActorsForPlay(FURL());
|
||||
TestWorld->BeginPlay();
|
||||
if (!VoxelForgeStartupTrace::IsActive())
|
||||
{
|
||||
OutError = TEXT("Core stream trace mode requires -voxel.StartupTraceFile.");
|
||||
return false;
|
||||
}
|
||||
Actor->SetActorTickEnabled(true);
|
||||
|
||||
auto DesiredTilesLoaded = [](const AVoxelWorld* World)
|
||||
{
|
||||
if (World == nullptr || World->DesiredSorted.IsEmpty()) return false;
|
||||
for (const FVoxelTileKey& Key : World->DesiredSorted)
|
||||
{
|
||||
if (!World->LoadedTiles.Contains(Key)) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
auto CollisionSetSettled = [](const AVoxelWorld* World)
|
||||
{
|
||||
if (World == nullptr) return false;
|
||||
for (const FVoxelTileKey& Key : World->CollisionDesiredTiles)
|
||||
{
|
||||
if (!World->CollisionReadyTiles.Contains(Key)
|
||||
&& !World->CollisionNotRequiredTiles.Contains(Key)) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const double ActorBeginSeconds = FPlatformTime::Seconds();
|
||||
constexpr double WalkStartSeconds = 30.0;
|
||||
constexpr double RunDurationSeconds = 45.0;
|
||||
float WalkSpeedCmPerSecond = 600.0f;
|
||||
FParse::Value(FCommandLine::Get(), TEXT("voxel.TestMoveSpeedCmPerSecond="),
|
||||
WalkSpeedCmPerSecond);
|
||||
FString WalkDirectionText(TEXT("0,1,0"));
|
||||
const FString DirectionKey(TEXT("voxel.TestMoveDirection="));
|
||||
const FString CommandLineText(FCommandLine::Get());
|
||||
const int32 DirectionKeyIndex = CommandLineText.Find(
|
||||
DirectionKey, ESearchCase::IgnoreCase, ESearchDir::FromStart);
|
||||
if (DirectionKeyIndex != INDEX_NONE)
|
||||
{
|
||||
WalkDirectionText = CommandLineText.Mid(DirectionKeyIndex + DirectionKey.Len());
|
||||
const int32 DirectionEnd = WalkDirectionText.Find(
|
||||
TEXT(" "), ESearchCase::CaseSensitive, ESearchDir::FromStart);
|
||||
if (DirectionEnd != INDEX_NONE)
|
||||
{
|
||||
WalkDirectionText.LeftInline(DirectionEnd, EAllowShrinking::No);
|
||||
}
|
||||
WalkDirectionText.TrimStartAndEndInline();
|
||||
WalkDirectionText.RemoveFromStart(TEXT("\""));
|
||||
WalkDirectionText.RemoveFromEnd(TEXT("\""));
|
||||
}
|
||||
TArray<double> SpawnTickMilliseconds;
|
||||
TArray<double> WalkTickMilliseconds;
|
||||
TArray<TPair<double, double>> TickSamples;
|
||||
bool bInitialSetReady = false;
|
||||
double InitialSetReadySeconds = -1.0;
|
||||
while (FPlatformTime::Seconds() - ActorBeginSeconds < RunDurationSeconds)
|
||||
{
|
||||
const double TickStartSeconds = FPlatformTime::Seconds();
|
||||
TestWorld->Tick(LEVELTICK_All, 0.016f);
|
||||
const double TickMilliseconds =
|
||||
(FPlatformTime::Seconds() - TickStartSeconds) * 1000.0;
|
||||
++GFrameCounter;
|
||||
const double ElapsedSeconds = FPlatformTime::Seconds() - ActorBeginSeconds;
|
||||
TickSamples.Emplace(ElapsedSeconds, TickMilliseconds);
|
||||
|
||||
if (!bInitialSetReady && Actor->IsVoxelForgeCoreReady()
|
||||
&& Actor->bAllChunksLoaded && Actor->PendingTiles.IsEmpty()
|
||||
&& Actor->PendingCollisionCooks.IsEmpty() && Actor->PendingUnload.IsEmpty()
|
||||
&& Actor->ActiveTaskCount.load(std::memory_order_acquire) == 0
|
||||
&& DesiredTilesLoaded(Actor) && CollisionSetSettled(Actor))
|
||||
{
|
||||
bInitialSetReady = true;
|
||||
InitialSetReadySeconds = ElapsedSeconds;
|
||||
VoxelForgeStartupTrace::RecordEvent(TEXT("stream_trace_milestone"), FString::Printf(
|
||||
TEXT("\"name\":\"initial_set_ready\",\"elapsed_s\":%s,\"desired\":%d,\"loaded\":%d,\"collision_desired\":%d,\"collision_ready\":%d"),
|
||||
*FString::SanitizeFloat(ElapsedSeconds), Actor->DesiredSorted.Num(),
|
||||
Actor->LoadedTiles.Num(), Actor->CollisionDesiredTiles.Num(),
|
||||
Actor->CollisionReadyTiles.Num()));
|
||||
}
|
||||
FPlatformProcess::Sleep(0.016f);
|
||||
}
|
||||
|
||||
for (const TPair<double, double>& Sample : TickSamples)
|
||||
{
|
||||
if (bInitialSetReady && Sample.Key <= InitialSetReadySeconds)
|
||||
{
|
||||
SpawnTickMilliseconds.Add(Sample.Value);
|
||||
}
|
||||
else if (Sample.Key >= WalkStartSeconds)
|
||||
{
|
||||
WalkTickMilliseconds.Add(Sample.Value);
|
||||
}
|
||||
}
|
||||
|
||||
auto PercentileMilliseconds = [](TArray<double> Values, double Fraction)
|
||||
{
|
||||
if (Values.IsEmpty()) return 0.0;
|
||||
Values.Sort();
|
||||
const int32 Index = FMath::Clamp(
|
||||
FMath::CeilToInt(Fraction * static_cast<double>(Values.Num() - 1)),
|
||||
0, Values.Num() - 1);
|
||||
return Values[Index];
|
||||
};
|
||||
const auto MaxMilliseconds = [](const TArray<double>& Values)
|
||||
{
|
||||
double Maximum = 0.0;
|
||||
for (const double Value : Values) Maximum = FMath::Max(Maximum, Value);
|
||||
return Maximum;
|
||||
};
|
||||
UE_LOG(LogTemp, Display,
|
||||
TEXT("[VoxelForgeCoreWorldStreamTrace] initial_ready=%d initial_ready_s=%.6f walk_start_s=%.3f run_s=%.3f desired=%d loaded=%d "
|
||||
"spawn_tick_ms_p95=%.3f spawn_tick_ms_max=%.3f walk_tick_ms_p95=%.3f walk_tick_ms_max=%.3f"),
|
||||
bInitialSetReady ? 1 : 0, InitialSetReadySeconds, WalkStartSeconds,
|
||||
RunDurationSeconds, Actor->DesiredSorted.Num(), Actor->LoadedTiles.Num(),
|
||||
PercentileMilliseconds(SpawnTickMilliseconds, 0.95),
|
||||
MaxMilliseconds(SpawnTickMilliseconds),
|
||||
PercentileMilliseconds(WalkTickMilliseconds, 0.95),
|
||||
MaxMilliseconds(WalkTickMilliseconds));
|
||||
if (!bInitialSetReady)
|
||||
{
|
||||
OutError = FString::Printf(
|
||||
TEXT("Actor-only Core stream trace did not reach initial readiness: ready=%d desired=%d loaded=%d pending=%d cooks=%d active=%d."),
|
||||
Actor->IsVoxelForgeCoreReady() ? 1 : 0, Actor->DesiredSorted.Num(),
|
||||
Actor->LoadedTiles.Num(), Actor->PendingTiles.Num(),
|
||||
Actor->PendingCollisionCooks.Num(),
|
||||
Actor->ActiveTaskCount.load(std::memory_order_acquire));
|
||||
return false;
|
||||
}
|
||||
UE_LOG(LogTemp, Display,
|
||||
TEXT("[VoxelForgeCoreWorldStreamTrace] pass complete=1 recipe=%s voxel_cm=%.3f walk_speed_cm_s=%.0f walk_direction=%s"),
|
||||
Arguments.CoreHybridMesherVersion == 2 ? TEXT("WorldAssemblerHybridV2")
|
||||
: (Arguments.CoreHybridMesherVersion == 1 ? TEXT("WorldAssemblerHybridV1")
|
||||
: TEXT("MarchingCubesV1")),
|
||||
Arguments.CoreVoxelSizeCm, WalkSpeedCmPerSecond, *WalkDirectionText);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Build one Standalone reference before creating the actor world so the two full Core worlds
|
||||
// never overlap in memory. The reference also precomputes the exact edit result and hashes.
|
||||
// Construire la référence Standalone avant le monde acteur pour ne jamais garder deux mondes
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
param(
|
||||
[string]$OutputName = 'VoxelForgeCoreStandalone.exe',
|
||||
[ValidateSet('All','Core')][string]$Target = 'All',
|
||||
[ValidateRange(1,16)][int]$CompileWorkers = 16,
|
||||
[ValidateRange(1,12)][int]$CompileWorkers = 12,
|
||||
[ValidateSet('Normal','BelowNormal')][string]$BuildPriority = 'Normal'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$BuildHostProcess = Get-Process -Id $PID
|
||||
$BuildHostProcess.PriorityClass = $BuildPriority
|
||||
$BuildHostProcess.ProcessorAffinity = [IntPtr]0xFFFF
|
||||
$BuildHostProcess.ProcessorAffinity = [IntPtr]0xFFF
|
||||
$Root = [IO.Path]::GetFullPath($PSScriptRoot)
|
||||
$BuildDir = Join-Path $Root 'Build\VoxelForgeCore'
|
||||
$BinDir = Join-Path $Root 'bin'
|
||||
@@ -24,6 +24,33 @@ $CoreLibrary = Join-Path $BuildDir 'VoxelForgeCore.lib'
|
||||
$VcVars = 'E:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat'
|
||||
if (-not (Test-Path -LiteralPath $VcVars -PathType Leaf)) { throw "MSVC environment script not found: $VcVars" }
|
||||
|
||||
if (-not ('VoxelForgeStandaloneBuildMemoryProbe' -as [type])) {
|
||||
Add-Type -TypeDefinition @'
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
public static class VoxelForgeStandaloneBuildMemoryProbe {
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
private struct MEMORYSTATUSEX {
|
||||
public uint dwLength, dwMemoryLoad;
|
||||
public ulong ullTotalPhys, ullAvailPhys, ullTotalPageFile, ullAvailPageFile;
|
||||
public ulong ullTotalVirtual, ullAvailVirtual, ullAvailExtendedVirtual;
|
||||
}
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX status);
|
||||
public static ulong AvailablePhysicalBytes() {
|
||||
var status = new MEMORYSTATUSEX();
|
||||
status.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX));
|
||||
if (!GlobalMemoryStatusEx(ref status)) throw new InvalidOperationException("GlobalMemoryStatusEx failed.");
|
||||
return status.ullAvailPhys;
|
||||
}
|
||||
}
|
||||
'@
|
||||
}
|
||||
while ([VoxelForgeStandaloneBuildMemoryProbe]::AvailablePhysicalBytes() -lt 4GB) {
|
||||
Write-Warning 'Standalone build is waiting for at least 4 GiB of free physical memory.'
|
||||
Start-Sleep -Seconds 20
|
||||
}
|
||||
|
||||
$SourceManifest = Join-Path $Root 'Core\core_sources.txt'
|
||||
if (-not (Test-Path -LiteralPath $SourceManifest -PathType Leaf)) { throw "Core source manifest not found: $SourceManifest" }
|
||||
$CoreSourceNames = @(Get-Content -LiteralPath $SourceManifest | ForEach-Object { $_.Trim() } |
|
||||
|
||||
@@ -125,6 +125,15 @@ namespace VoxelForgeCore
|
||||
std::uint64_t columnCacheMisses = 0;
|
||||
double classificationMilliseconds = 0.0;
|
||||
double columnComputeMilliseconds = 0.0;
|
||||
double columnEvaluationExclusiveMilliseconds = 0.0;
|
||||
double marchingCubesColumnComputeMilliseconds = 0.0;
|
||||
double groundRefinementColumnComputeMilliseconds = 0.0;
|
||||
double capRefinementColumnComputeMilliseconds = 0.0;
|
||||
double classificationExclusiveMilliseconds = 0.0;
|
||||
double marchingCubesExclusiveMilliseconds = 0.0;
|
||||
double groundRefinementExclusiveMilliseconds = 0.0;
|
||||
double capRefinementExclusiveMilliseconds = 0.0;
|
||||
double meshAssemblyMilliseconds = 0.0;
|
||||
double meshingMilliseconds = 0.0;
|
||||
double featureListMilliseconds = 0.0;
|
||||
double farShellMilliseconds = 0.0;
|
||||
@@ -146,6 +155,9 @@ namespace VoxelForgeCore
|
||||
std::uint64_t capRefinedCells = 0;
|
||||
std::uint64_t capRefinedTriangles = 0;
|
||||
bool capRefined = false;
|
||||
std::uint64_t columnEvaluationWorkerHash = 0;
|
||||
bool columnCoordinateCaptureComplete = true;
|
||||
std::vector<std::array<std::int64_t, 2>> evaluatedColumnCoordinates;
|
||||
};
|
||||
|
||||
struct TileMesh
|
||||
@@ -628,6 +640,9 @@ namespace VoxelForgeCore
|
||||
std::uint64_t columnHits = 0;
|
||||
std::uint64_t columnMisses = 0;
|
||||
double columnComputeMilliseconds = 0.0;
|
||||
bool captureCoordinates = false;
|
||||
bool coordinateCaptureComplete = true;
|
||||
std::vector<std::array<std::int64_t, 2>> evaluatedCoordinates;
|
||||
};
|
||||
|
||||
struct FieldInfluenceBounds
|
||||
@@ -676,8 +691,9 @@ namespace VoxelForgeCore
|
||||
std::int64_t minimumYSubvoxels, std::int64_t minimumZSubvoxels,
|
||||
std::int64_t maximumXSubvoxels, std::int64_t maximumYSubvoxels,
|
||||
std::int64_t maximumZSubvoxels, std::int32_t stepVoxels) const noexcept;
|
||||
static void resetThreadColumnCacheStats() noexcept;
|
||||
static HeightfieldColumnCacheStats threadColumnCacheStats() noexcept;
|
||||
static void resetThreadColumnCacheStats(bool captureCoordinates = false,
|
||||
bool clearCache = false, std::uint32_t octaveDrop = 0) noexcept;
|
||||
static const HeightfieldColumnCacheStats& threadColumnCacheStats() noexcept;
|
||||
FieldInterval interval(std::int64_t minimumXSubvoxels,
|
||||
std::int64_t minimumYSubvoxels,
|
||||
std::int64_t minimumZSubvoxels,
|
||||
@@ -1002,11 +1018,17 @@ namespace VoxelForgeCore
|
||||
// Validation control only; never participates in recipe/world identity.
|
||||
// Controle de validation seulement, sans effet sur l'identite du monde.
|
||||
bool useAssemblyFeatureQueries = true;
|
||||
// Opt-in diagnostic only; records XY columns evaluated by this LOD8 tile.
|
||||
// Diagnostic seulement; enregistre les colonnes XY evaluees par cette tuile LOD8.
|
||||
bool captureColumnCoordinates = false;
|
||||
// LOD8-only planar horizon interior grid; zero follows the MC step, 128 restores S9.
|
||||
// Grille interieure LOD8 seulement; zero suit la maille MC, 128 restaure S9.
|
||||
std::int32_t lod8HorizonInteriorStepVoxels = 0;
|
||||
// Bump when the distant cap representation changes. LOD4-8 mesh hashes are salted;
|
||||
// density and LOD0-3 hashes remain unchanged.
|
||||
// Incremente quand le plafond lointain change. Les hashes LOD4-8 incluent cette version;
|
||||
// densite et hashes LOD0-3 restent inchanges.
|
||||
std::uint32_t farHorizonVersion = 2;
|
||||
std::uint32_t farHorizonVersion = 3;
|
||||
};
|
||||
|
||||
class VFCORE_API World
|
||||
@@ -1021,6 +1043,9 @@ namespace VoxelForgeCore
|
||||
|
||||
bool compile(const ShapeBuildRequest& request, const JobScheduler& scheduler,
|
||||
std::string& error);
|
||||
// True only when a fine tile needs a separately compiled region before generation.
|
||||
// Vrai seulement si une tuile fine doit attendre la compilation d'une region dediee.
|
||||
bool needsTileRegion(const TileKey& tile) const;
|
||||
// Compile missing detail regions for entering fine tiles. Generated tile keys map to
|
||||
// shared world-coordinate regions. The default analyticOnly path coalesces each entering
|
||||
// LOD slab, builds its primitives/bins, and evaluates density on demand without
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <set>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
|
||||
namespace vfcore::detail
|
||||
{
|
||||
@@ -247,6 +249,45 @@ namespace VoxelForgeCore
|
||||
bool Refined = false;
|
||||
};
|
||||
|
||||
std::vector<int32> BuildNativeHorizonGridCoordinates(int32 TileExtent,int32 InteriorStep)
|
||||
{
|
||||
constexpr int32 BoundaryStep=128;
|
||||
std::vector<int32> Coordinates;
|
||||
if(TileExtent<=0)return Coordinates;
|
||||
if(InteriorStep<=BoundaryStep)
|
||||
{
|
||||
Coordinates.reserve(static_cast<std::size_t>(TileExtent/InteriorStep)+1u);
|
||||
for(int32 Position=0;Position<TileExtent;Position+=InteriorStep)
|
||||
Coordinates.push_back(Position);
|
||||
if(Coordinates.empty()||Coordinates.back()!=TileExtent)Coordinates.push_back(TileExtent);
|
||||
return Coordinates;
|
||||
}
|
||||
if(TileExtent<2*InteriorStep)
|
||||
{
|
||||
Coordinates.reserve(static_cast<std::size_t>(TileExtent/BoundaryStep)+1u);
|
||||
for(int32 Position=0;Position<TileExtent;Position+=BoundaryStep)
|
||||
Coordinates.push_back(Position);
|
||||
if(Coordinates.empty()||Coordinates.back()!=TileExtent)Coordinates.push_back(TileExtent);
|
||||
return Coordinates;
|
||||
}
|
||||
|
||||
// Keep the shared 128-voxel boundary lattice for LOD transitions while the LOD8
|
||||
// interior follows the coarse MC cell spacing. Preserve the exact same coordinates
|
||||
// in neighboring tiles, independent of which worker builds either side.
|
||||
// Garder la bordure commune de 128 voxels, avec un interieur a la maille MC de LOD8.
|
||||
for(int32 Position=0;Position<InteriorStep&&Position<TileExtent;Position+=BoundaryStep)
|
||||
Coordinates.push_back(Position);
|
||||
if(Coordinates.empty()||Coordinates.back()!=InteriorStep)
|
||||
Coordinates.push_back(InteriorStep);
|
||||
for(int32 Position=InteriorStep+InteriorStep;Position<TileExtent-InteriorStep;
|
||||
Position+=InteriorStep)
|
||||
Coordinates.push_back(Position);
|
||||
for(int32 Position=TileExtent-InteriorStep;Position<TileExtent;Position+=BoundaryStep)
|
||||
if(Coordinates.empty()||Coordinates.back()!=Position)Coordinates.push_back(Position);
|
||||
if(Coordinates.empty()||Coordinates.back()!=TileExtent)Coordinates.push_back(TileExtent);
|
||||
return Coordinates;
|
||||
}
|
||||
|
||||
FVector NormalizeCapNormal(const FVector& Value)
|
||||
{
|
||||
const double Length=std::sqrt(Value.X*Value.X+Value.Y*Value.Y+Value.Z*Value.Z);
|
||||
@@ -299,17 +340,28 @@ namespace VoxelForgeCore
|
||||
}
|
||||
|
||||
FNativeCapRefinementStats RefineFarNativeGround(const FStandaloneOwnerWorld& Owner,
|
||||
const WorldAssemblyManifest& Manifest,const FVoxelTileKey& Key,FVoxelMeshData& Mesh)
|
||||
const WorldAssemblyManifest& Manifest,const FVoxelTileKey& Key,int32 MeshStepVoxels,
|
||||
int32 InteriorStepOverride,FVoxelMeshData& Mesh)
|
||||
{
|
||||
FNativeCapRefinementStats Stats;
|
||||
if(Key.Level<5||!Owner.Generator)return Stats;
|
||||
const int32 GridStepVoxels=std::min(128,1<<Key.Level);
|
||||
constexpr int32 BoundaryStepVoxels=128;
|
||||
constexpr int64 Scale=WorldAssemblySubvoxelsPerVoxel;
|
||||
const int64 GridStepSubvoxels=static_cast<int64>(GridStepVoxels)*Scale;
|
||||
const FIntVector TileOrigin=Key.OriginVoxels();
|
||||
const int32 TileExtent=Key.ExtentVoxels();
|
||||
const int32 RequestedStep=Key.Level==8
|
||||
?(InteriorStepOverride>0?InteriorStepOverride:MeshStepVoxels)
|
||||
:std::min(BoundaryStepVoxels,1<<Key.Level);
|
||||
const int32 GridStepVoxels=Key.Level==8
|
||||
?((RequestedStep<BoundaryStepVoxels||RequestedStep%BoundaryStepVoxels!=0
|
||||
||TileExtent<=0||TileExtent%RequestedStep!=0)
|
||||
?BoundaryStepVoxels:std::max(BoundaryStepVoxels,RequestedStep))
|
||||
:RequestedStep;
|
||||
if(TileExtent<=0||TileExtent%GridStepVoxels!=0)return Stats;
|
||||
const int32 Cells=TileExtent/GridStepVoxels;
|
||||
const std::vector<int32> GridCoordinates=
|
||||
BuildNativeHorizonGridCoordinates(TileExtent,GridStepVoxels);
|
||||
const int32 GridSize=static_cast<int32>(GridCoordinates.size());
|
||||
if(GridSize<2)return Stats;
|
||||
const double TileMinZ=static_cast<double>(TileOrigin.Z)*Scale;
|
||||
const double TileMaxZ=static_cast<double>(TileOrigin.Z+TileExtent)*Scale;
|
||||
const int32 OldSurfaceVertices=std::clamp(Mesh.NumSurfaceVertices,0,Mesh.Vertices.Num());
|
||||
@@ -324,8 +376,9 @@ namespace VoxelForgeCore
|
||||
|
||||
struct FGroundProfile
|
||||
{
|
||||
int32 Cells=0,GridStep=0;
|
||||
int32 GridStep=0;
|
||||
double MinimumZ=0.0,MaximumZ=0.0;
|
||||
std::vector<int32> Coordinates;
|
||||
std::vector<double> Ground,Cap;
|
||||
};
|
||||
std::vector<FGroundProfile> GroundProfiles;
|
||||
@@ -344,14 +397,14 @@ namespace VoxelForgeCore
|
||||
FColor Color=FColor::White;
|
||||
int32 VertexIndex=INDEX_NONE;
|
||||
};
|
||||
std::vector<FGridSample> Grid(static_cast<std::size_t>(Cells+1)*(Cells+1));
|
||||
const auto GridIndex=[Cells](int32 X,int32 Y)
|
||||
{return static_cast<std::size_t>(Y)*(Cells+1)+X;};
|
||||
for(int32 Y=0;Y<=Cells;++Y)
|
||||
for(int32 X=0;X<=Cells;++X)
|
||||
std::vector<FGridSample> Grid(static_cast<std::size_t>(GridSize)*GridSize);
|
||||
const auto GridIndex=[GridSize](int32 X,int32 Y)
|
||||
{return static_cast<std::size_t>(Y)*GridSize+X;};
|
||||
for(int32 Y=0;Y<GridSize;++Y)
|
||||
for(int32 X=0;X<GridSize;++X)
|
||||
{
|
||||
const int64 XSub=(static_cast<int64>(TileOrigin.X)+static_cast<int64>(X)*GridStepVoxels)*Scale;
|
||||
const int64 YSub=(static_cast<int64>(TileOrigin.Y)+static_cast<int64>(Y)*GridStepVoxels)*Scale;
|
||||
const int64 XSub=(static_cast<int64>(TileOrigin.X)+GridCoordinates[X])*Scale;
|
||||
const int64 YSub=(static_cast<int64>(TileOrigin.Y)+GridCoordinates[Y])*Scale;
|
||||
const auto Column=Block.point(XSub,YSub,0);
|
||||
auto& Sample=Grid[GridIndex(X,Y)];
|
||||
Sample.Ground=static_cast<double>(Column.groundHeightSubvoxels);
|
||||
@@ -364,13 +417,13 @@ namespace VoxelForgeCore
|
||||
static_cast<uint8>(std::clamp(std::lround(Blend*255.0f),0l,255l)),
|
||||
static_cast<uint8>(std::clamp(Neighbor,0,255)));
|
||||
}
|
||||
for(int32 Y=0;Y<=Cells;++Y)
|
||||
for(int32 X=0;X<=Cells;++X)
|
||||
for(int32 Y=0;Y<GridSize;++Y)
|
||||
for(int32 X=0;X<GridSize;++X)
|
||||
{
|
||||
const int32 Left=std::max(0,X-1),Right=std::min(Cells,X+1);
|
||||
const int32 Down=std::max(0,Y-1),Up=std::min(Cells,Y+1);
|
||||
const double DX=static_cast<double>(Right-Left)*GridStepSubvoxels;
|
||||
const double DY=static_cast<double>(Up-Down)*GridStepSubvoxels;
|
||||
const int32 Left=std::max(0,X-1),Right=std::min(GridSize-1,X+1);
|
||||
const int32 Down=std::max(0,Y-1),Up=std::min(GridSize-1,Y+1);
|
||||
const double DX=static_cast<double>(GridCoordinates[Right]-GridCoordinates[Left])*Scale;
|
||||
const double DY=static_cast<double>(GridCoordinates[Up]-GridCoordinates[Down])*Scale;
|
||||
const double SlopeX=DX>0.0?(Grid[GridIndex(Right,Y)].Ground
|
||||
-Grid[GridIndex(Left,Y)].Ground)/DX:0.0;
|
||||
const double SlopeY=DY>0.0?(Grid[GridIndex(X,Up)].Ground
|
||||
@@ -382,7 +435,7 @@ namespace VoxelForgeCore
|
||||
}
|
||||
|
||||
FGroundProfile Profile;
|
||||
Profile.Cells=Cells;Profile.GridStep=GridStepVoxels;
|
||||
Profile.GridStep=GridStepVoxels;Profile.Coordinates=GridCoordinates;
|
||||
Profile.MinimumZ=static_cast<double>(std::min(Plan.bottomChunkZ,Plan.topChunkZ))*CHUNK_SIZE;
|
||||
Profile.MaximumZ=static_cast<double>(std::max(Plan.bottomChunkZ,Plan.topChunkZ)+1)*CHUNK_SIZE;
|
||||
Profile.Ground.reserve(Grid.size());Profile.Cap.reserve(Grid.size());
|
||||
@@ -392,25 +445,25 @@ namespace VoxelForgeCore
|
||||
|
||||
// Partager les sommets du profil entre cellules reduit le payload d'horizon.
|
||||
// Share regular profile vertices across adjacent cells to bound horizon payload.
|
||||
for(int32 Y=0;Y<=Cells;++Y)
|
||||
for(int32 X=0;X<=Cells;++X)
|
||||
for(int32 Y=0;Y<GridSize;++Y)
|
||||
for(int32 X=0;X<GridSize;++X)
|
||||
{
|
||||
auto& Sample=Grid[GridIndex(X,Y)];
|
||||
if(Sample.Ground>=Sample.Cap||Sample.Ground<TileMinZ||Sample.Ground>TileMaxZ)continue;
|
||||
const int64 XSub=(static_cast<int64>(TileOrigin.X)+static_cast<int64>(X)*GridStepVoxels)*Scale;
|
||||
const int64 YSub=(static_cast<int64>(TileOrigin.Y)+static_cast<int64>(Y)*GridStepVoxels)*Scale;
|
||||
const int64 XSub=(static_cast<int64>(TileOrigin.X)+GridCoordinates[X])*Scale;
|
||||
const int64 YSub=(static_cast<int64>(TileOrigin.Y)+GridCoordinates[Y])*Scale;
|
||||
const double VoxelSizeCm=static_cast<double>(Owner.CoreVoxelSizeMicrons)/10000.0;
|
||||
Sample.VertexIndex=static_cast<int32>(AddedVertices.size());
|
||||
AddedVertices.emplace_back(static_cast<double>(TileOrigin.X+X*GridStepVoxels)*VoxelSizeCm,
|
||||
static_cast<double>(TileOrigin.Y+Y*GridStepVoxels)*VoxelSizeCm,
|
||||
AddedVertices.emplace_back(static_cast<double>(TileOrigin.X+GridCoordinates[X])*VoxelSizeCm,
|
||||
static_cast<double>(TileOrigin.Y+GridCoordinates[Y])*VoxelSizeCm,
|
||||
Sample.Ground/Scale*VoxelSizeCm);
|
||||
AddedNormals.push_back(Sample.Normal);
|
||||
if(bHasUVs)AddedUVs.emplace_back(static_cast<float>(XSub/Scale),static_cast<float>(YSub/Scale));
|
||||
if(bHasColors)AddedColors.push_back(Sample.Color);
|
||||
}
|
||||
|
||||
for(int32 Y=0;Y<Cells;++Y)
|
||||
for(int32 X=0;X<Cells;++X)
|
||||
for(int32 Y=0;Y+1<GridSize;++Y)
|
||||
for(int32 X=0;X+1<GridSize;++X)
|
||||
{
|
||||
const int32 CellX[4]={X,X+1,X+1,X};
|
||||
const int32 CellY[4]={Y,Y,Y+1,Y+1};
|
||||
@@ -433,8 +486,8 @@ namespace VoxelForgeCore
|
||||
{
|
||||
const int32 GX=CellX[Corner],GY=CellY[Corner];
|
||||
const auto& Sample=Grid[GridIndex(GX,GY)];
|
||||
PolygonA[Corner].XSub=static_cast<double>(TileOrigin.X+GX*GridStepVoxels)*Scale;
|
||||
PolygonA[Corner].YSub=static_cast<double>(TileOrigin.Y+GY*GridStepVoxels)*Scale;
|
||||
PolygonA[Corner].XSub=static_cast<double>(TileOrigin.X+GridCoordinates[GX])*Scale;
|
||||
PolygonA[Corner].YSub=static_cast<double>(TileOrigin.Y+GridCoordinates[GY])*Scale;
|
||||
PolygonA[Corner].GroundSub=Sample.Ground;
|
||||
PolygonA[Corner].CapSub=Sample.Cap;
|
||||
PolygonA[Corner].ZSub=Sample.Ground;
|
||||
@@ -487,16 +540,29 @@ namespace VoxelForgeCore
|
||||
const auto InterpolateProfile=[](const std::vector<double>& Values,const FGroundProfile& Profile,
|
||||
double LocalX,double LocalY)
|
||||
{
|
||||
const double GridX=std::clamp(LocalX/Profile.GridStep,0.0,static_cast<double>(Profile.Cells));
|
||||
const double GridY=std::clamp(LocalY/Profile.GridStep,0.0,static_cast<double>(Profile.Cells));
|
||||
const int32 X=std::min(Profile.Cells-1,static_cast<int32>(std::floor(GridX)));
|
||||
const int32 Y=std::min(Profile.Cells-1,static_cast<int32>(std::floor(GridY)));
|
||||
const double TX=GridX-X,TY=GridY-Y;
|
||||
const std::size_t Width=static_cast<std::size_t>(Profile.Cells+1);
|
||||
const std::size_t Width=Profile.Coordinates.size();
|
||||
const auto FindCell=[&](double Local)
|
||||
{
|
||||
const double Clamped=std::clamp(Local,static_cast<double>(Profile.Coordinates.front()),
|
||||
static_cast<double>(Profile.Coordinates.back()));
|
||||
const auto Upper=std::upper_bound(Profile.Coordinates.begin(),Profile.Coordinates.end(),Clamped);
|
||||
if(Upper==Profile.Coordinates.begin())return std::pair<std::size_t,double>{0u,0.0};
|
||||
const std::size_t Index=std::min<std::size_t>(Width-2u,
|
||||
static_cast<std::size_t>(Upper-Profile.Coordinates.begin()-1));
|
||||
const double Start=Profile.Coordinates[Index];
|
||||
const double Span=Profile.Coordinates[Index+1]-Profile.Coordinates[Index];
|
||||
return std::pair<std::size_t,double>{Index,Span>0.0?(Clamped-Start)/Span:0.0};
|
||||
};
|
||||
const auto [X,TX]=FindCell(LocalX);
|
||||
const auto [Y,TY]=FindCell(LocalY);
|
||||
const auto At=[&](int32 PX,int32 PY){return Values[static_cast<std::size_t>(PY)*Width+PX];};
|
||||
if(TX>=TY)
|
||||
return At(X,Y)*(1.0-TX)+At(X+1,Y)*(TX-TY)+At(X+1,Y+1)*TY;
|
||||
return At(X,Y)*(1.0-TY)+At(X+1,Y+1)*TX+At(X,Y+1)*(TY-TX);
|
||||
return At(static_cast<int32>(X),static_cast<int32>(Y))*(1.0-TX)
|
||||
+At(static_cast<int32>(X+1u),static_cast<int32>(Y))*(TX-TY)
|
||||
+At(static_cast<int32>(X+1u),static_cast<int32>(Y+1u))*TY;
|
||||
return At(static_cast<int32>(X),static_cast<int32>(Y))*(1.0-TY)
|
||||
+At(static_cast<int32>(X+1u),static_cast<int32>(Y+1u))*TX
|
||||
+At(static_cast<int32>(X),static_cast<int32>(Y+1u))*(TY-TX);
|
||||
};
|
||||
for(int32 Triangle=0;Triangle<OldSurfaceTriangleCount;++Triangle)
|
||||
{
|
||||
@@ -517,12 +583,13 @@ namespace VoxelForgeCore
|
||||
if(LocalX<0.0||LocalY<0.0||LocalX>TileExtent||LocalY>TileExtent)continue;
|
||||
for(const auto& Profile:GroundProfiles)
|
||||
{
|
||||
if(LocalX>Profile.Cells*Profile.GridStep||LocalY>Profile.Cells*Profile.GridStep)continue;
|
||||
if(LocalX>Profile.Coordinates.back()||LocalY>Profile.Coordinates.back())continue;
|
||||
const double Ground=InterpolateProfile(Profile.Ground,Profile,LocalX,LocalY);
|
||||
const double Cap=InterpolateProfile(Profile.Cap,Profile,LocalX,LocalY);
|
||||
if(Cap-Ground<=1.0||Ground<TileMinZ/Scale||Ground>TileMaxZ/Scale
|
||||
||Ground<Profile.MinimumZ||Ground>Profile.MaximumZ)continue;
|
||||
const double ReplacementBand=std::max(32.0,2.0*Profile.GridStep);
|
||||
const double ReplacementBand=std::max(32.0,
|
||||
2.0*std::min(Profile.GridStep,BoundaryStepVoxels));
|
||||
if(Z>=Ground-ReplacementBand)
|
||||
{
|
||||
RemoveOldGround[static_cast<std::size_t>(Triangle)]=1;
|
||||
@@ -574,17 +641,28 @@ namespace VoxelForgeCore
|
||||
}
|
||||
|
||||
FNativeCapRefinementStats RefineFarNativeCap(const FStandaloneOwnerWorld& Owner,
|
||||
const WorldAssemblyManifest& Manifest,const FVoxelTileKey& Key,FVoxelMeshData& Mesh)
|
||||
const WorldAssemblyManifest& Manifest,const FVoxelTileKey& Key,int32 MeshStepVoxels,
|
||||
int32 InteriorStepOverride,FVoxelMeshData& Mesh)
|
||||
{
|
||||
FNativeCapRefinementStats Stats;
|
||||
if(Key.Level<4||!Owner.Generator)return Stats;
|
||||
const int32 GridStepVoxels=Key.Level<5?std::min(128,1<<Key.Level):128;
|
||||
constexpr int64 Scale=WorldAssemblySubvoxelsPerVoxel;
|
||||
const int64 GridStepSubvoxels=static_cast<int64>(GridStepVoxels)*Scale;
|
||||
constexpr int32 BoundaryStepVoxels=128;
|
||||
const int32 RequestedStep=Key.Level==8
|
||||
?(InteriorStepOverride>0?InteriorStepOverride:MeshStepVoxels)
|
||||
:(Key.Level<5?std::min(BoundaryStepVoxels,1<<Key.Level):BoundaryStepVoxels);
|
||||
const FIntVector TileOrigin=Key.OriginVoxels();
|
||||
const int32 TileExtent=Key.ExtentVoxels();
|
||||
if(TileExtent<=0||TileExtent%GridStepVoxels!=0)return Stats;
|
||||
const int32 Cells=TileExtent/GridStepVoxels;
|
||||
const int32 EffectiveGridStep=Key.Level==8
|
||||
?((RequestedStep<BoundaryStepVoxels||RequestedStep%BoundaryStepVoxels!=0
|
||||
||TileExtent<=0||TileExtent%RequestedStep!=0)
|
||||
?BoundaryStepVoxels:std::max(BoundaryStepVoxels,RequestedStep))
|
||||
:RequestedStep;
|
||||
constexpr int64 Scale=WorldAssemblySubvoxelsPerVoxel;
|
||||
if(TileExtent<=0||TileExtent%EffectiveGridStep!=0)return Stats;
|
||||
const std::vector<int32> GridCoordinates=
|
||||
BuildNativeHorizonGridCoordinates(TileExtent,EffectiveGridStep);
|
||||
const int32 GridSize=static_cast<int32>(GridCoordinates.size());
|
||||
if(GridSize<2)return Stats;
|
||||
const int64 TileMinZ=static_cast<int64>(TileOrigin.Z)*Scale;
|
||||
const int64 TileMaxZ=static_cast<int64>(TileOrigin.Z+TileExtent)*Scale;
|
||||
const int32 OldSurfaceVertices=std::clamp(Mesh.NumSurfaceVertices,0,Mesh.Vertices.Num());
|
||||
@@ -612,14 +690,14 @@ namespace VoxelForgeCore
|
||||
FColor Color=FColor::White;
|
||||
int32 VertexIndex=INDEX_NONE;
|
||||
};
|
||||
std::vector<FGridSample> Grid(static_cast<std::size_t>(Cells+1)*(Cells+1));
|
||||
const auto GridIndex=[Cells](int32 X,int32 Y)
|
||||
{return static_cast<std::size_t>(Y)*(Cells+1)+X;};
|
||||
for(int32 Y=0;Y<=Cells;++Y)
|
||||
for(int32 X=0;X<=Cells;++X)
|
||||
std::vector<FGridSample> Grid(static_cast<std::size_t>(GridSize)*GridSize);
|
||||
const auto GridIndex=[GridSize](int32 X,int32 Y)
|
||||
{return static_cast<std::size_t>(Y)*GridSize+X;};
|
||||
for(int32 Y=0;Y<GridSize;++Y)
|
||||
for(int32 X=0;X<GridSize;++X)
|
||||
{
|
||||
const int64 XSub=(static_cast<int64>(TileOrigin.X)+static_cast<int64>(X)*GridStepVoxels)*Scale;
|
||||
const int64 YSub=(static_cast<int64>(TileOrigin.Y)+static_cast<int64>(Y)*GridStepVoxels)*Scale;
|
||||
const int64 XSub=(static_cast<int64>(TileOrigin.X)+GridCoordinates[X])*Scale;
|
||||
const int64 YSub=(static_cast<int64>(TileOrigin.Y)+GridCoordinates[Y])*Scale;
|
||||
const auto Column=Block.point(XSub,YSub,0);
|
||||
auto& Sample=Grid[GridIndex(X,Y)];
|
||||
Sample.Ground=static_cast<double>(Column.groundHeightSubvoxels);
|
||||
@@ -633,13 +711,13 @@ namespace VoxelForgeCore
|
||||
const uint8 B=static_cast<uint8>(std::clamp(std::lround(Blend*255.0f),0l,255l));
|
||||
Sample.Color=FColor(R,0,B,A);
|
||||
}
|
||||
for(int32 Y=0;Y<=Cells;++Y)
|
||||
for(int32 X=0;X<=Cells;++X)
|
||||
for(int32 Y=0;Y<GridSize;++Y)
|
||||
for(int32 X=0;X<GridSize;++X)
|
||||
{
|
||||
const int32 Left=std::max(0,X-1),Right=std::min(Cells,X+1);
|
||||
const int32 Down=std::max(0,Y-1),Up=std::min(Cells,Y+1);
|
||||
const double DX=static_cast<double>(Right-Left)*GridStepSubvoxels;
|
||||
const double DY=static_cast<double>(Up-Down)*GridStepSubvoxels;
|
||||
const int32 Left=std::max(0,X-1),Right=std::min(GridSize-1,X+1);
|
||||
const int32 Down=std::max(0,Y-1),Up=std::min(GridSize-1,Y+1);
|
||||
const double DX=static_cast<double>(GridCoordinates[Right]-GridCoordinates[Left])*Scale;
|
||||
const double DY=static_cast<double>(GridCoordinates[Up]-GridCoordinates[Down])*Scale;
|
||||
const double SlopeX=DX>0.0?(Grid[GridIndex(Right,Y)].Cap-Grid[GridIndex(Left,Y)].Cap)/DX:0.0;
|
||||
const double SlopeY=DY>0.0?(Grid[GridIndex(X,Up)].Cap-Grid[GridIndex(X,Down)].Cap)/DY:0.0;
|
||||
auto& Sample=Grid[GridIndex(X,Y)];
|
||||
@@ -655,10 +733,10 @@ namespace VoxelForgeCore
|
||||
if(Sample.Cap<Sample.Ground||Sample.Cap<TileMinZ||Sample.Cap>TileMaxZ)continue;
|
||||
Sample.VertexIndex=static_cast<int32>(AddedVertices.size());
|
||||
const std::size_t Index=static_cast<std::size_t>(&Sample-Grid.data());
|
||||
const int32 GX=static_cast<int32>(Index%static_cast<std::size_t>(Cells+1));
|
||||
const int32 GY=static_cast<int32>(Index/static_cast<std::size_t>(Cells+1));
|
||||
const double XSub=static_cast<double>(TileOrigin.X+GX*GridStepVoxels)*Scale;
|
||||
const double YSub=static_cast<double>(TileOrigin.Y+GY*GridStepVoxels)*Scale;
|
||||
const int32 GX=static_cast<int32>(Index%static_cast<std::size_t>(GridSize));
|
||||
const int32 GY=static_cast<int32>(Index/static_cast<std::size_t>(GridSize));
|
||||
const double XSub=static_cast<double>(TileOrigin.X+GridCoordinates[GX])*Scale;
|
||||
const double YSub=static_cast<double>(TileOrigin.Y+GridCoordinates[GY])*Scale;
|
||||
const double VoxelSizeCm=static_cast<double>(Owner.CoreVoxelSizeMicrons)/10000.0;
|
||||
AddedVertices.emplace_back(XSub/Scale*VoxelSizeCm,YSub/Scale*VoxelSizeCm,
|
||||
Sample.Cap/Scale*VoxelSizeCm);
|
||||
@@ -668,8 +746,8 @@ namespace VoxelForgeCore
|
||||
if(bHasColors)AddedColors.push_back(Sample.Color);
|
||||
}
|
||||
|
||||
for(int32 Y=0;Y<Cells;++Y)
|
||||
for(int32 X=0;X<Cells;++X)
|
||||
for(int32 Y=0;Y+1<GridSize;++Y)
|
||||
for(int32 X=0;X+1<GridSize;++X)
|
||||
{
|
||||
const int32 CellX[4]={X,X+1,X+1,X};
|
||||
const int32 CellY[4]={Y,Y,Y+1,Y+1};
|
||||
@@ -692,8 +770,8 @@ namespace VoxelForgeCore
|
||||
{
|
||||
const int32 GX=CellX[Corner],GY=CellY[Corner];
|
||||
const auto& Sample=Grid[GridIndex(GX,GY)];
|
||||
PolygonA[Corner].XSub=static_cast<double>(TileOrigin.X+GX*GridStepVoxels)*Scale;
|
||||
PolygonA[Corner].YSub=static_cast<double>(TileOrigin.Y+GY*GridStepVoxels)*Scale;
|
||||
PolygonA[Corner].XSub=static_cast<double>(TileOrigin.X+GridCoordinates[GX])*Scale;
|
||||
PolygonA[Corner].YSub=static_cast<double>(TileOrigin.Y+GridCoordinates[GY])*Scale;
|
||||
PolygonA[Corner].ZSub=Sample.Cap;PolygonA[Corner].GroundSub=Sample.Ground;
|
||||
PolygonA[Corner].Normal=Sample.Normal;PolygonA[Corner].Color=Sample.Color;
|
||||
}
|
||||
@@ -909,6 +987,16 @@ namespace VoxelForgeCore
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool World::needsTileRegion(const TileKey& key) const
|
||||
{
|
||||
if(!impl_||!impl_->owner||!impl_->shape||!impl_->shape->IsBuilt()
|
||||
||key.lod<0||key.lod>=impl_->configuration.fullResolutionLodCount)
|
||||
return false;
|
||||
if(CoveredByBaseShape(impl_->buildRequest,impl_->configuration,key))return false;
|
||||
std::shared_lock lock(impl_->tileRegionMutex);
|
||||
return !impl_->tileRegions.contains(key);
|
||||
}
|
||||
|
||||
bool World::compileTileRegion(std::span<const TileKey> tiles,std::uint32_t workerLimit,
|
||||
const JobScheduler& scheduler,std::string& error,
|
||||
std::size_t* outCompiledTiles,
|
||||
@@ -1390,12 +1478,19 @@ namespace VoxelForgeCore
|
||||
&&bHasNativeSurfaceHorizonPlan&&!bHasIslandPlanInTile;
|
||||
const bool bSkipFarShellRepair=key.lod>=7&&bUseNativeSurfaceHorizon;
|
||||
FStandaloneShapeWorld::ResetThreadClassificationStats();
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats();
|
||||
VoxelForgeCore::Heightfield2D::resetThreadColumnCacheStats(
|
||||
options.captureColumnCoordinates);
|
||||
bool bNativeSurfaceTile=false;
|
||||
bool bNativeSurfaceBandSafe=false;
|
||||
double classificationColumnComputeMilliseconds=0.0;
|
||||
if(bHasWorldAssembly)
|
||||
{
|
||||
const double columnMillisecondsBeforeClassification=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
const auto Classification=tileShape.ClassifyBoxDetailed(origin,step,cells);
|
||||
classificationColumnComputeMilliseconds=std::max(0.0,
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds
|
||||
-columnMillisecondsBeforeClassification);
|
||||
bNativeSurfaceTile=Classification.bNativeSurface;
|
||||
// NativeSurfaceDensityAt consumes only the bounded manifest heightfield and its
|
||||
// bounded type-2/type-4 features. Unknown tile occupancy does not make that Z support
|
||||
@@ -1417,7 +1512,7 @@ namespace VoxelForgeCore
|
||||
{
|
||||
out.diagnostics.meshingSkipped=true;
|
||||
const auto Counts=FStandaloneShapeWorld::GetThreadClassificationStats();
|
||||
const auto Columns=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
const auto& Columns=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
out.diagnostics.solidBoxes=Counts.SolidBoxes;
|
||||
out.diagnostics.airBoxes=Counts.AirBoxes;
|
||||
out.diagnostics.mixedBoxes=Counts.MixedBoxes;
|
||||
@@ -1429,7 +1524,16 @@ namespace VoxelForgeCore
|
||||
out.diagnostics.columnCacheHits=Columns.columnHits;
|
||||
out.diagnostics.columnCacheMisses=Columns.columnMisses;
|
||||
out.diagnostics.classificationMilliseconds=Counts.Milliseconds;
|
||||
out.diagnostics.classificationExclusiveMilliseconds=std::max(0.0,
|
||||
Counts.Milliseconds-classificationColumnComputeMilliseconds);
|
||||
out.diagnostics.columnComputeMilliseconds=Columns.columnComputeMilliseconds;
|
||||
if(options.captureColumnCoordinates)
|
||||
{
|
||||
out.diagnostics.columnEvaluationWorkerHash=static_cast<std::uint64_t>(
|
||||
std::hash<std::thread::id>{}(std::this_thread::get_id()))+1u;
|
||||
out.diagnostics.columnCoordinateCaptureComplete=Columns.coordinateCaptureComplete;
|
||||
out.diagnostics.evaluatedColumnCoordinates=Columns.evaluatedCoordinates;
|
||||
}
|
||||
out.densitySampleCount=0;
|
||||
return out;
|
||||
}
|
||||
@@ -1561,9 +1665,20 @@ namespace VoxelForgeCore
|
||||
out.diagnostics.featureListMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-FeatureListStart).count();
|
||||
const ScopedWorldAssemblyFeatureQueriesV1 featureScope(featureQueries);
|
||||
const double ColumnMillisecondsBeforeMeshing=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
const auto MarchingCubesStart=std::chrono::steady_clock::now();
|
||||
FVoxelMeshData mesh=mesher.GenerateMesh(origin,step,cells,nullptr,
|
||||
MeshBandMinZVoxel,MeshBandMaxZVoxel,&sampleCount,nullptr,nullptr,
|
||||
(options.hashDensity||options.captureDensitySamples)?&densityValues:nullptr);
|
||||
const double MarchingCubesWallMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-MarchingCubesStart).count();
|
||||
const double ColumnMillisecondsAfterMeshing=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
out.diagnostics.marchingCubesExclusiveMilliseconds=std::max(0.0,
|
||||
MarchingCubesWallMilliseconds-(ColumnMillisecondsAfterMeshing-ColumnMillisecondsBeforeMeshing));
|
||||
out.diagnostics.marchingCubesColumnComputeMilliseconds=std::max(0.0,
|
||||
ColumnMillisecondsAfterMeshing-ColumnMillisecondsBeforeMeshing);
|
||||
const double MeshingMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-MeshingStart).count();
|
||||
out.diagnostics.farHorizonVersion=key.lod>=4?options.farHorizonVersion:0;
|
||||
@@ -1602,9 +1717,33 @@ namespace VoxelForgeCore
|
||||
{
|
||||
const auto HorizonStart=std::chrono::steady_clock::now();
|
||||
FNativeCapRefinementStats GroundStats;
|
||||
const double ColumnMillisecondsBeforeGround=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
const auto GroundStart=std::chrono::steady_clock::now();
|
||||
if(key.lod>=4)
|
||||
GroundStats=RefineFarNativeGround(world,*impl_->worldAssembly,nativeKey,mesh);
|
||||
const auto CapStats=RefineFarNativeCap(world,*impl_->worldAssembly,nativeKey,mesh);
|
||||
GroundStats=RefineFarNativeGround(world,*impl_->worldAssembly,nativeKey,step,
|
||||
options.lod8HorizonInteriorStepVoxels,mesh);
|
||||
const double GroundWallMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-GroundStart).count();
|
||||
const double ColumnMillisecondsAfterGround=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
out.diagnostics.groundRefinementExclusiveMilliseconds=std::max(0.0,
|
||||
GroundWallMilliseconds-(ColumnMillisecondsAfterGround-ColumnMillisecondsBeforeGround));
|
||||
out.diagnostics.groundRefinementColumnComputeMilliseconds=std::max(0.0,
|
||||
ColumnMillisecondsAfterGround-ColumnMillisecondsBeforeGround);
|
||||
const double ColumnMillisecondsBeforeCap=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
const auto CapStart=std::chrono::steady_clock::now();
|
||||
const auto CapStats=RefineFarNativeCap(world,*impl_->worldAssembly,nativeKey,step,
|
||||
options.lod8HorizonInteriorStepVoxels,mesh);
|
||||
const double CapWallMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-CapStart).count();
|
||||
const double ColumnMillisecondsAfterCap=
|
||||
VoxelForgeCore::Heightfield2D::threadColumnCacheStats().columnComputeMilliseconds;
|
||||
out.diagnostics.capRefinementExclusiveMilliseconds=std::max(0.0,
|
||||
CapWallMilliseconds-(ColumnMillisecondsAfterCap-ColumnMillisecondsBeforeCap));
|
||||
out.diagnostics.capRefinementColumnComputeMilliseconds=std::max(0.0,
|
||||
ColumnMillisecondsAfterCap-ColumnMillisecondsBeforeCap);
|
||||
out.diagnostics.farHorizonMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-HorizonStart).count();
|
||||
out.diagnostics.capRefined=CapStats.Refined;
|
||||
@@ -1619,7 +1758,7 @@ namespace VoxelForgeCore
|
||||
if(bHasWorldAssembly)
|
||||
{
|
||||
const auto Counts=FStandaloneShapeWorld::GetThreadClassificationStats();
|
||||
const auto Columns=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
const auto& Columns=VoxelForgeCore::Heightfield2D::threadColumnCacheStats();
|
||||
out.diagnostics.fieldCalls=Columns.pointCalls;
|
||||
out.diagnostics.floatFieldCalls=Counts.NativeFloatFieldCalls;
|
||||
out.diagnostics.latticeFieldCalls=Counts.NativeLatticeFieldCalls;
|
||||
@@ -1627,7 +1766,17 @@ namespace VoxelForgeCore
|
||||
out.diagnostics.columnCacheHits=Columns.columnHits;
|
||||
out.diagnostics.columnCacheMisses=Columns.columnMisses;
|
||||
out.diagnostics.columnComputeMilliseconds=Columns.columnComputeMilliseconds;
|
||||
out.diagnostics.columnEvaluationExclusiveMilliseconds=Columns.columnComputeMilliseconds;
|
||||
out.diagnostics.classificationMilliseconds=Counts.Milliseconds;
|
||||
out.diagnostics.classificationExclusiveMilliseconds=std::max(0.0,
|
||||
Counts.Milliseconds-classificationColumnComputeMilliseconds);
|
||||
if(options.captureColumnCoordinates)
|
||||
{
|
||||
out.diagnostics.columnEvaluationWorkerHash=static_cast<std::uint64_t>(
|
||||
std::hash<std::thread::id>{}(std::this_thread::get_id()))+1u;
|
||||
out.diagnostics.columnCoordinateCaptureComplete=Columns.coordinateCaptureComplete;
|
||||
out.diagnostics.evaluatedColumnCoordinates=Columns.evaluatedCoordinates;
|
||||
}
|
||||
if(bNativeSurfaceTile)
|
||||
{
|
||||
out.diagnostics.solidBoxes=Counts.SolidBoxes;
|
||||
@@ -1643,6 +1792,7 @@ namespace VoxelForgeCore
|
||||
}
|
||||
out.diagnostics.heightfieldBandLimited=bNativeHeightfieldBandLimited;
|
||||
out.diagnostics.meshingMilliseconds=MeshingMilliseconds;
|
||||
const auto MeshAssemblyStart=std::chrono::steady_clock::now();
|
||||
out.meshPayloadAllocatedBytes=static_cast<std::uint64_t>(mesh.Vertices.GetAllocatedSize())
|
||||
+static_cast<std::uint64_t>(mesh.Normals.GetAllocatedSize())
|
||||
+static_cast<std::uint64_t>(mesh.UVs.GetAllocatedSize())
|
||||
@@ -1686,6 +1836,8 @@ namespace VoxelForgeCore
|
||||
}
|
||||
out.hasDensityHash=out.hasMeshHash=out.hasPayloadHash=out.hasTopologyHash=true;
|
||||
}
|
||||
out.diagnostics.meshAssemblyMilliseconds=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-MeshAssemblyStart).count();
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1027,11 +1027,18 @@ namespace world_assembly_detail
|
||||
std::int64_t wavelengthSubvoxels)
|
||||
{ return FloorDiv(positionSubvoxels * Q16, wavelengthSubvoxels); }
|
||||
|
||||
// Audit-only override; normal tile generation resets this to zero before evaluating a recipe.
|
||||
// Surcharge reservee aux mesures; la generation remet zero avant d'evaluer une recette.
|
||||
inline thread_local std::uint32_t HeightfieldColumnOctaveDrop = 0;
|
||||
|
||||
inline std::int32_t FractalNoiseQ16(std::int64_t xQ16, std::int64_t yQ16,
|
||||
std::int64_t zQ16, std::uint32_t octaves, bool ridged = false)
|
||||
{
|
||||
std::int64_t total = 0, weightSum = 0, weight = Q16, ridgeWeight = Q16;
|
||||
for (std::uint32_t octave = 0; octave < octaves; ++octave)
|
||||
std::uint32_t effectiveOctaves=octaves;
|
||||
if(HeightfieldColumnOctaveDrop!=0&&octaves!=0)
|
||||
effectiveOctaves=std::max(1u,octaves-std::min(octaves-1,HeightfieldColumnOctaveDrop));
|
||||
for (std::uint32_t octave = 0; octave < effectiveOctaves; ++octave)
|
||||
{
|
||||
const std::int64_t scale = 1ll << octave;
|
||||
const std::int64_t noise = Perlin3DQ16(xQ16 * scale,yQ16 * scale,zQ16 * scale);
|
||||
@@ -1487,6 +1494,17 @@ namespace world_assembly_detail
|
||||
HeightfieldColumnStats.columnComputeMilliseconds+=std::chrono::duration<double,std::milli>(
|
||||
std::chrono::steady_clock::now()-start).count();
|
||||
++HeightfieldColumnStats.columnMisses;
|
||||
if(HeightfieldColumnStats.captureCoordinates&&HeightfieldColumnStats.coordinateCaptureComplete)
|
||||
{
|
||||
try
|
||||
{
|
||||
HeightfieldColumnStats.evaluatedCoordinates.push_back({x,y});
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
HeightfieldColumnStats.coordinateCaptureComplete=false;
|
||||
}
|
||||
}
|
||||
entry={&recipe,&plan,recipe.contentHash,plan.contentHash,x,y,column};
|
||||
return column;
|
||||
}
|
||||
@@ -1954,10 +1972,25 @@ HeightfieldPointSample Heightfield2D::point(std::int64_t x, std::int64_t y,
|
||||
return out;
|
||||
}
|
||||
|
||||
void Heightfield2D::resetThreadColumnCacheStats() noexcept
|
||||
{ world_assembly_detail::HeightfieldColumnStats={}; }
|
||||
void Heightfield2D::resetThreadColumnCacheStats(bool captureCoordinates, bool clearCache,
|
||||
std::uint32_t octaveDrop) noexcept
|
||||
{
|
||||
// Diagnostic probes may clear old tile entries before comparing isolated sample grids.
|
||||
// Les sondes de mesure peuvent vider les entrees d'une tuile avant de comparer deux grilles.
|
||||
if(clearCache)world_assembly_detail::HeightfieldColumnCache.fill(
|
||||
world_assembly_detail::HeightfieldColumnCacheEntry{});
|
||||
auto& Stats=world_assembly_detail::HeightfieldColumnStats;
|
||||
world_assembly_detail::HeightfieldColumnOctaveDrop=octaveDrop;
|
||||
Stats.pointCalls=0;
|
||||
Stats.columnHits=0;
|
||||
Stats.columnMisses=0;
|
||||
Stats.columnComputeMilliseconds=0.0;
|
||||
Stats.captureCoordinates=captureCoordinates;
|
||||
Stats.coordinateCaptureComplete=true;
|
||||
Stats.evaluatedCoordinates.clear();
|
||||
}
|
||||
|
||||
HeightfieldColumnCacheStats Heightfield2D::threadColumnCacheStats() noexcept
|
||||
const HeightfieldColumnCacheStats& Heightfield2D::threadColumnCacheStats() noexcept
|
||||
{ return world_assembly_detail::HeightfieldColumnStats; }
|
||||
|
||||
HeightfieldBoxClass Heightfield2D::classifyLatticeBox(std::int64_t minimumX,
|
||||
|
||||
@@ -1237,3 +1237,101 @@ occurred. I did not open the owner's editor, build his project or edit assets, a
|
||||
push or stash.
|
||||
|
||||
— Luna
|
||||
|
||||
|
||||
## World assembler S5 / M3 Round 9 — 2026-10-19
|
||||
|
||||
I separated walkable collision, rendered enclosure, and per-LOD refinement rather than using the
|
||||
moving full-clipmap resident count as a gate. The old standalone order queued and started LOD0 first;
|
||||
the owner-camera trace shows LOD8 queue-wait p95 at 16.290 s and LOD8 build p95 at 365.8 ms. A
|
||||
five-second 60 m/s capture crossed 37 centers and logged 5,006 new requests / 3,211 queued cancels.
|
||||
This establishes queue churn, but not a visual-gap duration or proof that the Unreal actor starves.
|
||||
|
||||
The source candidate gives the shared actor scheduler a collision-ring → coarse-shell → LOD0/1
|
||||
refinement order, retains the authored near reserve while moving, and adds request/start ordinals and
|
||||
discard tracing. Standalone mirrors the order and has a legacy-order control. I did not add an LOD8
|
||||
placeholder because initial overlapping parents do not have an all-descendants swap gate. The loaded
|
||||
full-view capture still shows a large sky region; do not call enclosure passed from tile counts.
|
||||
|
||||
The S4-to-current standalone timing mismatch is unresolved: both report 2,553 tiles, but the current
|
||||
cold CPU run is 16.685 s versus Round 8's 3.107 s. The default-camera first run built only 2,226
|
||||
tiles and was rerun with the owner camera. Spawn samples through 2.0 s and the 60 m/s mid-flight
|
||||
sample are black. No candidate BuildHost, after captures, negative-control run, or S5 hash matrix is
|
||||
available yet.
|
||||
|
||||
I stopped before compiling because plugin-root `CLAUDE.md` §#1 explicitly says never build/compile
|
||||
and to hand off at “ready to build.” The report lists the exact outstanding checks, compile spots,
|
||||
and every failed or corrected run in [WorldAssemblerM3/Round9/REPORT.md](../../WorldAssemblerM3/Round9/REPORT.md).
|
||||
No owner editor/project or asset was touched; no commit, push or stash was made.
|
||||
|
||||
— Luna
|
||||
|
||||
|
||||
## World assembler S6 / M3 Round 10 — 2026-10-19
|
||||
|
||||
The 251 ms staircase was the residency sampler cadence; direct tile apply events are the completion
|
||||
clock. The legacy-order control completed the staged 2,578-key set in 17.412 s. Gating coarse-first
|
||||
admission behind the nine-tile walkable ring reduced it to 11.704 s without delaying that gate
|
||||
(0.632 → 0.627 s). The 12-mesh / 14 ms spawn apply boost did not improve the legacy timeline, so it
|
||||
remains opt-in and the normal 4-mesh / 2 ms guard stays in place. Worker-side work supply/admission
|
||||
remains the measured floor; the trace does not isolate why worker slots stay idle. The 1.57 s aim is
|
||||
still unmet and rendered enclosure remains unproven in the null-RHI harness.
|
||||
|
||||
The corrected standalone 60 m/s route now counts +Y crossings across multi-chunk deltas. Its
|
||||
crossing data is valid, though the latency gate still fails. W1/W8/W16 and all nine LOD hashes match
|
||||
S5. The new trace, regressions, run ledger, exact log-captured command lines, hashes and compile
|
||||
spots are in [WorldAssemblerM3/Round10/REPORT.md](../../WorldAssemblerM3/Round10/REPORT.md).
|
||||
|
||||
— Luna
|
||||
|
||||
|
||||
## World assembler S7 / M3 Round 11 — 2026-10-19
|
||||
|
||||
The BuildHost trace counted the old scheduler declines: after LOD0 completed, coarse work
|
||||
hit the four-slot near reserve for 877 frames; 806 also had finished results waiting to
|
||||
apply and counted against the old cap. The shared dynamic reserve and active-task count cut
|
||||
the cold 2,578-key set from 17.527 s to 7.780 s. The walkable ring is 0.581 s and full
|
||||
LOD0 is 1.439 s, both inside the requested limits. The full set still misses the roughly
|
||||
4.2 s worker-seconds/10-slots estimate, and measured worker task-seconds rose about 10%,
|
||||
so this is a throughput win with a tile-cost question left to profile. The moving trace also
|
||||
shows a separate `bCoreRegionCompilePending` gate: 10 legacy and 11 dynamic submission passes
|
||||
were rejected during region rebuilds despite free slots.
|
||||
|
||||
W1/W8/W16 determinism, Core-off, M2 fixtures, SurfaceWorld/FloatingIslands, S3 ground
|
||||
agreement and S4 cap coverage passed. Three Standalone captures are saved, but their window
|
||||
was hidden/occluded and they do not sign off player-visible enclosure. I reviewed RMC's
|
||||
update batching, async collision and render-proxy paths; no change was clearly worth the
|
||||
measured apply cost this round. Full commands, hashes, RMC source references, quality
|
||||
limits and the async audit are in [WorldAssemblerM3/Round11/REPORT.md](../../WorldAssemblerM3/Round11/REPORT.md).
|
||||
|
||||
No new source file was added. The likely compile spots are `VoxelWorld.cpp` and
|
||||
`VoxelWorld.h` in the VoxelForge runtime module; the harness controls changed in
|
||||
`Tools/TestVoxelForgeCoreWorldHost.ps1`. No owner project/editor, asset or external plugin
|
||||
file was modified. No commit, push or stash was made.
|
||||
|
||||
— Luna
|
||||
|
||||
|
||||
## World assembler S8 / M3 Round 12 — 2026-10-19
|
||||
|
||||
The S7 trace's moving-path `bCoreRegionCompilePending` stop was real: the matched 6 m/s negative
|
||||
control rejected 11 whole scheduler passes while region pages were rebuilt. With concurrent
|
||||
admission enabled, those passes disappeared and 110 unrelated tiles submitted; all 11 support
|
||||
centers still had a ready nine-tile ring. Overall moving worker use stayed near 2.7 of 10 slots, so
|
||||
this closes the region gate without changing the separate spawn bottleneck.
|
||||
|
||||
The 60 m/s + 400 m teleport run admitted independent work too, but most center changes outran the
|
||||
walkable ring. Spawn remains 7.7 s: 306 LOD8 jobs make a broad tail, while no one job exceeds
|
||||
95 ms. The measured queue cap held the slow-apply backlog at 256 results / 76.2 MB; disabling it
|
||||
reached 1,577 / 125.1 MB. Core-off, M2 fixtures, SurfaceWorld, FloatingIslands, S3/S4 and W1/W8/W16
|
||||
checks passed. The optional tick subsystem marker was not added, leaving the 29 ms walk maximum
|
||||
unattributed.
|
||||
|
||||
Full metrics, the matched controls, hashes, commands and async audit are in
|
||||
[`WorldAssemblerM3/Round12/REPORT.md`](../../WorldAssemblerM3/Round12/REPORT.md).
|
||||
|
||||
No new source file was added. Compile spots are `VoxelWorld.cpp/.h`, the Core public header and
|
||||
`VoxelForgeCore.cpp`, `VoxelForgeExploreCommandlet.cpp`, and the BuildHost harness. No owner
|
||||
project/editor, asset or external plugin file was modified; no commit, push or stash was made.
|
||||
|
||||
— Luna
|
||||
@@ -0,0 +1,78 @@
|
||||
# Handoff: speed research moves to abyss (Debian 13, i9-12900HK)
|
||||
|
||||
Written 2026-10-19 by the Windows orchestrator (Claude) for the Claude instance on abyss.
|
||||
|
||||
## Where things stand
|
||||
- Branch `assembler/world`. Rounds S3–S13 committed. Each round's report is `Standalone/Research/WorldAssemblerM3/Round*/REPORT.md`.
|
||||
Latest committed: S13 `87b0e5d` (Round17, a tile-cost breakdown, diagnostics only).
|
||||
- **S14 (Round18) is running on the Windows PC.** Its targets:
|
||||
- LOD0 marching cubes costs 243 ns/sample: find out what's inside it;
|
||||
- fix LOD4's column-cache misses (8,224 vs about 1,700);
|
||||
- add shared column pages only if they're still worth it.
|
||||
|
||||
The Windows side finishes, reviews, commits and pushes it. Pull before you touch Core files.
|
||||
- **Current in-game numbers** (owner plan, BuildHost actor, 25 cm SurfaceWorld, owner's 5800X3D):
|
||||
- full set about 4.9 s (S7: 17.4 s);
|
||||
- walkable ring about 0.51 s;
|
||||
- LOD0 about 1.09 s;
|
||||
- 40 m/s ring 75/75;
|
||||
- about 29 worker-seconds over 8 TaskGraph background workers.
|
||||
- **Open levers, in rough order:**
|
||||
1. the S14 findings;
|
||||
2. a frequency-aware far detail cutoff. A global octave drop failed, and the 2 cm LOD-agreement gate rejects any far
|
||||
simplification, so a screen-space gate would need the owner's OK;
|
||||
3. visibility-aware scheduling in caves;
|
||||
4. RMC batching;
|
||||
5. per-strate voxel size;
|
||||
6. a disk terrain cache.
|
||||
|
||||
The disk cache is approved as a FEATURE (multiplayer-compatible, compression tested), not as a speed fix.
|
||||
|
||||
## Owner rules (non-negotiable)
|
||||
- **Writable scope:** the VoxelForge repo only. On abyss, ask the owner before installing system packages, UE or
|
||||
toolchains.
|
||||
- Never push `main`. Pushing `assembler/world` (and feature branches) is allowed.
|
||||
- **Byte-identical output vs earlier rounds is NEVER a gate.** The gates are:
|
||||
- determinism of the current build across worker counts;
|
||||
- no quality regression;
|
||||
- bump the recipe version when output changes.
|
||||
- **Speed is judged on the cold path** (nothing cached): walking, flying and 40 m/s running must be smooth on a
|
||||
first visit.
|
||||
- Changes go in the shared layer and must benefit every generator family.
|
||||
- Luna (Codex `gpt-6-luna`, effort max) implements; Claude orchestrates. Claude doesn't write code itself. Sol costs
|
||||
20× and is used only for short read-only design asks, with the owner's OK.
|
||||
- **Briefs:**
|
||||
- investigation rounds are open QUESTIONS answered with measurements, not directives;
|
||||
- give the goal, invariants and evidence bar, not the method;
|
||||
- be kind: credit what the last round got right.
|
||||
- Every brief says "Do not commit, push or stash". Claude reviews against the code and captures, then commits
|
||||
specific files (never files over 300 KB, never raw PNGs).
|
||||
- **Owner explanations:**
|
||||
- plain language, headline first;
|
||||
- say what he'll SEE or feel in game;
|
||||
- say what's measured vs inferred.
|
||||
- Plugin hard rules are in `CLAUDE.md`, plus `CODEMAP.md` and `ARCHITECTURE.md` (§8.10 protected invariants).
|
||||
|
||||
## Codex launch (Linux)
|
||||
```
|
||||
codex exec -m gpt-6-luna -c model_reasoning_effort="max" -c sandbox_mode="workspace-write" -c tools.web_search=true - < brief.md > out.log 2>&1
|
||||
```
|
||||
- Launch it as a tracked background task, so you're notified when it ends.
|
||||
- **On "Selected model is at capacity":** wait 120 s, then resume with
|
||||
`codex exec resume <session id> -m gpt-6-luna ... -` and a short "continue where you left off" on stdin.
|
||||
- Watch for runaway processes (more than 40 min) and rounds longer than 6 h.
|
||||
|
||||
## First round on abyss: Linux baseline (proposed)
|
||||
1. **Build.** Get the Core library (`Standalone/Core`) and its headless benchmark/audit/hash tools building with Clang
|
||||
on Linux. The Windows standalone uses MSVC plus a D3D11 viewer, so the viewer stays Windows-only.
|
||||
2. **Baseline.** Record the laptop baseline on its performance cores (plugged in, fixed power profile):
|
||||
- per-LOD tile cost (S13 counters);
|
||||
- standalone full clipmap;
|
||||
- W1/W8/W12 hashes.
|
||||
3. **Determinism.** Compare the hashes against Windows (Round17/Round16 list them). A Linux/Windows mismatch is a real
|
||||
multiplayer finding: dedicated servers usually run Linux.
|
||||
4. **Later, only if the owner agrees and provides UE 5.7 Linux plus his assets:** headless BuildHost (`-nullrhi`)
|
||||
tests on Linux.
|
||||
|
||||
**Not transferable:** cache-size effects (24 MB vs 96 MB L3), thread/slot tuning, smoothness, captures. Those must be
|
||||
confirmed on the owner's Windows PC before they're claimed to him.
|
||||
@@ -0,0 +1,218 @@
|
||||
# World assembler S6 / M3 Round 10 — in-game cold-view time
|
||||
|
||||
**Result:** the 251 ms staircase was trace sampling cadence, not a scheduler tick. On the staged
|
||||
2,578-key SurfaceWorld actor, the default legacy path reached full residency in 17.412 s. Gated
|
||||
coarse-first admission reached it in 11.704 s while the walkable ring time stayed at 0.627 s versus
|
||||
0.632 s. A 12-mesh / 14 ms startup apply budget did not improve the legacy timeline. The remaining
|
||||
floor is on worker-side work supply/admission, not the game-thread apply budget; the trace does not
|
||||
isolate why available worker slots stay idle. The 1.57 s aim remains unmet.
|
||||
This is null-RHI residency evidence, not rendered enclosure proof.
|
||||
|
||||
## 1. Cadence and comparison with S5
|
||||
|
||||
`AVoxelWorld::UpdateChunksAroundPosition` emits `streaming_sample` only when at least 0.25 s has
|
||||
elapsed since its previous sample. S5’s near-251 ms per-LOD staircase was quantized by that observer;
|
||||
it was not a one-LOD-per-tick scheduler throttle. S6 records direct tile-result/apply timestamps and
|
||||
per-frame `ProcessPendingChunks` samples, so the completion table below does not depend on that
|
||||
sampler.
|
||||
|
||||
S5 reported 3.352–6.367 s for its per-LOD residency samples. The Round 9 report did not retain the
|
||||
exact BuildHost command line, executable hash, or raw direct-tile trace for that run. S6 uses the
|
||||
same staged `DA_Settings` SurfaceWorld plan, 25 cm Core scale, 2,578 desired keys, 12-task host setup,
|
||||
and legacy-order controls, but its direct full-set result is 17.412 s. The 250 ms sampling interval
|
||||
cannot explain this larger difference. Treat S5’s 3.35–6.37 s values as a different/unidentified
|
||||
measurement route, not a matched baseline; S6 preserves the direct command lines and hashes below.
|
||||
The Standalone 3.58–3.64 s S5 measurement was CPU-only over 2,553 keys, so it is also not a matched
|
||||
BuildHost apply/collision measurement.
|
||||
|
||||
## 2. Matched BuildHost actor runs
|
||||
|
||||
Fresh sequential processes used the staged owner plan, `CoreVoxelSizeCm=25`, 2,578 desired tiles,
|
||||
`-corelimit=12` (10 active task slots in the actor trace), null RHI, a manually ticked `UWorld` with
|
||||
a 16 ms step, and a +Y 600 cm/s move beginning at 30 s. There was no overlapping Unreal process or
|
||||
build. Full-set time is the actor’s initial desired-set milestone. “LOD0 full” means all 512 visual
|
||||
LOD0 keys, separate from the 9/9 collision walkable gate.
|
||||
|
||||
| Configuration | Full set ready | Walkable ring 9/9 | Full 512-key LOD0 | Count-cap frames / backlog frames | Visible meshes/frame p95/max | Apply CPU p95/max | `UWorld::Tick` spawn p95/max | `UWorld::Tick` walk p95/max |
|
||||
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
||||
| Legacy order, authored 4 / 2 ms budget | 17.412 s | 0.632 s | 2.252 s | 78 / 22 | 4 / 4 | 0.77 / 1.62 ms | 1.406 / 5.059 ms | 1.771 / 29.247 ms |
|
||||
| Legacy order, startup boost on (12 / 14 ms) | 17.346 s | 0.611 s | 2.190 s | 0 / 0 | 4 / 6 | 0.70 / 1.49 ms | 1.301 / 5.429 ms | 1.798 / 28.489 ms |
|
||||
| Coarse-first after ring gate, authored 4 / 2 ms | **11.704 s** | **0.627 s** | 10.201 s | 118 / 48 | 4 / 4 | 0.82 / 1.44 ms | 1.396 / 5.027 ms | 1.911 / 28.276 ms |
|
||||
|
||||
Coarse-first shortened the full desired-set tail by 5.708 s (32.8%) without a walkable-gate
|
||||
regression. It did not make all near detail ready sooner: full LOD0 moved from 2.252 s to 10.201 s.
|
||||
The option therefore stays opt-in pending a rendered view/enclosure check. The apply boost removed
|
||||
cap frames but changed full-set time by only 66 ms (0.4%), so it also stays opt-in. Normal play
|
||||
continues to use the authored 4 visible-mesh / 2 ms limit. These are `UWorld::Tick` CPU samples in a
|
||||
manual null-RHI harness, not full rendered frame times. Walk p95 stayed below 2 ms, but the observed
|
||||
~28–29 ms maxima remain and were not isolated to a single subsystem. Per-frame apply maxima were
|
||||
1.62 ms legacy and 1.44 ms gated coarse-first.
|
||||
|
||||
### Per-LOD cold set
|
||||
|
||||
Each pair is **legacy → gated coarse-first**, from direct tile completion events up to the initial
|
||||
desired-set milestone. Queue values are cumulative tile-seconds, not elapsed wall seconds. The
|
||||
initial set contains 2,578 tile results; empty results are included in the result count and apply
|
||||
time.
|
||||
|
||||
| LOD | Last tile apply (s) | Worker task (s) | Worker queue (tile-s) | Result queue (tile-s) | GT apply (ms) / results |
|
||||
|---:|---:|---:|---:|---:|---:|
|
||||
| 0 | 2.252 → 10.201 | 3.39 → 3.39 | 0.028 → 0.033 | 5.94 → 5.87 | 27.9 → 35.0 / 512 |
|
||||
| 1 | 4.785 → 11.765 | 3.21 → 3.05 | 0.007 → 0.006 | 4.43 → 4.79 | 17.0 → 20.4 / 448 |
|
||||
| 2 | 6.609 → 8.567 | 0.70 → 0.71 | 0.012 → 0.006 | 4.77 → 4.90 | 10.9 → 13.0 / 320 |
|
||||
| 3 | 8.162 → 7.460 | 1.81 → 1.78 | 0.005 → 0.005 | 2.86 → 3.07 | 10.5 → 11.8 / 272 |
|
||||
| 4 | 10.317 → 6.530 | 6.02 → 6.08 | 0.004 → 0.006 | 2.16 → 2.62 | 26.5 → 24.9 / 272 |
|
||||
| 5 | 11.494 → 5.182 | 1.42 → 1.42 | 0.003 → 0.003 | 2.20 → 2.40 | 18.4 → 15.9 / 208 |
|
||||
| 6 | 12.483 → 4.438 | 1.85 → 1.90 | 0.002 → 0.002 | 1.58 → 1.65 | 15.2 → 12.8 / 144 |
|
||||
| 7 | 13.198 → 3.852 | 1.74 → 1.75 | 0.001 → 0.001 | 0.88 → 1.02 | 16.7 → 13.5 / 96 |
|
||||
| 8 | 17.476 → 3.432 | 17.50 → 19.29 | 0.005 → 0.465 | 2.59 → 2.62 | 95.0 → 87.0 / 306 |
|
||||
|
||||
Per-frame visible mesh counts and the largest per-LOD apply sample were:
|
||||
|
||||
| LOD | Visible meshes/frame p95/max, legacy → coarse | Max LOD apply/frame, legacy → coarse |
|
||||
|---:|---:|---:|
|
||||
| 0 | 2 / 4 → 3 / 4 | 0.762 → 0.934 ms |
|
||||
| 1 | 1 / 4 → 1 / 4 | 0.630 → 0.809 ms |
|
||||
| 2 | 0 / 4 → 1 / 4 | 0.533 → 0.639 ms |
|
||||
| 3 | 0 / 4 → 1 / 4 | 0.515 → 0.570 ms |
|
||||
| 4 | 2 / 4 → 3 / 4 | 0.605 → 1.354 ms |
|
||||
| 5 | 1 / 3 → 2 / 4 | 1.272 → 0.742 ms |
|
||||
| 6 | 0 / 4 → 1 / 4 | 0.687 → 0.708 ms |
|
||||
| 7 | 0 / 4 → 0 / 4 | 0.974 → 0.732 ms |
|
||||
| 8 | 2 / 4 → 3 / 4 | 1.625 → 1.439 ms |
|
||||
|
||||
The 10-task-slot slack estimate was 132.1 slot-seconds on legacy order and 73.3 on coarse-first,
|
||||
computed as ten slots × (first request to full-set ready) minus measured worker-task seconds. The
|
||||
shared pool averaged 3.27 / 4.21 running workers on frames with estimated pending results; one
|
||||
legacy backlog frame had no running worker, versus none in the coarse-first run. Idle worker time
|
||||
and apply-cap frames are shared-pool/world properties, so a per-LOD split would double-count them.
|
||||
Legacy used 37.64 worker-seconds and coarse-first 39.36; pre-start worker-queue wait was only
|
||||
0.067 / 0.527 tile-seconds. Result-queue wait summed to 27.41 / 28.94 tile-seconds. Game-thread
|
||||
tile-apply time was about 0.24 / 0.23 seconds for the cold set. The boost run had no apply-cap or
|
||||
result-backlog frames and still took 17.346 s. Thus the apply cap is not the end-to-end floor. The
|
||||
remaining floor is worker-side work supply/admission; the trace does not isolate why available
|
||||
worker slots stay idle or identify a safe single worker-side change for this round.
|
||||
|
||||
Collision is currently required only on the LOD0 path. The trace captured 60 body-update events in
|
||||
each cold run; 60 of 125 collision-desired entries were ready by the full-set milestone, while
|
||||
non-required/empty entries were classified separately. RealtimeMesh submit-to-body-update latency
|
||||
(not isolated Chaos CPU cooking) was legacy p50/p95/max 17.02 / 17.89 / 18.04 ms, boost 16.80 /
|
||||
17.51 / 17.70 ms, and coarse-first 17.08 / 18.01 / 18.30 ms. The nine required ring tiles were ready
|
||||
at the gate times above. LOD1–8 had no collision-ready events in this trace.
|
||||
|
||||
## 3. Shared change and standalone crossing instrument
|
||||
|
||||
`voxel.StreamingCoarseFirst=1` now starts far-level admissions only after all nine required
|
||||
walkable-ring collision gates are ready. `voxel.StreamingDynamicNearReserve=1` keeps the authored
|
||||
near reserve while moving or before that gate; after a stationary gate it lets coarse work use the
|
||||
reserved slots. Both are explicit, default-off controls. `voxel.StreamingStartupApplyBoost=1` allows
|
||||
12 visible-mesh applies / 14 ms during the initial desired-set and walkable-ring phase, with a 30 s
|
||||
ceiling; zero keeps the authored budget. It is not preemptive within one apply, so it remains opt-in.
|
||||
This behavior is in shared `AVoxelWorld::UpdateChunksAroundPosition` / `ProcessPendingChunks` and
|
||||
does not change density, tile output, or collision policy.
|
||||
|
||||
The standalone 60 m/s flight instrument now counts forward +Y chunk crossings using the actual
|
||||
center delta, including multi-chunk jumps. The valid viewer route completed 250/250 center samples,
|
||||
with 226 center updates and max forward delta +2. It reports `crossing_deltas=forward-+Y`,
|
||||
resident 2,553/2,553 and no missing tiles. Latency still **fails**: nearest-ready p50/p95/max was
|
||||
9.087 / 20.594 / 128.785 ms and maximum crossing wall time 42.931 s. The earlier
|
||||
`--stream-benchmark` and `--stream-pipeline` invocations emitted no Flight markers; only the viewer
|
||||
route is used for this result.
|
||||
|
||||
## 4. Hashes, regression checks and async audit
|
||||
|
||||
Standalone W1/W8/W16 fresh processes produced identical full-world and all nine per-LOD hashes;
|
||||
all match S5. Full world identity: density `c10697a8f48380c7`, mesh `430d2be2bdd8b988`, payload
|
||||
`b7b33e14092225c9`, topology `c5c46d66606a819e`.
|
||||
|
||||
- Core-off legacy at 12.5 cm: **PASS**, `VOXELFORGE_CORE_OFF_LEGACY_PASS`.
|
||||
- M2 V1 and V2: **PASS**, five fixtures plus same-LOD border for each.
|
||||
- SurfaceWorld and FloatingIslands BuildHost at 25 cm: **PASS**. FloatingIslands W1/W8/W16
|
||||
matched Standalone; the final Standalone W1/W8/W16 matrix also matched across all nine LODs and S5.
|
||||
- S4 cap census/agreement and ray coverage: **PASS**; 551 requested/emitted cap bands, 1,584/1,584
|
||||
coverage rays, 128-point cap agreement max 0.0504 cm against 2 cm tolerance, negative control
|
||||
detected.
|
||||
- S3 ground and S4 LOD7/8 ground agreement: **PASS**; max ground delta 0.0427 cm, cross-LOD 0.0 cm,
|
||||
and the negative control was detected.
|
||||
- Water remains fixed for the season; player carve/fill stays unrestricted.
|
||||
|
||||
Diff audit: `GenerationEpoch` is carried and stale epochs are rejected; the four result queues remain
|
||||
`EQueueMode::Mpsc`; `EndPlay` sets shutdown, waits for active work and drains the queues; workers
|
||||
check `bShuttingDown`; `ModsLock` behavior is unchanged; all UObject/RealtimeMesh component creation
|
||||
and mutation stays on the game thread. No density-sign or determinism path changed. The added C++
|
||||
comments are French and English. No generated header, `Binaries/`, or `Intermediate/` source edits.
|
||||
|
||||
## 5. Exact commands, binaries and run ledger
|
||||
|
||||
BuildHost actor runs used `E:\Program Files\Epic Games\UE_5.7\Engine\Binaries\Win64\UnrealEditor-Cmd.exe`
|
||||
with `-nullrhi -unattended -corelimit=12 -run=VoxelForgeExplore -seed=0 -archetype=TunnelNetwork
|
||||
-coreworldtest=1 -corevoxelsizecm=25 -settingsref=/Game/VoxelForge/DA_Settings.DA_Settings
|
||||
-coreworldstreamtrace=1 -voxel.TestMove=1 -voxel.TestMoveSpeedCmPerSecond=600
|
||||
-voxel.TestMoveStartSeconds=30 -voxel.TestMoveDirection=0,1,0
|
||||
-voxel.StartupTraceUntilEndPlay=1 -voxel.CollisionGate=0`. The exact expanded `LogInit: Command Line:`
|
||||
including project, DDC, trace and output paths is preserved verbatim in each [legacy run](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_legacy_order_trace.stdout.log),
|
||||
[boost run](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_1_legacy_order_trace.stdout.log),
|
||||
and [gated coarse run](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_coarse_first_trace.stdout.log).
|
||||
Their CVar overrides were respectively:
|
||||
|
||||
| Run | `StreamingCoarseFirst` | `StreamingDynamicNearReserve` | `StreamingStartupApplyBoost` |
|
||||
|---|---:|---:|---:|
|
||||
| Legacy negative control | 0 | 0 | 0 |
|
||||
| Apply-budget A/B | 0 | 0 | 1 |
|
||||
| Gated coarse-first | 1 | 1 | 0 |
|
||||
|
||||
Standalone 60 m/s exact command (also in [commands.txt](../../../../Saved/BuildHost/S6/standalone/commands.txt)):
|
||||
|
||||
```text
|
||||
Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-prototype --force-generate --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --test-flight-crossings=250 --flight-speed-mps=60 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
| Executable / module | SHA-256 |
|
||||
|---|---|
|
||||
| BuildHost `UnrealEditor-Cmd.exe` | `ECCE9996191F7F7E69B3D104EECDD0E678AE69176FDCCD79828C3E75A0654D6D` |
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` | `1C083446ED360FBD798EAE4C4D3CA9E5994E906770B5017A51418BFEF46C30FA` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `54259552340FE81EA05640C622E9E5E5C0AC68C95F87DC718326D25EF133B2AC` |
|
||||
| Standalone `VoxelForgeCoreStandalone.exe` | `1F445760AFDE264E2F28F8F2FB4CB68DBD0C8988AACD5A493B065E74C1827529` |
|
||||
|
||||
BuildHost UBT passed twice at 12 actions / Normal priority. `& .\Standalone\Build.ps1 -Target All
|
||||
-CompileWorkers 12 -BuildPriority Normal` passed. Existing vswhere/C4838 warnings did not fail the
|
||||
Standalone build. The S6 hash and 60 m/s logs are in [Saved/BuildHost/S6/standalone](../../../../Saved/BuildHost/S6/standalone/).
|
||||
|
||||
Failed/retried attempts, including setup failures:
|
||||
|
||||
- An earlier full actor attempt reached its 600 s timeout in the Standalone-reference preamble; it
|
||||
left a partial trace. A first trace-only command omitted its required startup-trace output path
|
||||
and exited before the actor run; the helper now makes `StreamingTraceOnly` imply trace output.
|
||||
- Two fresh-shell memory preflights lacked the local `Add-Type` helper and stopped before launching
|
||||
Unreal. The corrected `GlobalMemoryStatusEx` preflight ran before later launches.
|
||||
- Early coarse-first attempts did not parse the requested CVar in headless `BeginPlay`; trace values
|
||||
showed legacy LOD0-first order. Explicit CVar parsing fixed the A/B. An ungated coarse-first run
|
||||
then delayed the walkable gate to 1.653 s; admission was changed to wait for 9/9 and rerun.
|
||||
- FloatingIslands at 25 cm hit its 120 s test timeout; the bounded 600 s retry passed in 192 s.
|
||||
- The first `--stream-benchmark` and `--stream-pipeline` sprint commands emitted no Flight markers.
|
||||
The corrected viewer command above produced valid crossing deltas, with the latency failure
|
||||
reported rather than hidden.
|
||||
- Unsupported `-RunName`, a fresh-shell type reuse, and one PowerShell metric-parser expression
|
||||
failed before/after measurement without changing an Unreal run. The corrected command/parser
|
||||
produced the data above.
|
||||
|
||||
Every Unreal launch was sequential, with more than 17 GiB free memory at the final launch checks;
|
||||
actor-harness peak was about 3.5 GiB and all measured processes stayed under 8 GiB. No run returned
|
||||
`0xC0000142`. Crash audit found no new UECC folder; the only folder is the pre-existing
|
||||
`UECC-Windows-F1A3EFD5469F5DD62E68EBBACAC84376_0000` dated 2026-09-17. Test stdout and JSONL traces
|
||||
remain under `Saved/BuildHost/...`; none were copied into `Research/`.
|
||||
|
||||
## 6. Files and compile spots
|
||||
|
||||
No new C++ source file was added. Modified source files and likely compile spots:
|
||||
|
||||
- `Source/VoxelForge/Private/VoxelWorld.cpp`, `Source/VoxelForge/Public/VoxelWorld.h`,
|
||||
`Source/VoxelForge/Private/VoxelStartupTrace.cpp`,
|
||||
`Source/VoxelForge/Public/VoxelStartupTrace.h` — VoxelForge runtime module; BuildHost UBT.
|
||||
- `Source/VoxelForgeEditor/Private/VoxelForgeExploreCommandlet.cpp` — editor module; BuildHost UBT.
|
||||
- `Standalone/Source/StandaloneViewer.cpp` — `Standalone/Build.ps1 -Target All`.
|
||||
- `Tools/TestVoxelForgeCoreWorldHost.ps1` — harness argument/default changes; no C++ compile.
|
||||
- `CODEMAP.md` §3, `ARCHITECTURE.md` §8.27, this report, and
|
||||
`Standalone/Research/OwnerShapeWorld/gpu_field_port/LUNA_DIALOGUE.md` — documentation.
|
||||
|
||||
No owner file or asset was touched; no commit, push or stash was made.
|
||||
@@ -0,0 +1,261 @@
|
||||
# World assembler S7 / M3 Round 11 — scheduler admission and RMC review
|
||||
|
||||
**Result:** the cold full set fell from 17.595 s on the S7 legacy control to 7.762 s with
|
||||
the shared scheduler change. The 0.581 s walkable ring and 1.437 s full LOD0 meet the
|
||||
0.63 s and 2.25 s targets. The 7.76 s full set still misses the roughly 4.2 s
|
||||
worker-seconds / 10-slots estimate. RMC section-update batching was reviewed but not
|
||||
implemented: measured game-thread tile apply is only about 0.24 s for the whole set, and
|
||||
the null-RHI run cannot measure render-proxy cost.
|
||||
|
||||
## 1. What the trace says
|
||||
|
||||
`UpdateChunksAroundPosition` runs each world tick. For the 2,578-key spawn, the per-frame
|
||||
trace found the decline after that call, in admission accounting:
|
||||
|
||||
| Admission evidence | Count / example | Meaning |
|
||||
|---|---:|---|
|
||||
| Legacy near reserve after no LOD0 keys remained, with LOD1+ still missing | 876 frames | The four reserved near slots stayed unused while coarse keys were eligible. |
|
||||
| Those frames with a positive finished-result estimate | 806 / 877 | `PendingTiles` included completed results waiting for game-thread apply. |
|
||||
| Representative legacy frame | t=3.292474 s: active=4, completed estimate=2, cap occupancy=6/10 | The old pending-result count hit the coarse cap although only four tasks were queued/running. |
|
||||
| Dynamic admission passes before the initial full-set milestone | 409 | Ten ended with missing keys and a post-pass sample below the 10-task count. All ten recorded a submission stop at cap 10. |
|
||||
| Declines in those ten dynamic passes | 0 reserve, 0 all-loaded, 0 walkable-gate failure, 0 inner `LoadTile` rejection | A worker could finish between the full-cap stop and the end-of-pass sample, leaving occupancy at 9/10; the stop fields show that the pass had hit cap 10. |
|
||||
|
||||
The two old blockers were independent: the near reserve capped coarse admission at six,
|
||||
and completed-but-unapplied results occupied the old `PendingTiles` cap. The scheduler now
|
||||
counts `ActiveTaskCount` (queued and running tasks); `PendingTiles` remains through apply
|
||||
for duplicate suppression and result bookkeeping. The default `voxel.StreamingDynamicNearReserve=1`
|
||||
keeps the near reserve while moving or before the stationary walkable gate, then releases
|
||||
it to coarse work. `voxel.StreamingLegacyPendingResultCap=1` and the harness legacy mode
|
||||
restore both old behaviors for the negative control.
|
||||
|
||||
Across the complete 45 s trace (including movement from t=30 s), the end-of-update records
|
||||
contained both missing keys and observed capacity below 10 in 1,236 legacy and 280 dynamic
|
||||
frames. Per-LOD reason codes classify the legacy set as reserve in 1,226 frames and inner
|
||||
loader return in 10. The dynamic trace has reserve in 259, full-cap stop in 12 and inner
|
||||
loader return in 11; codes can overlap when different LODs hit different rules in one
|
||||
update. No free-capacity frame had an unclassified missing LOD. The four additional legacy
|
||||
`scheduler_skip` records with missing keys were region-compile gates, described below.
|
||||
In `declined_rule_by_lod`, codes are 1=full task cap, 2=near reserve, 3=all-loaded latch,
|
||||
4=inner `LoadTile`/`LoadCoreTile` return, and 5=work still missing with apparent capacity.
|
||||
Dynamic code-2 frames include the intentional near reserve held while moving; the trace
|
||||
keeps this distinct from a worker-pool or result-accounting stall.
|
||||
|
||||
Admission itself is no longer the measured source of idle slots on the dynamic spawn: each
|
||||
pass submitted work or recorded a stop at the 10-task cap. The ten end-of-pass samples that
|
||||
showed missing keys and occupancy 9/10 had already recorded that full-cap stop; a worker
|
||||
finished before the trace snapshot. Cumulative task intervals show
|
||||
5.63 busy-worker equivalents over first request to ready, with eight sustained overlapping
|
||||
tile tasks; one zero-duration endpoint tie counts nine. This does not identify whether the
|
||||
remaining gap comes from UE task-pool dispatch or work within a tile. Boundary samples of
|
||||
`running_workers` alias short task bursts and are not a time average.
|
||||
|
||||
The same 45 s actor run also includes a +Y move beginning at t=30 s. On that moving path,
|
||||
`LoadCoreTile`'s `bCoreRegionCompilePending` early return (`VoxelWorld.cpp:12224`) is a
|
||||
separate gate. The trace recorded four top-level region-compile skips in the legacy control
|
||||
with 116–187 desired keys missing and only 0–1 active tasks. It also recorded 10 legacy and
|
||||
11 dynamic admission passes with inner load declines; every one had
|
||||
`core_region_compile_pending=1`, zero submissions, and 108–190 legacy or 92–144 dynamic tile
|
||||
attempts.
|
||||
This explains idle slots during those region rebuilds, but it occurs after the cold initial
|
||||
set and is separate from the reserve/result-count fix. The initial 20 `core_not_ready`
|
||||
skips had zero missing desired keys; no all-loaded latch skip had missing work.
|
||||
|
||||
## 2. Matched BuildHost result
|
||||
|
||||
Fresh sequential null-RHI processes used the staged owner `SurfaceWorld` plan, seed 0,
|
||||
25 cm Core scale, 2,578 desired keys, 10 actor task slots, a manually ticked world at 16 ms,
|
||||
and a +Y 600 cm/s move beginning at 30 s. Apply boost and coarse-first were off in both S7
|
||||
runs. “Idle slot-s” is `10 × (first request to full ready) − cumulative worker task time`;
|
||||
busy equivalents use the same interval. S6's 3.27 average was sampled only on frames with
|
||||
pending results and is not directly comparable to the integrated S7 value.
|
||||
|
||||
| Run | Full set | Walkable 9/9 ring | Full LOD0 (512) | Worker task-s | Integrated busy equivalents | Idle slot-s | Tick spawn p95/max | Tick walk p95/max |
|
||||
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
||||
| S6 legacy reference | 17.412 s | 0.632 s | 2.252 s | 37.64 | 3.27 sampled on pending-result frames | 132.1 | 1.406 / 5.059 ms | 1.771 / 29.247 ms |
|
||||
| S7 old-path negative control | 17.527 s | 0.650 s | 2.281 s | 37.696 | 2.208 | 133.012 | 1.437 / 5.286 ms | 1.957 / 29.244 ms |
|
||||
| S7 dynamic reserve + active-task cap | **7.780 s** | **0.581 s** | **1.439 s** | 41.364 | **5.634** | **32.056** | 2.262 / 5.230 ms | 2.512 / 28.893 ms |
|
||||
|
||||
The negative control reproduces S6 legacy within 0.7% in full-set time and 0.2% in worker
|
||||
task-seconds. Dynamic admission cuts full-set time by 55.3%, reduces idle slots by about
|
||||
76% against S6, and meets both near-work targets. It does not meet the roughly 4.14 s
|
||||
`41.364 / 10` estimate. Measured worker task time rose about 9.7% versus the S7 negative
|
||||
control (about 16.04 ms per initial tile versus 14.62 ms). Geometry hashes did not change
|
||||
and the density/mesh recipe was untouched; the trace measures task elapsed time, not CPU
|
||||
cycles, so it cannot separate contention from other elapsed-time variation. This is a
|
||||
measured tile-cost increase to watch in a rendered/profiled run, not evidence of a content
|
||||
quality change.
|
||||
|
||||
The largest walk `UWorld::Tick` sample remains about 29 ms. The trace wraps aggregate
|
||||
`TestWorld->Tick()` at `VoxelForgeExploreCommandlet.cpp:17495–17501`; it has no subsystem
|
||||
marker at the maximum, so the owner cannot be named from this trace. Null RHI also means
|
||||
these are not rendered frame times.
|
||||
|
||||
## 3. RealtimeMeshComponent review
|
||||
|
||||
VoxelForge creates plain `FRealtimeMeshStreamSet` data in `BuildTileStreamSet`
|
||||
(`Source/VoxelForge/Private/VoxelWorld.cpp:616`, called from worker paths at 12441 and
|
||||
12876). Component mutation stays on the game thread in `ApplyMeshToTile` (13064): each tile
|
||||
removes and recreates one section group and sets its material slots (13273–13288). Ground
|
||||
and cap are material/polygroup sections in that tile group; the world uses clipmap tiles,
|
||||
not an RMC multi-LOD chain. The whole cold set's measured game-thread apply was about
|
||||
0.24 s in S6 (roughly 3% of the S7 7.76 s wall time).
|
||||
|
||||
Ranked opportunities, with this round's evidence:
|
||||
|
||||
1. **Batch a tile's RMC writes.** RMC's `Public/Data/RealtimeMeshUpdateBuilder.h:390–406`
|
||||
documents grouping mesh, LOD, section-group, section and collision updates behind one
|
||||
write lock and proxy publish; `Private/Data/RealtimeMeshUpdateBuilder.cpp:222` commits,
|
||||
with render work queued at 64–67. This could trim game-thread update overhead, but the
|
||||
measured apply ceiling is only ~0.24 s for 2,578 tiles. It is not the cold-set floor.
|
||||
2. **Measure fast collision cooking.** RMC `Public/Core/RealtimeMeshCollision.h:32–55`
|
||||
exposes async cook, fast cook, complex-as-simple, normal flipping, deformable collision
|
||||
and mesh merging. The current BuildHost trace reports async=1, complex-as-simple=1,
|
||||
fast-cook=0, merge=0; async cooking is dispatched in
|
||||
`Private/RealtimeMeshManaged.cpp:695–707`. Cook CPU is not isolated by the existing
|
||||
submit-to-body-update measurement, and changing cook mode could affect collision
|
||||
quality, so defer until collision timing and walkability are audited together.
|
||||
3. **Batch across tiles / share mesh components.** This might reduce component and proxy
|
||||
overhead, but RMC builder commits target a mesh and VoxelForge's per-tile collision,
|
||||
unload and transition ownership would change. Larger risk than the measured apply cost.
|
||||
4. **Use RMC's LOD/section-group structure more broadly.** RMC has explicit LOD and section
|
||||
group update operations (builder header above); VoxelForge currently creates one group
|
||||
per tile and changes clipmap tiles between LODs. A multi-LOD mesh would be an architectural
|
||||
change, with no null-RHI timing evidence for a payoff.
|
||||
5. **Render resource/proxy work.** `Private/RenderProxy/RealtimeMeshGPUBuffer.cpp:49–60`
|
||||
creates resources asynchronously only when the RHI supports multithreaded resources;
|
||||
otherwise it falls back to the render thread. RMC's proxy publish path is in the builder
|
||||
implementation above. Null RHI cannot measure either path, so no change was made.
|
||||
|
||||
No RMC files were modified. Its source was read only at
|
||||
`E:\Projet Unreal\VoxelM\Plugins\RealtimeMeshComponent`.
|
||||
|
||||
## 4. Quality and determinism
|
||||
|
||||
- Standalone W1/W8/W16 produce identical full and LOD0–8 hashes: density
|
||||
`c10697a8f48380c7`, mesh `430d2be2bdd8b988`, payload `b7b33e14092225c9`, topology
|
||||
`c5c46d66606a819e`. The parser's first ad-hoc comparison was corrected; a direct per-LOD
|
||||
comparison shows all nine levels equal.
|
||||
- BuildHost SurfaceWorld at 25 cm passed the full actor/collision/anchor/carve check and
|
||||
W1/W8/W16 matrix. Hashes: density `0cd2a1a4152ee4aa`, mesh `80a5b054b904b1a2`, payload
|
||||
`bf2f1b40dff38acc`, topology `56074198682d5e18`.
|
||||
- Core-off legacy at 12.5 cm passed. M2 V1 and V2 each passed five fixtures plus same-LOD
|
||||
border checks. FloatingIslands at 25 cm passed W1/W8/W16, fixed water, edits, collision,
|
||||
LOD0 and LOD1.
|
||||
- S3 ground / S4 LOD7–8 agreement passed: maximum ground delta 0.0427 cm, cross-LOD delta
|
||||
0.0 cm, and the 100 cm datum-offset negative control was detected.
|
||||
- S4 Standalone far-cap audit passed: 385/385 requested cap bands emitted; 128 agreement
|
||||
points had 0.0504 cm maximum error against 2 cm tolerance; the 100 cm bad-datum control
|
||||
was detected; 2,520/2,520 rays covered all 35 view points.
|
||||
- Three Standalone spawn captures are under `Saved/BuildHost/S7/captures/`; each is
|
||||
4,097,178 bytes. Sampled terrain surfaces show no obvious opening. The capture window
|
||||
reported hidden/occluded, so these back-buffer submissions are not an owner-visible
|
||||
enclosure sign-off. The standalone does not mirror the shared Unreal actor scheduler.
|
||||
[Frame 00](../../../../Saved/BuildHost/S7/captures/s7_spawn_view_00.png),
|
||||
[frame 01](../../../../Saved/BuildHost/S7/captures/s7_spawn_view_01.png), and
|
||||
[frame 02](../../../../Saved/BuildHost/S7/captures/s7_spawn_view_02.png).
|
||||
- Scheduler changes did not alter tile output hashes, so the recipe/version is unchanged.
|
||||
Water remains fixed for the season; player carve/fill remains unrestricted.
|
||||
|
||||
## 5. Build, commands and run record
|
||||
|
||||
BuildHost compilation passed with 12 actions and normal priority:
|
||||
|
||||
```powershell
|
||||
& '.\Tools\BuildVoxelForgeCoreHost.ps1' -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The first build attempt failed on duplicate `TraceNow` declarations (`C2374` / `C2086`); I
|
||||
removed the duplicate and rebuilt successfully. The final build's async-safety checks passed.
|
||||
The standalone full build passed:
|
||||
|
||||
```powershell
|
||||
& '.\Standalone\Build.ps1' -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
```
|
||||
|
||||
It warned that `vswhere.exe` was not recognized and reported existing C4838 conversions in
|
||||
`VoxelStrateManager.cpp:3974–3975`; it still completed successfully.
|
||||
|
||||
BuildHost quality commands (all passed):
|
||||
|
||||
```powershell
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The final extra trace fields only report Core readiness/region-compile state; they do not
|
||||
change tile generation. After adding them I rebuilt and reran both matched actor modes.
|
||||
|
||||
Matched BuildHost actor commands:
|
||||
|
||||
```powershell
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Legacy -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
& '.\Tools\TestVoxelForgeCoreWorldHost.ps1' -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Standalone W1/W8/W16 command template (substitute `1`, `8`, `16`; each was a fresh process):
|
||||
|
||||
```powershell
|
||||
Standalone\bin\VoxelForgeCoreStandalone.exe --workers=1 --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
Standalone S4 audit command:
|
||||
|
||||
```powershell
|
||||
Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-audit --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
The first capture attempt added `--stream-benchmark` to the viewer capture command. It exited
|
||||
0 but generated no PNG because the benchmark path exits before the viewer capture loop. The
|
||||
corrected command was:
|
||||
|
||||
```powershell
|
||||
Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-prototype --force-generate --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60 --capture-spawn-sequence-prefix=E:\Projet Unreal\VoxelM\Plugins\VoxelForge\Saved\BuildHost\S7\captures\s7_spawn_view --quit-after-spawn-captures
|
||||
```
|
||||
|
||||
The three capture outputs and standalone logs are under `Saved/BuildHost/S7/`. BuildHost
|
||||
stdout and JSONL traces are under
|
||||
`Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/`; the
|
||||
expanded Unreal command lines are preserved in those stdout logs: [legacy stdout](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_legacy_order_nearreserve_legacy_trace.stdout.log),
|
||||
[legacy JSONL](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_legacy_order_nearreserve_legacy_trace.trace.jsonl),
|
||||
[dynamic stdout](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_legacy_order_nearreserve_dynamic_trace.stdout.log),
|
||||
and [dynamic JSONL](../../../../Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_legacy_order_nearreserve_dynamic_trace.trace.jsonl). The legacy/dynamic pair
|
||||
used the wrapper commands above, staged `DA_Settings`, `-nullrhi -unattended -nop4
|
||||
-nosplash -NoSound -corelimit=12 -run=VoxelForgeExplore -seed=0 -archetype=TunnelNetwork
|
||||
-coreworldtest=1 -corevoxelsizecm=25 -settingsref=/Game/VoxelForge/DA_Settings.DA_Settings
|
||||
-coreworldstreamtrace=1 -voxel.TestMove=1 -voxel.TestMoveSpeedCmPerSecond=600
|
||||
-voxel.TestMoveStartSeconds=30 -voxel.TestMoveDirection=0,1,0
|
||||
-voxel.StartupTraceUntilEndPlay=1 -voxel.CollisionGate=0`, and the recorded mode CVars.
|
||||
|
||||
SHA-256 of the executables/modules used for these runs:
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| UE 5.7 `UnrealEditor-Cmd.exe` | `ECCE9996191F7F7E69B3D104EECDD0E678AE69176FDCCD79828C3E75A0654D6D` |
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` | `29CFC3AB0BDF0B6048029660160D38F8AC3E9FF59ED057BD06D4CA42C3FFBBD2` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `54259552340FE81EA05640C622E9E5E5C0AC68C95F87DC718326D25EF133B2AC` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `5FF5FCF82EC59A61319CBF979EC9A7BA081971B4D35088082BBF7A81C4C4794D` |
|
||||
| `Standalone/bin/VoxelForgeCoreStandalone.exe` | `0F1610730D9BC038E9E60B5ECBF84BA8AD562748E2737F7C1C288F8CE0FE0CED` |
|
||||
|
||||
All runs were sequential at normal priority, with at most 12 build/Standalone workers;
|
||||
BuildHost tests used the harness's 12-core limit. Free memory was at least 17.4 GB before
|
||||
each actor launch; the largest BuildHost quality process stayed below 3.58 GB (the final A/B
|
||||
actors stayed below 3.53 GB; Standalone capture below 1.14 GB). No process exceeded 8 GB.
|
||||
The WMI memory query was denied, so preflight used `GlobalMemoryStatusEx`. No new `UECC-*`
|
||||
folder or `0xC0000142` occurred; the
|
||||
only crash directory is the pre-existing 2026-09-17 `UECC-Windows-F1A3EFD5469F5DD62E68EBBACAC84376_0000`.
|
||||
|
||||
Async diff audit: `GenerationEpoch` still rejects stale work; the result queues remain
|
||||
`EQueueMode::Mpsc`; `EndPlay` sets shutdown, waits for tasks and drains queues; workers check
|
||||
`bShuttingDown`; `ModsLock` is unchanged; UObject and RMC component mutation remains on the
|
||||
game thread. No generated header, `Binaries/`, or `Intermediate/` source was edited. No new
|
||||
source file was added. Modified compile spots are `Source/VoxelForge/Private/VoxelWorld.cpp`
|
||||
(CVar setup, admission accounting, task lifetime accounting and trace) and
|
||||
`Source/VoxelForge/Public/VoxelWorld.h` (scheduler/task bookkeeping comments and declarations);
|
||||
the expected compile target is the VoxelForge runtime module for Win64 Development in the
|
||||
BuildHost. `Tools/TestVoxelForgeCoreWorldHost.ps1` changed only the harness controls.
|
||||
|
||||
No owner project/editor or asset was opened, built or edited. RealtimeMeshComponent was
|
||||
read-only; no external source was changed. No commit, push or stash was made.
|
||||
@@ -0,0 +1,233 @@
|
||||
# World assembler S8 / M3 Round 12 — moving region admission and bounded results
|
||||
|
||||
**Result:** the S7 region-pending stop is removed for independent tiles. At 6 m/s, the matched
|
||||
negative control logged 11 global admission skips; the new mode logged none and admitted 110
|
||||
independent tiles during those windows. All 11 changed support centers had a ready 9/9 walkable
|
||||
ring. This did not materially change overall moving worker occupancy: about 110 of 150 moving
|
||||
slot-seconds remained idle. A 60 m/s teleport run admitted unrelated tiles too, but most centers
|
||||
still outran their walkable ring.
|
||||
|
||||
The result queue is now separately bounded at 256 queued results + admitted tile tasks + held
|
||||
prequeue results. Under one-result-per-frame apply with a 60 m/s run and 400 m teleport, the tracked
|
||||
result payload peak was 76.2 MB; the uncapped control reached 125.1 MB. Spawn remains about 7.7 s,
|
||||
not the roughly 4.1 s ideal from 41 worker-seconds / 10 slots. The timeline shows a broad LOD8 tail,
|
||||
not one abnormally long tile. No safe low-cost spawn fix was supported by this measurement.
|
||||
|
||||
## 1. Region gate measurement and change
|
||||
|
||||
`BuildCoreDesiredTiles` asks for region pages when the desired tile center changes or its initial
|
||||
desired region set is established. The old `bCoreRegionCompilePending` path stopped the whole Core
|
||||
submission pass. The new default `voxel.CoreRegionConcurrentAdmission=1` continues through
|
||||
`LoadCoreTile` and refuses only keys in `PendingCoreRegionTileSet` or
|
||||
`CoreRegionCompileTilesInFlight`. `voxel.CoreRegionConcurrentAdmission=0` restores the old global
|
||||
gate as the negative control. Core tile arithmetic and recipes are unchanged.
|
||||
|
||||
Region pages are constructed away from the lookup map and published under `tileRegionMutex` as
|
||||
immutable shared owners. `generateTile` copies the matching `shared_ptr` while holding the map's
|
||||
shared lock, then keeps it for the complete read. Map eviction cannot free a page while an already
|
||||
running tile task holds it. The actor's shared `WorldLock` prevents edits/resets from mutating the
|
||||
Core world while readers or a region compile are active.
|
||||
|
||||
Matched fresh BuildHost processes used the staged owner `SurfaceWorld` settings, seed 0, 25 cm Core
|
||||
scale, 2,578-key desired set, Legacy order, Dynamic near reserve, apply boost 0, 10 task slots,
|
||||
Normal priority, `-corelimit=12`, and a +Y move starting at 30 s. Both modes used backlog cap 256.
|
||||
|
||||
| Moving 6 m/s | Region CVar 0 | Region CVar 1 |
|
||||
|---|---:|---:|
|
||||
| Region requests / completions | 11 / 11 | 11 / 11 |
|
||||
| Reasons | 1 initial set, 10 center moves | 1 initial set, 10 center moves |
|
||||
| Whole-scheduler region skips | 11 | 0 |
|
||||
| Pending interval sum / worst interval | 426.3 / 40.9 ms | 433.1 / 41.4 ms |
|
||||
| Compile wall sum / slowest compile | 10.8 / 2.5 ms | 10.5 / 2.4 ms |
|
||||
| Independent tile submissions / dependent declines | 0 / 0 | 110 / 0 |
|
||||
| Changed support centers ready 9/9 at the change | 11 / 11 | 11 / 11 |
|
||||
| Walkable lag at those centers | 0 ms | 0 ms |
|
||||
| Moving frames with an LOD0 key missing | 173 | 163 |
|
||||
| Moving worker busy / idle slot-seconds (15 s × 10 slots) | 39.7 / 110.3 s | 39.9 / 110.1 s |
|
||||
|
||||
The pending interval is the request-to-completion time recorded for each compile; it is not all
|
||||
global blocking in the new mode. The compiler's measured wall time summed to only about 11 ms over
|
||||
the run. The default mode removes the full-pass skip and submits keys independent of the entering
|
||||
region. Its total worker supply remains low: moving work averages about 2.66 of 10 busy workers.
|
||||
Each of the 11 negative-control whole-pass skips had 92–144 desired keys missing and zero active
|
||||
tile tasks. The CVar1 run has no corresponding global skip.
|
||||
Per-LOD counts added to `scheduler_skip` make the LOD0-missing-frame count include the 6 globally
|
||||
gated frames that had LOD0 work missing in the negative control.
|
||||
|
||||
The fast trace used 60 m/s and teleported 400 m after 2 s of the move. It recorded 113 region
|
||||
requests (initial set plus 112 center moves), all completed, with 381.4 ms aggregate compile wall
|
||||
time (30.8 ms worst) and 4,523.7 ms accumulated pending interval (69.9 ms worst). Concurrent
|
||||
admission recorded 782 independent submissions, 983 dependent-key declines, and zero global
|
||||
region skips. Of 113 changing support centers, 8 were already 9/9 ready on the change event, 3
|
||||
became ready before the next center change, and 102 did not reach 9/9 before leaving or test end.
|
||||
The worst resolved lag was 106.3 ms. LOD0 was missing on 480 of 488 moving scheduler frames. This
|
||||
speed is beyond what the current collision ring can follow.
|
||||
|
||||
## 2. Spawn, worker timeline and tail
|
||||
|
||||
| Fresh owner-plan spawn | S7 Dynamic reference | Round12 region CVar 0 | Round12 region CVar 1 |
|
||||
|---|---:|---:|---:|
|
||||
| Full set (2,578 keys, from BeginPlay) | 7.780 s | 7.820 s | 7.706 s |
|
||||
| Walkable 9/9 ring | 0.581 s | 0.583 s | 0.566 s |
|
||||
| Full LOD0 (512 tiles) | 1.439 s | 1.442 s | 1.424 s |
|
||||
| Worker task-seconds to full set | 41.364 | 41.966 | 41.229 |
|
||||
| Integrated busy workers / 10 (first request → ready) | 5.63 | 5.63 | 5.60 |
|
||||
| Idle slot-seconds (same interval) | 32.056 | 32.63 | 32.37 |
|
||||
| `UWorld::Tick` spawn p95 / max | 2.262 / 5.230 ms | 2.387 / 5.273 ms | 2.359 / 5.383 ms |
|
||||
| `UWorld::Tick` move p95 / max | 2.512 / 28.893 ms | 2.472 / 28.257 ms | 2.377 / 28.967 ms |
|
||||
|
||||
The CVar A/B changes the spawn full-set time by only 0.11 s; the region issue occurs during the
|
||||
later move. The Round12 CVar1 first-request-to-ready span was 7.360 s with 41.229 worker-seconds.
|
||||
In one-second bins its worker task time was 3.94, 3.91, 3.34, 6.51, 5.73, 7.75 and 7.81 worker-
|
||||
seconds, followed by 2.24 worker-seconds in the final 0.36 s. Average occupancy was 5.60/10 and
|
||||
idle capacity was 32.37 slot-seconds. No sustained ten-worker plateau appears. That is about
|
||||
16.0 ms of elapsed task time per initial tile, similar to S7's 16.04 ms and still about 9% above
|
||||
the S7 old-path control's 14.62 ms. It does not show whether the difference is CPU contention or
|
||||
other elapsed-time variation.
|
||||
|
||||
The 306 LOD8 jobs consumed 18.798 worker-seconds (45.6% of total), averaging 61.4 ms each; their
|
||||
worker-time p95 was 79.8 ms and max 94.7 ms. The final 20 completed tile records were all LOD8 and
|
||||
landed between 7.587 and 7.765 s. This is a group tail of ordinary large jobs, not one serial tile
|
||||
to split. Across the initial set, worker queue wait averaged 1.71 ms per tile (p95 9.71 ms, max
|
||||
41.44 ms), and game-thread mesh apply totaled 0.250 s. The trace records elapsed time, not CPU
|
||||
cycles, cache misses or task-pool wakeup causes; it cannot identify memory bandwidth or thread-local
|
||||
cache contention. The 10-slot cap reflects 12 logical cores with two cores reserved by
|
||||
`GetMaxConcurrentTasks`; I left that reserve in place without evidence that using all 12 improves
|
||||
the spawn while retaining tick time.
|
||||
|
||||
The optional actor-tick subsystem markers were not added. The matched run reports the 28.967 ms
|
||||
maximum walk tick, but this trace has no per-call marker at that maximum, so it remains unattributed.
|
||||
These are headless/null-RHI actor tick measurements, not rendered frame timings.
|
||||
|
||||
## 3. Result backlog bound
|
||||
|
||||
`voxel.StreamingResultBacklogCap` defaults to 256 and counts queued results, active tile tasks, and
|
||||
held visible-LOD0 prequeue results. It is distinct from worker-slot admission; finished results
|
||||
still do not occupy slots. Zero disables the cap and is the safety negative control.
|
||||
|
||||
| Run | Queue cap | Peak result count | Peak payload bytes | Cap stops | Peak private memory |
|
||||
|---|---:|---:|---:|---:|---:|
|
||||
| 6 m/s normal move | 256 | 116 | 17,024,546 | 0 | 3.48 GB |
|
||||
| 60 m/s + 400 m teleport | 256 | 114 | 17,153,276 | 0 | 3.80 GB |
|
||||
| 60 m/s + teleport, one mesh apply/frame | 256 | 256 | 76,201,412 | 843,198 | 3.60 GB |
|
||||
| Same slow-apply control, cap disabled | 0 | 1,577 | 125,098,792 | 0 | 3.63 GB |
|
||||
|
||||
The slow-apply test still reached its initial set: 23.890 s capped versus 23.493 s uncapped. The
|
||||
cap reduced the tracked peak by 1,321 results and 48.9 MB of payload, at a 0.397 s startup
|
||||
difference in this pair. `cap_stops` counts repeated admission attempts, not unique tile keys. The
|
||||
atomic peak tracker saw 256 / 1,577 results; periodic `result_queue_frame` samples saw 255 / 1,576,
|
||||
respectively, because a frame sample can miss the brief peak. Bytes are result payload estimates,
|
||||
excluding queue-node and allocator overhead. The default stops new admissions as work drains; it
|
||||
does not reduce active task capacity when the queue is below the cap.
|
||||
|
||||
## 4. Quality, determinism and async audit
|
||||
|
||||
- BuildHost Core Off legacy passed at 12.5 cm. HybridV1 and HybridV2 each passed five fixtures and
|
||||
same-LOD border checks at 25 cm.
|
||||
- Final-module SurfaceWorld passed the full actor, collision, anchor-move and carve checks at 25 cm.
|
||||
Its W1/W8/W16 worker matrix matched: density `0cd2a1a4152ee4aa`, mesh `80a5b054b904b1a2`, payload
|
||||
`bf2f1b40dff38acc`, topology `56074198682d5e18`. S3 ground agreement passed 128 points: far7/8
|
||||
maximum error 0.0427 cm, cross-LOD 0.0000 cm, 2 cm tolerance; the 100 cm offset control was
|
||||
detected.
|
||||
- FloatingIslands passed the final BuildHost W1/W8/W16 actor matrix at 25 cm, with fixed water,
|
||||
collision, edits and LOD0/1 coverage. The standalone W1/W8/W16 `--stream-hash` runs matched on all
|
||||
nine LODs. Its host scheduler clamps `parallel_for` to at most eight actual workers; W16 is the
|
||||
requested worker-limit input routed through that eight-thread executor. The S4 audit passed:
|
||||
385/385 far-cap bands emitted, 128 agreement points within 0.0504 cm (2 cm tolerance), 100 cm
|
||||
offset detected, and 2,520/2,520 coverage rays hit.
|
||||
- No field, mesh or recipe output changed; recipe version remains unchanged. Water remains fixed
|
||||
for the season, and player carve/fill remains unrestricted.
|
||||
|
||||
Async review of the diff:
|
||||
|
||||
- `FChunkResult::Epoch` and desired/modification epochs remain carried and checked. The region task
|
||||
captures generation and desired epochs plus its compile serial.
|
||||
- All four result queues remain `EQueueMode::Mpsc`; result insertion is centralized in
|
||||
`EnqueueStreamingResult`.
|
||||
- Tile and region workers check `bShuttingDown`; `EndPlay` sets both shutdown flags, waits for
|
||||
`ActiveTaskCount` to reach zero, then drains all four result queues.
|
||||
- `ModsLock` is unchanged. Workers generate data only; UObject and RMC mutation remains on the game
|
||||
thread. The region map has its own shared mutex, and readers retain immutable pages with
|
||||
`shared_ptr` until their tile job ends.
|
||||
|
||||
## 5. Build, commands and run record
|
||||
|
||||
BuildHost compiled at Normal priority with 12 actions. Link-safety passed (96,279 dumpbin lines
|
||||
checked against 421 names); the five staged asset hashes and 18 manifest shims passed. The final
|
||||
SurfaceWorld quality run took about 10 minutes and peaked at 3.896 GB private memory. The standalone
|
||||
full build passed with the existing `vswhere.exe` lookup warning and existing C4838 conversions in
|
||||
`VoxelStrateManager.cpp:3974–3975`.
|
||||
|
||||
Build commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\BuildVoxelForgeCoreHost.ps1 -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
.\Standalone\Build.ps1 -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
```
|
||||
|
||||
Matched region-gate commands (cap held at 256 for both sides):
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -CoreRegionConcurrentAdmission 0 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 6000 -TestTeleportAfterSeconds 2 -TestTeleportDistanceCm 40000 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Slow-apply backlog controls used these commands; the cap-off run is the backlog negative control:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 6000 -TestTeleportAfterSeconds 2 -TestTeleportDistanceCm 40000 -Step1MaxMeshApplies 1 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 0 -TestMoveSpeedCmPerSecond 6000 -TestTeleportAfterSeconds 2 -TestTeleportDistanceCm 40000 -Step1MaxMeshApplies 1 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Other BuildHost checks were:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Standalone determinism used three fresh processes (`--workers=1`, `8`, and `16`), each with:
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=1 --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
The S4 standalone audit command was:
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-audit --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
SHA-256 of the executables/modules used by the final runs:
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| UE 5.7 `UnrealEditor-Cmd.exe` | `ECCE9996191F7F7E69B3D104EECDD0E678AE69176FDCCD79828C3E75A0654D6D` |
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` | `8B82EE6C6FBB511AE766EB3D8646A7E9491952F41445CB62D49D71D0B9783418` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `0A1EB7BB27C3C74A4AA0996E0A24E74224D7B8FFFFF113B1071FA42E18E8375A` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `B3BC5E61172C5B21D928A5ACB5F22F8D9E00179B481B675804838DE9A620010D` |
|
||||
| `Standalone/bin/VoxelForgeCoreStandalone.exe` | `9C1601D7FCACCAAC16A2BA9DF0E7826E18746028A4D08FD23EEC479D2F5745BE` |
|
||||
|
||||
Trace logs and queue records are under
|
||||
`Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/`. The final quality
|
||||
logs and standalone determinism/audit stdout are under `Saved/BuildHost/Round12/`. No new file over
|
||||
300 KB was placed in `Research/`.
|
||||
|
||||
BuildHost and standalone launch guards checked free physical memory before each process and waited
|
||||
for at least 4 GiB. Explicit preflights for the final matched run and SurfaceWorld actor test saw
|
||||
17.33 and 17.11 GiB free. All processes stayed under 8 GiB and used Normal priority / at most 12
|
||||
threads. The only crash-folder entry is the pre-existing
|
||||
`UECC-Windows-F1A3EFD5469F5DD62E68EBBACAC84376_0000` from 2026-09-17; no new UECC or
|
||||
`0xC0000142` occurred. Three exploratory PowerShell RAM-probe definitions failed before launching
|
||||
Unreal; after correcting the interop declaration, the probe and all actual build/test runs passed
|
||||
on attempt 1. There were no failed Unreal runs or retries.
|
||||
|
||||
No new source file was added. Likely compile spots are `Source/VoxelForge/Private/VoxelWorld.cpp`,
|
||||
`Source/VoxelForge/Public/VoxelWorld.h`, `Source/VoxelForgeEditor/Private/VoxelForgeExploreCommandlet.cpp`,
|
||||
`Standalone/Core/src/VoxelForgeCore.cpp` and its public header, plus the PowerShell harness. I did
|
||||
not open the owner's editor, build `VoxelM.uproject`, edit any `.uasset`, or modify
|
||||
RealtimeMeshComponent. No commit, push or stash was made.
|
||||
@@ -0,0 +1,226 @@
|
||||
# World assembler S9 / M3 Round 13 — support-ring lookahead
|
||||
|
||||
**Result:** the support ring is ready at all tested center arrivals through 40 m/s horizontally,
|
||||
and through a scripted 50 m/s vertical descent. At 40 m/s the matched CVar-off control reached
|
||||
the ring at only 15/74 arrivals; lookahead reached it at 74/74. Initial readiness was 7.743 s with
|
||||
lookahead and 7.778 s without it. I did not reserve more workers, and I left the LOD8 geometry
|
||||
unchanged; its counted optimization plan is in §5.
|
||||
|
||||
The lookahead is default-on through `voxel.StreamingCollisionLookahead=1`; `0` disables prediction.
|
||||
It follows the support tile, predicts 350 ms ahead (rounded up to one or two 8 m LOD0 tiles at the
|
||||
25 cm owner scale), and promotes only rings already inside the desired clipmap. I first predicted
|
||||
from the stream center. The trace showed that this was one tile above the walkable center on this
|
||||
SurfaceWorld plan. I corrected both scheduler branches to predict and prioritize from
|
||||
`GetPlayerSupportTile`. No field or mesh arithmetic changed, so the recipe versions remain as-is.
|
||||
|
||||
## 1. Speed sweep
|
||||
|
||||
Fresh BuildHost commandlets used the staged owner SurfaceWorld plan, seed 0, 25 cm Core scale,
|
||||
Legacy streaming order, Dynamic near reserve, apply boost 0, region concurrent admission 1, result
|
||||
backlog cap 256, Normal process priority, a 12-action host limit, and movement from 30 to 45 s.
|
||||
The S8 traces are the pre-lookahead baseline. Arrival readiness is the `walkable_gate.ready` value
|
||||
on the support-center-change event. Lag is the maximum time to a later 9/9 sample before the next
|
||||
support-center change; unresolved centers are counted separately. LOD0 missing is the number of
|
||||
`scheduler_admission` samples with any desired LOD0 key missing during 30–45 s.
|
||||
|
||||
| Motion | S8 arrival-ready | S8 worst resolved lag / unresolved | S8 LOD0-missing frames | S9 arrival-ready | S9 worst lag / unresolved | S9 LOD0-missing frames |
|
||||
|---|---:|---:|---:|---:|---:|---:|
|
||||
| +Y 6 m/s | 11/11 (100%) | 0 ms / 0 | 168/838 (20.0%) | 11/11 (100%) | 0 ms / 0 | 165/839 (19.7%) |
|
||||
| +Y 12 m/s | 22/22 (100%) | 0 ms / 0 | 431/776 (55.5%) | 22/22 (100%) | 0 ms / 0 | 436/775 (56.3%) |
|
||||
| +Y 25 m/s | 46/46 (100%) | 0 ms / 0 | 625/677 (92.3%) | 46/46 (100%) | 0 ms / 0 | 627/679 (92.3%) |
|
||||
| +Y 40 m/s | 25/74 (33.8%) | 191.1 ms / 8 | 579/595 (97.3%) | 74/74 (100%) | 0 ms / 0 | 576/593 (97.1%) |
|
||||
| −Z 50 m/s | — | — | — | 93/93 (100%) | 0 ms / 0 | 605/626 (96.6%) |
|
||||
|
||||
The matched 40 m/s CVar-negative control on the corrected source reached 15/74 centers (20.3%),
|
||||
with 196.3 ms worst resolved lag, 7 unresolved centers, and 574/590 LOD0-missing samples (97.3%).
|
||||
This isolates prediction from the support-center correction. The old S8 60 m/s + 400 m teleport
|
||||
remains a separate discontinuity case: 8/113 centers were ready at arrival, 3 more became ready
|
||||
before the next center, and 102/113 never reached 9/9.
|
||||
|
||||
At 40 m/s the current run therefore supports **40 m/s as the highest tested horizontal speed**;
|
||||
it does not establish a higher horizontal ceiling. The 50 m/s trace used the harness's scripted
|
||||
downward actor movement through the staged owner plan, not a Chaos free-fall simulation in a shaft.
|
||||
The ring remained ready through all 93 center changes.
|
||||
|
||||
Spawn did not regress in the matched 40 m/s pair: `initial_ready_s` was 7.743349 s on and 7.777605 s
|
||||
off, with spawn-tick p95 2.288 ms and 2.292 ms respectively. The S9 on-run initial-ready values
|
||||
at 6/12/25/40 m/s were 7.813133/7.815265/7.821660/7.743349 s. Movement begins at 30 s, and the
|
||||
lookahead adds no stationary-spawn requests.
|
||||
|
||||
## 2. Critical path at 40 m/s
|
||||
|
||||
For 108 traced critical LOD0 jobs with complete tile-event joins, p50/p95 were:
|
||||
|
||||
| Stage | p50 | p95 |
|
||||
|---|---:|---:|
|
||||
| Request → worker start | 0.02 ms | 9.59 ms |
|
||||
| Worker generation | 66.6 ms | 84.0 ms |
|
||||
| Result queue → game-thread apply | 9.3 ms | 17.7 ms |
|
||||
| Game-thread apply → mesh submit | 0.17 ms | 0.24 ms |
|
||||
| Mesh → collision submit | 0.01 ms | 0.02 ms |
|
||||
| RMC submit → body-update event | 37.6 ms | 85.9 ms |
|
||||
|
||||
The body-update interval is the observable collision-ready delay; it is not an isolated Chaos CPU
|
||||
cook timer. Generation and body update dominate. Request-to-worker delay is small at the median,
|
||||
and game-thread apply/submission is below a quarter millisecond at p95. The lookahead gives the
|
||||
generation and body-update stages time to finish before support-center arrival.
|
||||
|
||||
At 40 m/s the trace reported two lookahead tiles and three newly collision-promoted keys per
|
||||
scheduler rebuild, with zero desired keys outside the clipmap. Worker occupancy hit the 10-task
|
||||
limit, while the result queue peaked at 113 entries / 16.8 MB under the 256 cap and recorded no cap
|
||||
stops. Region compile time was 1.74 ms p50, 22.16 ms p95, 33.32 ms max; concurrent admission
|
||||
recorded no global scheduler skips. Those systems still consume time, but the matched CVar test
|
||||
shows prediction is sufficient at this plan's 40 m/s horizontal limit without adding reserved
|
||||
slots.
|
||||
|
||||
## 3. Output quality and determinism
|
||||
|
||||
- BuildHost Core-off legacy passed at 12.5 cm. M2 HybridV1 and HybridV2 each passed five analytic
|
||||
fixtures plus border checks at 25 cm.
|
||||
- SurfaceWorld passed at 25 cm with collision, anchor movement, carve and travel checks. Its
|
||||
W1/W8/W16 actor hash matrix was stable: density `0cd2a1a4152ee4aa`, mesh `80a5b054b904b1a2`,
|
||||
payload `bf2f1b40dff38acc`, topology `56074198682d5e18`. Peak commandlet private memory was
|
||||
3.90 GB.
|
||||
- FloatingIslands passed at 25 cm with fixed water, edits, collision and LOD0/1 coverage; the
|
||||
BuildHost actor matrix reported W1/W8/W16. Peak private memory was 3.25 GB.
|
||||
- The current Standalone W1/W8/W12 full-clipmap and per-LOD 0–8 density, mesh, payload and topology
|
||||
hashes match. Full-clipmap hash tuple: density `c10697a8f48380c7`, mesh `430d2be2bdd8b988`,
|
||||
payload `b7b33e14092225c9`, topology `c5c46d66606a819e`. Full-detail hashes also match.
|
||||
- The Standalone S4 audit passed: 385/385 far-cap bands, 128 agreement points (maximum 0.0504 cm
|
||||
under the 2 cm gate), the 100 cm offset negative control, and 2,520/2,520 cap-coverage rays.
|
||||
The current BuildHost SurfaceWorld S3 check passed 128 points with 0.0427 cm maximum far/near
|
||||
error and detected its 100 cm offset control.
|
||||
- A sampled Standalone W12 benchmark process peaked at 0.68 GB private memory.
|
||||
|
||||
I did **not** run Standalone `--workers=16`: that implementation constructs 16 worker threads,
|
||||
which conflicts with the explicit 12-thread launch cap. Current Standalone W1/W8/W12 match, and
|
||||
the BuildHost SurfaceWorld and FloatingIslands W1/W8/W16 matrices passed. I requested whether the
|
||||
owner wants a one-run W16 exception; until then the 12-thread cap stands. No new `UECC-*` folder
|
||||
was present; the only folder was the existing 2026-09-17 crash.
|
||||
|
||||
No geometry, field, density or recipe output changed. The far-horizon recipe stays at v2 and the
|
||||
SurfaceWorld plan identity stays unchanged. Water remains fixed for the season; player carve/fill
|
||||
remains unrestricted.
|
||||
|
||||
## 4. Goal 2 — counted LOD8 plan, optimization deferred
|
||||
|
||||
The S8 cold owner trace measured 306 LOD8 jobs at 18.798 worker-seconds total (61.4 ms average,
|
||||
79.8 ms p95, 94.7 ms max), 45.6% of worker time. Its full set reached readiness in about 7.7 s.
|
||||
The current 25 cm BuildHost feature-cost probe warmed eight LOD8 keys and reported p95 per-tile
|
||||
diagnostics: full/candidate feature path 59.508/59.585 ms, column computation 30.771 ms, marching
|
||||
cubes 6.018 ms, native ground+cap horizon refinement 48.205 ms, classification 0.0046 ms, feature
|
||||
list 0.0007 ms, and shell work 0.0001 ms (repair skipped). The profile counters are overlapping
|
||||
inclusive measurements, so they must not be summed. The same probe reported 15,529 field calls,
|
||||
9,679 column-cache misses, 8,192 refined ground triangles, 531 ground triangles removed, and
|
||||
6,732 cap triangles at the sampled high-cost LOD8 tile.
|
||||
|
||||
`HeightfieldColumnCache` is a 65,536-entry thread-local cache keyed by global XY. It reuses columns
|
||||
within a worker, but does not share cache entries across workers. The current probe does not count
|
||||
cross-tile duplicate samples by worker, and does not split ground-refinement time from cap-refinement
|
||||
time. The next measurement should add exclusive counters for column evaluation, MC, ground refine,
|
||||
cap refine, classification, and cache hits/misses per tile and worker, then trace duplicate global
|
||||
columns across neighboring LOD8 jobs.
|
||||
|
||||
No LOD8 optimization or far-mesh change was made this round, so no before/after far-horizon/cap
|
||||
captures were produced and the below-7.7 s Goal 2 target remains open. The counted next step is to
|
||||
prototype shared immutable heightfield-column pages for planar families, compare against sampling
|
||||
at displayed resolution and tolerance-based refinement skips, then rerun S3 ground/S4 cap gates
|
||||
(2 cm agreement, 100% coverage) and matched viewer captures at VSync/60 fps, closing the viewer
|
||||
right after each capture. Do not relax tolerances without a metre-scale error bound.
|
||||
|
||||
## 5. Builds, commands, binaries and run record
|
||||
|
||||
BuildHost and Standalone builds passed on their first attempt. Standalone build printed the existing
|
||||
`vswhere.exe` lookup warning and C4838 conversions in `VoxelStrateManager.cpp:3974–3975`, then
|
||||
built both targets successfully. All commandlets were fresh, serial, Normal priority and below
|
||||
8 GB; the largest sampled BuildHost private memory was 3.90 GB. No process exceeded the 15-minute
|
||||
step limit.
|
||||
|
||||
Build commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\BuildVoxelForgeCoreHost.ps1 -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
.\Standalone\Build.ps1 -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
```
|
||||
|
||||
The final horizontal trace command (repeat with speeds `600`, `1200`, `2500`, and `4000` cm/s):
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The pre-S9 baseline used the same staged plan and settings with the S8 binary, before the lookahead
|
||||
CVar existed; repeat with the same four speed values:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Vertical descent and the matched 40 m/s CVar-negative control:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,0,-1' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 5000 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 0 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 4000 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Quality commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-audit --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
Standalone determinism command template (fresh process, `--workers=1`, `8`, and `12`; `16` was
|
||||
not launched under the thread cap):
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=1 --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
One initial CVar-off command was rejected by PowerShell before launch because the movement vector
|
||||
was not quoted (`Cannot convert value to type System.String`). I retried with
|
||||
`-TestMoveDirection '0,1,0'`; the BuildHost run passed. No Unreal process launched for the rejected
|
||||
attempt. No other test/build attempt failed or retried.
|
||||
|
||||
Binary SHA-256:
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| UE 5.7 `UnrealEditor-Cmd.exe` | `ECCE9996191F7F7E69B3D104EECDD0E678AE69176FDCCD79828C3E75A0654D6D` |
|
||||
| S8 baseline BuildHost `UnrealEditor-VoxelForge.dll` | `8B82EE6C6FBB511AE766EB3D8646A7E9491952F41445CB62D49D71D0B9783418` |
|
||||
| S8 baseline BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `B3BC5E61172C5B21D928A5ACB5F22F8D9E00179B481B675804838DE9A620010D` |
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` | `F542FC1F014190798485CC088470FD498D368D2E369639EAD32A0EEE8FDB1193` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `0A1EB7BB27C3C74A4AA0996E0A24E74224D7B8FFFFF113B1071FA42E18E8375A` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `15B6460FD4E48D14CBE751C99447F06B62B44CF35FFD440AED106585AECEDC79` |
|
||||
| `Standalone/bin/VoxelForgeCoreStandalone.exe` | `FD4CD39CD49BB0E8429250295BD16FACA0A6FBE412240522AB79C086245978C0` |
|
||||
|
||||
Trace JSONL and actor stdout remain under
|
||||
`Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/`. The initial
|
||||
lookahead results are retained in `Saved/BuildHost/Round13/BeforeSupportTileCorrection/`; Standalone
|
||||
hash logs and the S4 audit log are under `Saved/BuildHost/Round13/`. No file over 300 KB was added
|
||||
outside `Saved/BuildHost/`. No `.uproject`, editor, `.uasset`, RealtimeMeshComponent source, commit,
|
||||
push or stash was touched.
|
||||
|
||||
Modified source files:
|
||||
|
||||
- `Source/VoxelForge/Private/VoxelWorld.cpp` — CVar, support-centered lookahead and critical ring ordering; BuildHost `VoxelForge` runtime compile.
|
||||
- `Source/VoxelForge/Public/VoxelWorld.h` — private helper declarations; same runtime compile.
|
||||
- `Source/VoxelForgeEditor/Private/VoxelForgeExploreCommandlet.cpp` — movement-vector harness; BuildHost `VoxelForgeEditor` compile.
|
||||
- `Tools/TestVoxelForgeCoreWorldHost.ps1` — movement-vector and CVar arguments.
|
||||
|
||||
New source files: none. Standalone source files were not changed. Documentation updated:
|
||||
`CODEMAP.md` §3.16 and `ARCHITECTURE.md` §8.30.
|
||||
|
||||
Async-safety diff review: `Epoch` propagation/checks are untouched; all result queues remain
|
||||
`EQueueMode::Mpsc`; `EndPlay` still drains after active tasks finish; workers still check
|
||||
`bShuttingDown`; `ModsLock` and immutable region-page lifetime are unchanged; UObject and RMC
|
||||
mutation remain on the game thread.
|
||||
|
||||
### Dialogue
|
||||
|
||||
**User:** Continue S9 from the 6 and 12 m/s lookahead traces after the service interruption.
|
||||
**Luna:** Resumed at the 25 m/s run, found and fixed the support/stream-center mismatch, then measured the corrected speed sweep and matched 40 m/s CVar control.
|
||||
@@ -0,0 +1,213 @@
|
||||
# World assembler S10 / M3 Round 14 — cheaper far ring
|
||||
|
||||
Date: 2026-10-19. Base: S9 / `e7586a1`. No commit, push or stash.
|
||||
|
||||
## Result
|
||||
|
||||
The planar far path now samples the LOD8 interior at the spacing that LOD8 marching cubes can
|
||||
represent. At 25 cm, that is 512 voxels / 128 m per MC cell. Globally aligned 128-voxel (32 m)
|
||||
strips remain along tile boundaries. LOD4–LOD7 coordinates and the 2 cm agreement tolerances are
|
||||
unchanged. Far recipe version is 3; far mesh hashes change, while density and LOD0–LOD3 remain
|
||||
unchanged.
|
||||
|
||||
On the owner SurfaceWorld plan, the warmed eight-tile BuildHost LOD8 full-tile p95 fell 76.7%,
|
||||
from 59.848 ms to 13.933 ms. In the fresh 6 m/s actor spawn trace, the 2,578 initial tile jobs
|
||||
used 26.870 worker-seconds; the LOD8 share was 4.288 seconds. Round13’s S8 spawn reference was
|
||||
about 41 worker-seconds, with 18.798 seconds in its 306 LOD8 jobs. Initial readiness was 7.117 s,
|
||||
below the 7.7 s target. The active 3×3 walkable ring was ready in 0.490 s, and all 512 LOD0 tiles
|
||||
were ready at 1.428 s.
|
||||
|
||||
## Count first — exclusive cost and duplicate columns
|
||||
|
||||
The counters are measured per tile. Column evaluation is timed only around uncached column work.
|
||||
MC, ground and cap counters subtract column time from their respective wall intervals. The mesh
|
||||
assembly window covers final payload flattening and optional diagnostic hashing. Each p95 is
|
||||
computed independently, so these p95 values are not additive.
|
||||
|
||||
| LOD8 warmed p95, BuildHost 25 cm | S9 | S10 | Change |
|
||||
|---|---:|---:|---:|
|
||||
| Full tile | 59.848 ms | 13.933 ms | −76.7% |
|
||||
| Column evaluation | 31.319 ms | 7.478 ms | −76.1% |
|
||||
| Marching cubes | 2.667 ms | 2.359 ms | −11.6% |
|
||||
| Ground refinement | 11.666 ms | 1.690 ms | −85.5% |
|
||||
| Cap refinement | 10.029 ms | 1.330 ms | −86.7% |
|
||||
| Mesh assembly and diagnostic hash | 5.445 ms | 1.095 ms | −79.9% |
|
||||
| Column-cache misses | 9,679 | 2,287 | −76.4% |
|
||||
|
||||
The high-cost S9 sample generated 8,192 ground triangles, removed 531 coarse ground triangles,
|
||||
and generated 6,732 cap triangles. S10 generated 968 ground triangles, removed 534, and generated
|
||||
840 cap triangles. The geometric checks below pass at the same tolerance.
|
||||
|
||||
The fresh W12 Standalone overlap capture counted 153 LOD8 tiles. S10 evaluated 106,219 unique XY
|
||||
columns and repeated 32,738 neighboring tile evaluations, including 30,446 cross-worker repeats.
|
||||
The same-binary step-128 control counted 660,283 unique columns, 44,319 neighboring repeats and
|
||||
41,665 cross-worker repeats. This confirms that cross-worker duplicates remain, while the coarser
|
||||
interior removes most column work without sharing cache state between workers.
|
||||
|
||||
| Fresh W12 Standalone pipeline | Default step 0 | Negative control step 128 |
|
||||
|---|---:|---:|
|
||||
| LOD8 worker sum | 3.206 s | 13.534 s |
|
||||
| LOD8 unique XY columns | 106,219 | 660,283 |
|
||||
| Repeated neighboring evaluations | 32,738 | 44,319 |
|
||||
| Cross-worker neighboring repeats | 30,446 | 41,665 |
|
||||
|
||||
Both runs used the current v3 binary. Step 128 restores S9 sampling density, but retains the v3
|
||||
hash salt; its far mesh hash is therefore expected to differ from S9’s v2 hash.
|
||||
|
||||
## BuildHost actor spawn and ring
|
||||
|
||||
The fresh 6 m/s trace used the S9 movement, collision and backlog settings: Legacy order, Dynamic
|
||||
near reserve, collision lookahead on, 256 result cap, and a 12-CPU affinity mask. Per-LOD worker
|
||||
generation sums for the 2,578 initial generation ordinals were:
|
||||
|
||||
| LOD | Initial tiles | Worker seconds |
|
||||
|---:|---:|---:|
|
||||
| 0 | 512 | 3.840 |
|
||||
| 1 | 448 | 3.781 |
|
||||
| 2 | 320 | 0.811 |
|
||||
| 3 | 272 | 2.093 |
|
||||
| 4 | 272 | 6.688 |
|
||||
| 5 | 208 | 1.535 |
|
||||
| 6 | 144 | 1.988 |
|
||||
| 7 | 96 | 1.846 |
|
||||
| 8 | 306 | 4.288 |
|
||||
| **Total** | **2,578** | **26.870** |
|
||||
|
||||
At 6 m/s, initial readiness was 7.116525 s (2,578 desired, 2,617 loaded); spawn-tick p95/max was
|
||||
1.824/4.993 ms. The support ring became ready at 0.490 s (9/9). The complete LOD0 set was ready at
|
||||
1.427630 s, with a 0.990836 s measured build interval. Round13’s S9 6 m/s initial-ready value was
|
||||
7.813133 s.
|
||||
|
||||
At 40 m/s (4,000 cm/s), all 75 moving support-center arrivals from 30.205 s through 45.011 s had
|
||||
the full 9/9 walkable ring ready: 75/75, 100%. A stationary startup gate event before movement is
|
||||
excluded from that moving-center denominator. Initial readiness was 7.087272 s. Spawn-tick
|
||||
p95/max was 1.833/5.365 ms; the trace passed.
|
||||
|
||||
## Quality and determinism
|
||||
|
||||
- S3 ground agreement: 72 shared route points; far LOD7 and LOD8 maximum error 0.0427 cm, cross-LOD
|
||||
error 0 cm, within 2 cm. The 100 cm datum-offset control measured 100.0427 cm and was detected.
|
||||
- S4 cap agreement: 128 shared points; maximum error 0.0504 cm, within 2 cm. The 100 cm datum-offset
|
||||
control measured 100.0015 cm and was detected. Cap census emitted all 385/385 requested bands.
|
||||
- Cap coverage: 2,520/2,520 upward rays hit the cap (100%); no profile-roof, mesh or clip-edge misses.
|
||||
- Core-off legacy passed at 12.5 cm. The M2 Hybrid V1 and V2 fixture sets each passed five analytic
|
||||
fixtures and border checks. SurfaceWorld and FloatingIslands passed BuildHost actor validation at
|
||||
25 cm. Water stayed fixed; carve and fill remained unrestricted.
|
||||
- Standalone W1/W8/W12 produced identical hashes for the full 2,553-tile view: density
|
||||
`c10697a8f48380c7`, mesh `e75c9119a1498cd5`, payload `49a9a8d1835a6c8c`, topology
|
||||
`edcb23288b5e8724`.
|
||||
- BuildHost SurfaceWorld W1/W8/W16 matrix was stable: density `0cd2a1a4152ee4aa`, mesh
|
||||
`a06243aee16b65d5`, payload `c700162935c262d7`, topology `0af901aa42b452bc`. FloatingIslands
|
||||
W1/W8/W16 was stable: density `4dcfb37585d7d986`, mesh `f14f76fbf065c6ed`, payload
|
||||
`53035c45fd1a082e`, topology `23550100654a4ec3`. W16 was a logical partition with the process
|
||||
still capped to 12 executing CPUs.
|
||||
|
||||
Far mesh hashes differ from S9 as expected under recipe version 3; current-build determinism passes.
|
||||
|
||||
## Matched captures
|
||||
|
||||
All captures are 640×400 and under 22 KB. Each was produced at 60 fps with VSync on, then the
|
||||
Standalone viewer was closed after its back-buffer capture. Raw 1280×800 PNGs and run logs are under
|
||||
`Saved/BuildHost/Round14/CaptureRaw/`.
|
||||
|
||||
| View | S9 sampling control, 128 voxels | S10 default, MC spacing |
|
||||
|---|---|---|
|
||||
| Far horizon, camera 0,-35,-487.94,0,-22 | [s9_far_horizon.jpg](captures/s9_far_horizon.jpg) (21.9 KB) | [s10_far_horizon.jpg](captures/s10_far_horizon.jpg) (18.0 KB) |
|
||||
| Cap, camera 0,-35,-487.94,0,22.42 | [s9_cap.jpg](captures/s9_cap.jpg) (10.8 KB) | [s10_cap.jpg](captures/s10_cap.jpg) (10.8 KB) |
|
||||
|
||||
The cap is low contrast in this view, as in Round8; the 2 cm agreement, triangle census and ray
|
||||
coverage provide the cap acceptance evidence.
|
||||
|
||||
## Builds, commands and hashes
|
||||
|
||||
Builds on the final source:
|
||||
|
||||
~~~powershell
|
||||
.\Tools\BuildVoxelForgeCoreHost.ps1 -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
.\Standalone\Build.ps1 -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
~~~
|
||||
|
||||
The fresh Standalone determinism processes used the same command with workers 1, 8 and 12:
|
||||
|
||||
~~~powershell
|
||||
foreach ($workers in @(1, 8, 12)) {
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=$workers --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
}
|
||||
~~~
|
||||
|
||||
The current-build duplicate count and same-binary step-128 control used:
|
||||
|
||||
~~~powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=12 --world-assembler-prototype --stream-pipeline --stream-hash --profile-far-column-overlap --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=12 --world-assembler-prototype --stream-pipeline --stream-hash --profile-far-column-overlap --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=128 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
~~~
|
||||
|
||||
Quality and BuildHost actor commands:
|
||||
|
||||
~~~powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-audit --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
~~~
|
||||
|
||||
The two fresh actor traces differed only in speed, 600 or 4,000 cm/s:
|
||||
|
||||
~~~powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 4000 -TimeoutSeconds 900
|
||||
~~~
|
||||
|
||||
Final binary SHA-256:
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| BuildHost UnrealEditor-VoxelForgeCore.dll | `D87CC56BACCDE6559705EEAEA7DB73D1A6ABF79484D37A3887B94A9FD62BABD3` |
|
||||
| BuildHost UnrealEditor-VoxelForge.dll | `9D0522ECC9A6AC52D9F3ACC2FD44399FE70F557C5F11D0203AB4C4B8EE75C198` |
|
||||
| BuildHost UnrealEditor-VoxelForgeEditor.dll | `AA196DA5A6DB3C84B5EC4F002AEBC787386DBB8F2798F5D1EEC03010BF642BBA` |
|
||||
| Standalone VoxelForgeCoreStandalone.exe | `E316D7E3E0B3D3639DAE61D6E2D1091F38C59A210B3B7DD8124928D21A8119A5` |
|
||||
|
||||
## Run notes, files and safety review
|
||||
|
||||
- BuildHost and Standalone ran at Normal priority with no more than 12 executing CPUs; free memory
|
||||
was above 17 GB before the final launches. BuildHost peak private memory was 3.76 GiB for
|
||||
SurfaceWorld, 3.27 GiB for FloatingIslands, 3.39 GiB for the 6 m/s trace and 3.67 GiB for the
|
||||
40 m/s trace. The Standalone overlap/control processes peaked below 0.72 GiB. No process exceeded
|
||||
8 GiB, and no launch overlapped another Unreal/Standalone process.
|
||||
- Standalone’s first compile attempt failed in `StandaloneViewer.cpp` because one helper referred to
|
||||
`App` outside its scope; that reference was corrected and the final build passed. The existing
|
||||
`vswhere.exe` lookup warning and `VoxelStrateManager.cpp` C4838 warnings remained.
|
||||
- Three BuildHost CVar attempts (direct argument and two `ExecCmds` forms) read back zero and did not
|
||||
change the worker grid; that no-op CVar/harness path was removed. An early Standalone step-128
|
||||
attempt also did not reach the pipeline; CLI pass-through was corrected and the final same-binary
|
||||
step-128 control above is effective. No CVar remains in the final source.
|
||||
- One high-pitch cap capture was black and was discarded. A separate early capture shell lacked its
|
||||
memory-probe type because the PowerShell session was fresh; that capture completed without a
|
||||
pre-launch memory gate. The matched final captures were rerun with the gate active. No
|
||||
`0xC0000142` occurred and no run needed retrying.
|
||||
- The only UECC directory was the pre-existing
|
||||
`UECC-Windows-F1A3EFD5469F5DD62E68EBBACAC84376_0000`, timestamped 2026-09-17; no new UECC folder
|
||||
was created.
|
||||
- No new source files. Changed source files and compile spots:
|
||||
|
||||
| File | Compile spot |
|
||||
|---|---|
|
||||
| `Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h`, `Standalone/Core/src/VoxelForgeCore.cpp`, `Standalone/Core/src/WorldAssemblerInternal.h` | VoxelForgeCore in Standalone and BuildHost |
|
||||
| `Standalone/Source/StreamingWorld.h`, `Standalone/Source/StandaloneViewer.cpp` | StandaloneViewer / VoxelForgeCoreStandalone.exe |
|
||||
| `Source/VoxelForgeEditor/Private/VoxelForgeExploreCommandlet.cpp` | BuildHost VoxelForgeEditor module |
|
||||
| `Tools/TestVoxelForgeCoreWorldHost.ps1` | PowerShell harness only; recipe-specific fixture logs |
|
||||
|
||||
Async-safety review: no actor async source changed. Epoch checks, MPSC queues, EndPlay draining,
|
||||
worker `bShuttingDown` checks and `ModsLock` remain unchanged. Region-page publication, shared_ptr
|
||||
lifetime and concurrent eviction remain unchanged. New duplicate capture stays thread-local and is
|
||||
copied into the tile result; its worker-id hash is diagnostic only. UObject and RealtimeMeshComponent
|
||||
mutation remain on the game thread. No owner `.uproject`, editor, `.uasset`, or RealtimeMeshComponent
|
||||
file was modified. `git diff --check` passed. No commit, push or stash.
|
||||
|
||||
### Dialogue
|
||||
|
||||
**User:** Keep the 12-thread cap; count exclusive LOD8 costs first, optimize the planar far path, and verify quality and determinism.
|
||||
|
||||
**Codex:** The LOD8 interior now follows the MC spacing, with 128-voxel boundary strips preserved. The owner-plan LOD8 p95 fell from 59.848 ms to 13.933 ms; cap and ground gates, both BuildHost actor matrices, current-build worker hashes, and the 40 m/s support ring passed.
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,181 @@
|
||||
# World Assembler M3 — Round 15 (S11)
|
||||
|
||||
Date: 2026-10-19
|
||||
Starting revision: `b90d63d` (S10)
|
||||
Result: shared spawn-phase apply budget enabled by default; geometry and recipe unchanged.
|
||||
|
||||
## Finding
|
||||
|
||||
The old 7.1 s result was an apply backlog layered on top of generation. In the matched authored-budget control, 2,578 initial tiles were generated. The four-visible-mesh cap was reached on 305 of 399 apply frames; the result backlog peaked at 252/256 and eight result-backlog-cap declines were recorded (decline rule 6). Dynamic near-reserve holds (rule 2) appeared on three frames in both runs; full task-cap holds (rule 1) appeared on 312 control frames and 309 default frames while the ten-task guard was occupied. Rule 6 (result backlog cap) appeared on two control frames, with eight declined tile attempts, and on zero default frames. Result-wait p95/max was 847.5/1,119.2 ms. LOD8's last worker finished at 6.068 s, but its result was not applied until 7.182 s.
|
||||
|
||||
I enabled the existing bounded startup apply mode in the shared `AVoxelWorld::ProcessPendingChunks` path: up to 12 visible applies or 14 ms per frame, capped at 30 seconds. It ends when the initial desired set and stationary walkable ring are ready, the desired epoch changes, a per-step override is active, or the duration expires. The regular authored budget (4 meshes/2 ms in this test) resumes for normal play. A trace record now reads back the CVar and resolved budgets. With the mode enabled, the peak backlog was 10/256, there were no backlog-cap declines, and result-wait p95/max fell to 16.6/19.3 ms. LOD8's last worker/apply were 6.015/6.019 s. The full set fell from 7.118 to 5.960 s, a 1.158 s (16.3%) improvement.
|
||||
|
||||
The remaining floor is generation/admission, not result application, collision cooking, or LOD4. The set's worker span was 5.581 s after the first request, with 26.786 worker-seconds total. Ten perfectly occupied slots would need 2.679 s, but the actor issued 2,578 requests over 310 submission passes (8.32 submissions/pass); sampled active-task guards averaged 9.90/10 while sampled running workers averaged 7.95 and peaked at 8. Across the request-to-ready interval, the trace integrates 4.78 busy-worker equivalents and 29.24 idle slot-seconds. The initial-set trace records one `scheduler_admission` on every actor frame from the first desired pass through ready, with no frame gaps. The control took 379 frames (6.758 s from first request), including 314 frames that submitted work and 65 drain-only frames; the default took 312 frames (5.602 s), 310 with submissions and two drain-only. That is about 56 admission frames/s, with 8.3 submissions per non-empty pass. The remaining floor is frame-paced admission/refill, with effective worker supply also below the ten task slots (running workers peaked at eight). The trace shows this occupancy limit but does not establish why the task backend tops out at eight.
|
||||
|
||||
Collision was not the startup floor: the 60 initial non-empty body updates had an 18.4 ms p95 submit-to-body-update interval, while the walkable ring was ready in 0.486 s. RMC section updates were not changed. LOD4 used the most aggregate worker time (6.590 s), but completed by 4.276 s; LOD8 remained the final LOD at 6.019 s. LOD4 averaged about 24.2 ms over the 272 tiles in the owner's count, but it did not set the tail, so I left its generation path alone.
|
||||
|
||||
## Matched spawn results
|
||||
|
||||
Fresh BuildHost processes, same binary, same 25 cm SurfaceWorld plan and streaming options; only the startup apply CVar differed. Both generated/drained 2,578 initial tiles and applied 1,333 visible meshes.
|
||||
|
||||
| Metric | Authored budget: CVar 0 | Startup budget: default 1 |
|
||||
|---|---:|---:|
|
||||
| Full set ready | 7.118 s | 5.960 s |
|
||||
| Walkable ring, 9/9 | 0.495 s | 0.486 s |
|
||||
| Full LOD0 | 1.444 s | 1.403 s |
|
||||
| Worker-seconds | 27.077 s | 26.786 s |
|
||||
| Worker span from first request | 5.626 s | 5.581 s |
|
||||
| First request to full ready | 6.758 s | 5.603 s |
|
||||
| Ideal worker time, total / 10 slots | 2.708 s | 2.679 s |
|
||||
| Integrated busy equivalents over worker span | 4.01/10 | 4.78/10 |
|
||||
| Idle slot-seconds to full ready | 40.50 | 29.24 |
|
||||
| Scheduler admission frames through ready | 379 | 312 |
|
||||
| Non-empty submit passes / submissions per pass | 314 / 8.21 | 310 / 8.32 |
|
||||
| Sampled active task guards, average / 10 | 8.24 | 9.90 |
|
||||
| Sampled running workers, average / max | 6.62 / 8 | 7.95 / 8 |
|
||||
| Worker queue p95 / max | 6.15 / 26.57 ms | 6.17 / 20.33 ms |
|
||||
| Result queue p50 / p95 / max | 34.66 / 847.53 / 1,119.15 ms | 10.69 / 16.62 / 19.26 ms |
|
||||
| Peak result backlog / cap | 252 / 256 | 10 / 256 |
|
||||
| Backlog-cap declined tile attempts | 8 | 0 |
|
||||
| Near-reserve decline frames | 3 | 3 |
|
||||
| Apply frames through initial-ready | 399 | 332 |
|
||||
| Apply-count cap frames | 305 | 0 |
|
||||
| Max visible applies in one frame | 4 | 10 (12 allowed) |
|
||||
| Total measured Apply time | 235.80 ms | 236.14 ms |
|
||||
| Maximum Apply time in one frame | 1.576 ms | 2.357 ms |
|
||||
| Initial non-empty body updates | 60 | 60 |
|
||||
| Submit-to-body-update p95 / max | 17.69 / 17.81 ms | 18.37 / 18.45 ms |
|
||||
|
||||
The control spent 65 scheduler frames draining after its final non-empty submit pass; the default spent two. The startup CVar negative control is effective: `startup_apply_config` read back `0` for the control and `1` when omitted for the default run. Both records reported the authored budget as 4 meshes/2 ms and the startup budget as 12 meshes/14 ms. `startup_apply_budget` showed the default run entering and leaving the bounded phase. The cap, collision, reserve, order, speed and backlog settings were matched.
|
||||
|
||||
### Worker timeline
|
||||
|
||||
Busy worker slot-seconds are integrated from the first request, in elapsed one-second bins (the last bin is approximately 0.6 s). Each value is CVar 0 / default 1.
|
||||
|
||||
| Time from first request | Busy worker slot-seconds, CVar 0 / default 1 |
|
||||
|---|---:|
|
||||
| 0–1 s | 3.93 / 3.97 |
|
||||
| 1–2 s | 3.92 / 3.92 |
|
||||
| 2–3 s | 3.35 / 3.39 |
|
||||
| 3–4 s | 6.63 / 6.48 |
|
||||
| 4–5 s | 5.47 / 5.52 |
|
||||
| 5–~5.6 s | 3.78 / 3.51 |
|
||||
|
||||
The apply change does not materially change generation occupancy. It removes the long post-generation queue wait, especially for the far LODs. Last visible apply per LOD, measured from the same spawn origin:
|
||||
|
||||
| LOD | Worker-seconds CVar 0 / default 1 | Last apply CVar 0 / default 1 |
|
||||
|---|---:|---:|
|
||||
| 0 | 3.827 / 3.725 | 1.444 / 1.403 s |
|
||||
| 1 | 3.792 / 3.895 | 2.292 / 2.283 s |
|
||||
| 2 | 0.813 / 0.806 | 2.857 / 2.849 s |
|
||||
| 3 | 2.139 / 2.064 | 3.355 / 3.330 s |
|
||||
| 4 | 6.685 / 6.590 | 4.352 / 4.276 s |
|
||||
| 5 | 1.599 / 1.528 | 4.930 / 4.660 s |
|
||||
| 6 | 2.076 / 2.077 | 5.383 / 5.060 s |
|
||||
| 7 | 1.865 / 1.928 | 5.802 / 5.338 s |
|
||||
| 8 | 4.280 / 4.171 | 7.182 / 6.019 s |
|
||||
|
||||
LOD8 last worker/apply were 6.068/7.182 s in the control and 6.015/6.019 s with the startup budget. That 1.114 s control-side wait nearly vanishes under the higher budget. LOD4 remains the highest total worker cost but not the completion tail.
|
||||
|
||||
### Tick and 40 m/s ring
|
||||
|
||||
`UWorld::Tick` p95/max from the matched 6 m/s spawn and subsequent normal-walk windows:
|
||||
|
||||
| Window | CVar 0 spawn | Default 1 spawn | CVar 0 walk | Default 1 walk |
|
||||
|---|---:|---:|---:|---:|
|
||||
| Tick p95 / max | 1.805 / 5.374 ms | 2.740 / 5.175 ms | 2.364 / 28.993 ms | 2.483 / 28.876 ms |
|
||||
|
||||
The normal-walk p95 changed by 0.119 ms and max by -0.117 ms; the normal authored budget is restored after startup. In a separate fresh 40 m/s default run, 75/75 moving support-center samples had the full 9/9 ring (100%); first/last sample were 30.207/45.015 s. That high-speed stress run measured spawn tick p95/max 2.426/14.061 ms and walk tick p95/max 31.428/56.628 ms. It is a 40 m/s stress measure, not the normal-walk comparison.
|
||||
|
||||
## Quality and determinism
|
||||
|
||||
No density, mesh generation, collision arithmetic or recipe output changed, so no recipe version bump is needed. The apply pacing change is shared by all world families. All requested gates passed:
|
||||
|
||||
- Core off at 12.5 cm: legacy path passed.
|
||||
- M2 Hybrid V1 and V2 fixtures: all analytic fixtures and border checks passed.
|
||||
- SurfaceWorld BuildHost at 25 cm: passed; actor collision, anchors and carve/fill checks passed; water remains fixed for the season.
|
||||
- FloatingIslands BuildHost at 25 cm: passed; capsule contact, island/span height, carve/fill and switch-off legacy checks passed.
|
||||
- S3/S4 standalone audit: S3 72 samples, max 0.0427 cm; S4 128 samples, max 0.0504 cm; both within 2 cm. The 100 cm negative control was detected for both. Cap census 385/385, coverage 2,520/2,520 (100%), no misses.
|
||||
- 40 m/s walkable ring: 75/75 samples at 9/9 (100%).
|
||||
|
||||
Current-build worker hash matrices were stable:
|
||||
|
||||
| Run family / workers | Density | Mesh | Payload | Topology |
|
||||
|---|---|---|---|---|
|
||||
| Standalone W1/W8/W12 | `c10697a8f48380c7` | `e75c9119a1498cd5` | `49a9a8d1835a6c8c` | `edcb23288b5e8724` |
|
||||
| SurfaceWorld BuildHost W1/W8/W16 | `0cd2a1a4152ee4aa` | `a06243aee16b65d5` | `c700162935c262d7` | `0af901aa42b452bc` |
|
||||
| FloatingIslands BuildHost W1/W8/W16 | `4dcfb37585d7d986` | `f14f76fbf065c6ed` | `53035c45fd1a082e` | `23550100654a4ec3` |
|
||||
|
||||
## Commands and artifacts
|
||||
|
||||
Fresh matched 6 m/s pair (the first command is the CVar negative control; the second omits the override to exercise the code default):
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StartupApplyBoost 0 -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
40 m/s ring confirmation:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 4000 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Quality commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-audit --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
Determinism commands were run serially at Normal priority and affinity 4095. Standalone used the same command for workers 1, 8 and 12:
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=$workers --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
BuildHost W1/W8/W16 matrices were part of the SurfaceWorld and FloatingIslands 25 cm gates above. Build commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\BuildVoxelForgeCoreHost.ps1 -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
.\Standalone\Build.ps1 -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
```
|
||||
|
||||
The BuildHost trace JSONL files remain under `Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/`; paired names begin `CoreWorldValidation-owner_surface_stream_trace_only_applyboost_0_...move_600...` and `...applyboost_default_...move_600...`. The 40 m/s trace uses `...applyboost_default_...move_4000...`. They remain in Saved, including files over 300 KB. Standalone stdout logs are in `Saved/BuildHost/Round15/`.
|
||||
|
||||
Final binary SHA-256:
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` | `E2744E97F3690A4B125E01E4AC89CD21D6771BFD70F72B71301411FDDAEFA56C` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `D87CC56BACCDE6559705EEAEA7DB73D1A6ABF79484D37A3887B94A9FD62BABD3` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `C7F00CD4BD150236C1BAD2BB2D54E6617A9F4313C1CFE64487928CD400442459` |
|
||||
| Standalone `VoxelForgeCoreStandalone.exe` | `68C81625911DF9764354C3D75A059B8A735423110D66EF3D50916199F066E9ED` |
|
||||
|
||||
## Build, run and async-safety notes
|
||||
|
||||
- BuildHost compiled successfully with 12 max parallel actions. Standalone `All` compiled successfully with 12 workers at Normal priority. The existing `vswhere.exe` lookup warnings and `VoxelStrateManager.cpp` C4838 conversion warnings remain.
|
||||
- Fresh processes were run serially, at Normal priority, with a 12-thread maximum. Free memory was above 17 GiB before the final launches; measured BuildHost peak private memory stayed below 3.7 GiB. No Unreal/Standalone process is running now. Each step stayed under the 15-minute limit.
|
||||
- A first Standalone determinism launcher invocation had a PowerShell parse error from `W$workers:` interpolation before launching any process. The launcher was corrected to `${workers}` and all W1/W8/W12 runs passed. No binary run failed, no `0xC0000142` occurred and no retry was needed.
|
||||
- `Saved/BuildHost/HostProject/Saved/Crashes/` contains only the pre-existing `UECC-Windows-F1A3EFD5469F5DD62E68EBBACAC84376_0000` (2026-09-17); no new UECC folder appeared.
|
||||
- Async safety was checked in the source diff: no worker or queue behavior changed. Epoch validation, MPSC queue modes, EndPlay drain, worker `bShuttingDown` checks, `ModsLock`, region-page lifetime, and game-thread UObject/RMC mutation are untouched. The only new actor field records whether the first trace config record has been emitted.
|
||||
- No new source file. Compile spots: `Source/VoxelForge/Private/VoxelWorld.cpp` and `Source/VoxelForge/Public/VoxelWorld.h` compile in the BuildHost VoxelForge module; the harness edit is PowerShell only. No generated header, recipe core, or `.uasset` changed. Owner `.uproject` and editor were not opened or built. RealtimeMeshComponent was read-only.
|
||||
- No commit, push or stash.
|
||||
|
||||
## Files changed
|
||||
|
||||
- `Source/VoxelForge/Private/VoxelWorld.cpp` — default-on bounded startup budget and trace readback of the effective CVar/budgets.
|
||||
- `Source/VoxelForge/Public/VoxelWorld.h` — per-world one-time trace guard, with French and English comment.
|
||||
- `Tools/TestVoxelForgeCoreWorldHost.ps1` — `-1` means no override (exercise code default); explicit `0` remains the negative control.
|
||||
- `CODEMAP.md` section 3 — shared drain and trace behavior.
|
||||
- `ARCHITECTURE.md` section 8.32 — behavior and measured floor.
|
||||
|
||||
### Dialogue
|
||||
|
||||
**User:** Count first, identify the new 7.1 s floor from the trace, move shared behavior only when the CVar control proves it, and retain every quality/determinism gate.
|
||||
|
||||
**Codex:** The 4-mesh cap was holding completed LOD8 results for up to 1.1 s. The bounded 12-mesh/14 ms startup budget removed that backlog and brought the set to 5.96 s while preserving the 0.486 s walkable ring and all quality gates. The remaining measured span is 5.58 s of generation/admission; the trace narrows it to frame-paced refill and worker supply but cannot isolate actor tick refill from task-backend dispatch variation.
|
||||
@@ -0,0 +1,302 @@
|
||||
# World Assembler S12 — Round 16
|
||||
|
||||
**2026-10-19 · worker supply and tick-independent task pickup**
|
||||
|
||||
## Result
|
||||
|
||||
The matched 25 cm SurfaceWorld run completed its 2,578-tile set in **4.911 s** on the actor startup
|
||||
clock, down from Round15's **5.960 s**. From the first tile submission to readiness it took **4.537 s**,
|
||||
down from **5.603 s**. Full LOD0's last apply moved from 1.403 s to **1.087 s**. The stationary
|
||||
walkable ring measured **0.509 s** (Round15: 0.488 s). The 40 m/s trace kept the 3×3 collision-ready
|
||||
ring at 9/9 for every moving gate sample.
|
||||
|
||||
The measured ceiling was eight tile workers, not ten: with 12 CPUs in the process affinity, Unreal
|
||||
reported 10 TaskGraph workers split into two foreground and eight background workers. Tile tasks
|
||||
use background priorities, so I sized their admission slots to the eight background workers. A
|
||||
short, ordered TaskGraph queue keeps those workers supplied between actor ticks. No density,
|
||||
triangulation, collision, or Core recipe output changed; recipe versions stay unchanged.
|
||||
|
||||
## Pool count and priority
|
||||
|
||||
| Measurement | BuildHost result |
|
||||
|---|---:|
|
||||
| Process affinity / priority | `0xFFF` (12 CPUs) / Normal |
|
||||
| `UE::Tasks` scheduler workers / reported maximum | 10 / 20 |
|
||||
| `FTaskGraphInterface` workers | 10 total: 2 foreground, 8 background |
|
||||
| `GThreadPool` workers | 10; separate from TaskGraph |
|
||||
| Step1 cook pool | 0 threads |
|
||||
| Tile task API / priority | `UE::Tasks::Launch`; near `BackgroundHigh`, horizon `BackgroundNormal` |
|
||||
| Scheduler worker / background priority fields | 5 / 2 in `worker_backend_config` |
|
||||
| Unique tile worker thread IDs / peak simultaneous tile tasks | 8 / 8 |
|
||||
|
||||
RMC's inspected async collision path calls `DoOnAllowedThread(AsyncThread)`; that implementation
|
||||
queues work on `GThreadPool` (`RealtimeMeshFuture.h:147–165`,
|
||||
`RealtimeMeshManaged.cpp:703–707`). It therefore does not consume the eight TaskGraph background
|
||||
worker IDs used by tile generation. Other UE background work can share TaskGraph's workers; this
|
||||
trace attributes tile work by OS thread ID but does not label every unrelated engine task. The
|
||||
external process sampler counted 40 OS threads after initialization and 58–60 while running,
|
||||
including engine service threads. The 12-CPU affinity limits simultaneous CPU execution; it is not
|
||||
a 12-OS-thread process cap. VoxelForge tile generation itself peaked at eight workers, and the
|
||||
BuildHost process priority stayed Normal.
|
||||
|
||||
## Shared scheduler and trace
|
||||
|
||||
Two read-back CVars control the shipped behavior:
|
||||
|
||||
| CVar | Default | Negative control | Effect |
|
||||
|---|---:|---:|---|
|
||||
| `voxel.StreamingReadyQueueDepth` | 8 | 0 | Admit up to one extra worker-set of prioritized tasks |
|
||||
| `voxel.StreamingBackgroundWorkerCap` | 1 | 0 | Size streaming slots to TaskGraph background workers; 0 restores the logical-core cap |
|
||||
|
||||
With the selected defaults, effective tile slots are 8 and the total admission cap is 16. Near
|
||||
tasks retain `BackgroundHigh`; horizon tasks retain `BackgroundNormal`. While moving, the dynamic
|
||||
near reserve is 7, the near admission cap is 8, and the coarse cap is 9. Collision look-ahead and
|
||||
critical/edit admission retain their existing precedence. The game-thread scheduler continues to
|
||||
select and submit from the desired-tile ordering; there is no worker-owned continuation list. UE
|
||||
dispatches an already-admitted task as a background worker becomes free. `bStreamingPlayerMoving` is
|
||||
a game-thread snapshot shared by `LoadTile` and `LoadCoreTile`.
|
||||
|
||||
Queued tasks retain `GenerationEpoch`, `DesiredEpoch`, and per-request cancellation checks. A desired
|
||||
set change obsoletes stale queued work, workers still check `bShuttingDown`, and results still return
|
||||
through the MPSC queues for game-thread application. No UObject or RMC component mutation moved to a
|
||||
worker. The trace records CVar readbacks in `worker_backend_config` and
|
||||
`streaming_worker_cap_readback`, and records each tile's submission, worker start/end, thread ID,
|
||||
next scheduler pass, next submission, and next task start on that worker.
|
||||
|
||||
### Initial-set timeline
|
||||
|
||||
The following busy-worker equivalents integrate the 2,578 tile intervals in 500 ms bins from the
|
||||
first submission (`submitted_t_s=0.456843` on the trace clock). The final short bin is 10.7 ms.
|
||||
|
||||
| Time from first submission | Busy worker equivalents, out of 8 |
|
||||
|---|---:|
|
||||
| 0–0.5 s | 6.16 |
|
||||
| 0.5–1.0 s | 5.94 |
|
||||
| 1.0–1.5 s | 4.82 |
|
||||
| 1.5–2.0 s | 4.38 |
|
||||
| 2.0–2.5 s | 7.83 |
|
||||
| 2.5–3.0 s | 7.98 |
|
||||
| 3.0–3.5 s | 6.58 |
|
||||
| 3.5–4.0 s | 7.47 |
|
||||
| 4.0–4.5 s | 7.67 |
|
||||
| 4.5–4.511 s | 1.75 |
|
||||
|
||||
All eight worker IDs were used. The initial set accumulated **29.432 worker-seconds**; the first
|
||||
worker started at 0.456872 and the last ended at 4.967520 on the trace clock, a 4.511 s worker
|
||||
span. That workload has a 3.679 s ideal at eight fully occupied slots (2.943 s at ten); the
|
||||
measured worker span was 4.511 s. Per-slot idle gaps between one tile ending and that worker's next tile starting summed to
|
||||
**6.573 slot-seconds** over 2,570 gaps: p50 0.006 ms, p95 13.604 ms, max 16.800 ms.
|
||||
|
||||
| Worker thread ID | Tiles | Inter-task idle seconds | Gap p95 / max |
|
||||
|---:|---:|---:|---:|
|
||||
| 20144 | 324 | 0.838 | 13.780 / 15.607 ms |
|
||||
| 21468 | 318 | 0.829 | 13.489 / 16.800 ms |
|
||||
| 21536 | 304 | 0.830 | 13.237 / 15.902 ms |
|
||||
| 23392 | 327 | 0.832 | 13.476 / 15.691 ms |
|
||||
| 23572 | 331 | 0.821 | 13.365 / 15.916 ms |
|
||||
| 23616 | 331 | 0.847 | 13.765 / 15.773 ms |
|
||||
| 2716 | 321 | 0.734 | 13.486 / 15.801 ms |
|
||||
| 5392 | 322 | 0.843 | 13.657 / 15.556 ms |
|
||||
|
||||
The scheduler recorded 247 admission passes, 243 with submissions, averaging 10.61 tiles per
|
||||
non-empty pass. Peak initial scheduler backlog was 32; the whole trace's result-backlog peak was
|
||||
35 tiles / 1,620,010 bytes against the 256-tile cap, with zero cap stops. The completed-result
|
||||
queue itself peaked at five during initial readiness.
|
||||
|
||||
`Saved/BuildHost/Round16/initial_tile_worker_timeline.csv` contains one row per initial tile,
|
||||
including submitted/start/end, next scheduler admission, next submission, same-thread next start,
|
||||
and the calculated idle gap. The 500 ms busy bins, per-LOD totals, and per-thread idle table are
|
||||
also saved there. Files larger than 300 KB remain under `Saved/BuildHost/`.
|
||||
|
||||
### Per-LOD completion and work
|
||||
|
||||
S12 worker-end/apply values below are normalized to the actor startup clock; S11 apply values are
|
||||
from the Round15 matched report. S12 worker task totals were higher in this sample even though the
|
||||
set finished sooner; the scheduler changes do not change tile contents.
|
||||
|
||||
| LOD | Tiles | Worker seconds S11 → S12 | S11 last apply | S12 last worker / last apply |
|
||||
|---:|---:|---:|---:|---:|
|
||||
| 0 | 512 | 3.725 → 4.018 | 1.403 s | 1.084 / 1.087 s |
|
||||
| 1 | 448 | 3.895 → 4.099 | 2.283 s | 1.749 / 1.757 s |
|
||||
| 2 | 320 | 0.806 → 0.825 | 2.849 s | 2.107 / 2.122 s |
|
||||
| 3 | 272 | 2.064 → 2.296 | 3.330 s | 2.469 / 2.484 s |
|
||||
| 4 | 272 | 6.590 → 7.682 | 4.276 s | 3.431 / 3.440 s |
|
||||
| 5 | 208 | 1.528 → 1.732 | 4.660 s | 3.706 / 3.709 s |
|
||||
| 6 | 144 | 2.077 → 2.160 | 5.060 s | 4.048 / 4.062 s |
|
||||
| 7 | 96 | 1.928 → 2.044 | 5.338 s | 4.289 / 4.293 s |
|
||||
| 8 | 306 | 4.171 → 4.576 | 6.019 s | 4.885 / 4.894 s |
|
||||
|
||||
LOD4 remains the largest worker-cost group: 7.682 s across 272 tiles, or 28.24 ms per tile.
|
||||
The tile trace attributes this to the overall generation task (`generation_s`); it does not break
|
||||
the worker interval into density/classification/meshing stages (`classify_s` and `mesh_s` are not
|
||||
populated for these rows). Its last apply was 3.440 s, so it did not set the tail. I made no LOD4
|
||||
content optimization without the requested stage attribution and quality-capture work.
|
||||
|
||||
## Apply, tick, and motion results
|
||||
|
||||
| Metric | Round15 S11 | Round16 S12 |
|
||||
|---|---:|---:|
|
||||
| Full set ready, actor startup clock | 5.960 s | 4.911 s |
|
||||
| First submission to full ready | 5.603 s | 4.537 s |
|
||||
| Worker span from first submission | 5.581 s | 4.511 s |
|
||||
| Worker-seconds | 26.786 s | 29.432 s |
|
||||
| Walkable ring, 9/9 | 0.488 s | 0.509 s |
|
||||
| Full LOD0 last apply | 1.403 s | 1.087 s |
|
||||
| Apply frames through readiness | 332 | 268 |
|
||||
| Apply-count limit frames | 0 | 11 |
|
||||
| Max visible mesh applies / frame | 10 | 12 |
|
||||
| Total measured apply time | 236.14 ms | 255.17 ms |
|
||||
| Max apply time / frame | 2.357 ms | 2.697 ms |
|
||||
| Result-wait p95 / max | 16.62 / 19.26 ms | 16.90 / 21.03 ms |
|
||||
| Result backlog peak / cap | 10 / 256 | 35 / 256 |
|
||||
|
||||
`UWorld::Tick` spawn and normal-walk windows were measured in fresh processes:
|
||||
|
||||
| Window | S11 p95 / max | S12 p95 / max | Change |
|
||||
|---|---:|---:|---:|
|
||||
| Spawn | 2.740 / 5.175 ms | 3.344 / 5.219 ms | +0.604 / +0.044 ms |
|
||||
| Normal walk | 2.483 / 28.876 ms | 2.744 / 28.752 ms | +0.261 / −0.124 ms |
|
||||
|
||||
The maxima stayed effectively flat or lower, while p95 rose by 0.60 ms at spawn and 0.26 ms while
|
||||
walking. I record this as a small p95 increase rather than claiming strict p95 non-regression. Both
|
||||
candidate p95 values remained below 3.4 ms.
|
||||
|
||||
The 40 m/s run used the same queue and slot defaults. It completed the initial set in 4.919 s;
|
||||
all **75/75** moving `walkable_gate` events reported 9/9, and all 58 moving streaming samples
|
||||
reported the ring ready. Spawn tick p95/max was 3.173/8.071 ms; the accelerated walk window was
|
||||
29.562/39.227 ms. The 40 m/s trace's collision look-ahead, dynamic reserve, and moving near cap
|
||||
readbacks are present in the JSONL.
|
||||
|
||||
### Negative controls and rejected variants
|
||||
|
||||
| Read-back settings | Effective slots / actual worker IDs | Full set ready | Result |
|
||||
|---|---:|---:|---|
|
||||
| Queue depth 0, worker cap 1 | 8 / 8 | 7.024 s | Disabling the ready queue removes the speedup |
|
||||
| Queue depth 8, worker cap 0 | 10 / 8 | 4.669 s | Restores logical-core admission; still only eight background IDs ran |
|
||||
| Queue depth 8, worker cap 1 | 8 / 8 | 4.911 s | Selected default, sized to actual background workers |
|
||||
|
||||
The first 40 m/s queue prototype lacked the queue-aware moving reserve and LOD0 admission cap; it
|
||||
missed the ring in 56/77 gate events and 47/57 streaming samples. Adding the reserve alone was
|
||||
insufficient. The final moving near cap and reserve passed 75/75 gate events. Reducing the shared
|
||||
Core task cap itself to eight increased per-tile generation cost and made the full set 5.30 s, so
|
||||
that change was reverted; only streaming admission is background-worker-capped.
|
||||
|
||||
Foreground-priority variants were also rejected. Raising all tile work to foreground priorities
|
||||
used ten worker IDs but produced 39.422/50.432 ms spawn and 49.137/83.184 ms walk p95/max, with a
|
||||
5.215 s set. Raising only near work produced an 86.225 ms walk maximum. The final build keeps the
|
||||
original background priorities.
|
||||
|
||||
## Determinism and quality gates
|
||||
|
||||
- Standalone W1/W8/W12 all passed with identical full-clipmap hashes: density
|
||||
`c10697a8f48380c7`, mesh `e75c9119a1498cd5`, payload `49a9a8d1835a6c8c`, topology
|
||||
`edcb23288b5e8724`.
|
||||
- BuildHost SurfaceWorld W1/W8/W16 passed with stable density/mesh/payload/topology hashes
|
||||
`0cd2a1a4152ee4aa / a06243aee16b65d5 / c700162935c262d7 / 0af901aa42b452bc`.
|
||||
- BuildHost FloatingIslands passed at 25 cm; W1/W8/W16 were stable with hashes
|
||||
`4dcfb37585d7d986 / f14f76fbf065c6ed / 53035c45fd1a082e / 23550100654a4ec3`.
|
||||
- Core-off legacy gate passed at 12.5 cm (`legacy_unchanged=PASS`). M2 Hybrid V1 and V2 analytic
|
||||
fixture and border suites passed at 25 cm.
|
||||
- The current Standalone far-cap audit passed S4 agreement: 128 shared points, maximum far/near
|
||||
difference 0.0504 cm against a 2 cm tolerance; the 100 cm negative control was detected. Coverage
|
||||
was 2520/2520 (100%), with zero missing mesh/profile crossings. S3's prior 72-point audit remains
|
||||
at 0.0427 cm; scheduler changes do not touch that Core content path.
|
||||
- The 25 cm SurfaceWorld and FloatingIslands gates both passed. No world recipe version changed.
|
||||
|
||||
## Builds, commands, and hashes
|
||||
|
||||
Builds completed:
|
||||
|
||||
```powershell
|
||||
.\Tools\BuildVoxelForgeCoreHost.ps1 -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
.\Standalone\Build.ps1 -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
```
|
||||
|
||||
The matched SurfaceWorld trace command was:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 1 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The 40 m/s and negative-control commands were:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 4000 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 1 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -StreamingReadyQueueDepth 0 -StreamingBackgroundWorkerCap 1 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 0 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
Quality commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The S3/S4 Standalone agreement and coverage audit command was:
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --world-assembler-audit --workers=12 --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --process-priority=Normal --process-affinity=4095 --frame-limit=60 > Saved/BuildHost/Round16/standalone_S3S4_audit.stdout.log 2> Saved/BuildHost/Round16/standalone_S3S4_audit.stderr.log
|
||||
```
|
||||
|
||||
Standalone determinism ran serially at Normal priority, affinity `4095`, and frame limit 60. Each
|
||||
worker count used the same remaining arguments and output paths below:
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=1 --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60 > Saved/BuildHost/Round16/standalone_W1.stdout.log 2> Saved/BuildHost/Round16/standalone_W1.stderr.log
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=8 --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60 > Saved/BuildHost/Round16/standalone_W8.stdout.log 2> Saved/BuildHost/Round16/standalone_W8.stderr.log
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=12 --world-assembler-prototype --stream-benchmark --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60 > Saved/BuildHost/Round16/standalone_W12.stdout.log 2> Saved/BuildHost/Round16/standalone_W12.stderr.log
|
||||
```
|
||||
|
||||
SHA-256 records. Streaming and quality runs used the first VoxelForge module hash. After those runs,
|
||||
I added the French half of one inline comment and rebuilt the current tree; that comment-only rebuild
|
||||
produced the second module hash. The executable code did not change between those two hashes.
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` used for timing and gates | `C9D5DA90B48C5C1F844221C4A6A195947016C522F6A296EBC488A1AD8CCC6EEF` |
|
||||
| Current rebuilt BuildHost `UnrealEditor-VoxelForge.dll` | `12E7883DFB8825012890F1A2B5BACD038AA40FD1C342AA70711EC55AABF9057F` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `D87CC56BACCDE6559705EEAEA7DB73D1A6ABF79484D37A3887B94A9FD62BABD3` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `805FB845F00D013B48E29D4FD5D56EF1531E43F68047AE499DC617B04864DF80` |
|
||||
| Standalone `VoxelForgeCoreStandalone.exe` | `4EBE946E4D7B245458CD4FD0FBC3FCD6988B98000685C0043B25CD629AFC0F30` |
|
||||
|
||||
## Failed attempts and safety review
|
||||
|
||||
- One intermediate BuildHost compile failed because `PlayerHeading` was out of scope in two loader
|
||||
admission helpers. I replaced those reads with the game-thread `bStreamingPlayerMoving` snapshot;
|
||||
the final BuildHost and Standalone builds passed.
|
||||
- Two early external-sampler attempts failed before launching Unreal (a PowerShell job argument
|
||||
was flattened, then `Get-Counter` requested an unsupported counter). The later sampler ran. No
|
||||
Unreal run failed; no `0xC0000142` occurred and no retry was needed.
|
||||
- The final SurfaceWorld command completed under 15 minutes with 3.75 GB peak private memory;
|
||||
FloatingIslands completed with 3.26 GB. The Windows free-memory query was denied during the latter
|
||||
launch, but the BuildHost runner's preflight guard allowed it. No Unreal process remains running.
|
||||
- Standalone compiled with existing warnings: `vswhere.exe` was not found on `PATH`, and
|
||||
`VoxelStrateManager.cpp` emitted C4838 double-to-float conversion warnings. The `All` build
|
||||
completed successfully.
|
||||
- `Saved/BuildHost/HostProject/Saved/Crashes/` contains only the pre-existing
|
||||
`UECC-Windows-F1A3EFD5469F5DD62E68EBBACAC84376_0000`; no new crash folder appeared.
|
||||
- Diff review confirmed the result queues remain `EQueueMode::Mpsc`; `EndPlay` waits for active
|
||||
tasks and drains queues; workers check `bShuttingDown`; epoch and cancellation checks remain;
|
||||
`ModsLock` still guards mod data; core pages retain shared ownership through readers; and UObject
|
||||
/ RMC component mutation remains on the game thread. No queue mode or page ownership changed.
|
||||
- No source file was added. C++ compile spots are `Source/VoxelForge/Private/VoxelWorld.cpp`,
|
||||
`Source/VoxelForge/Public/VoxelWorld.h`, `Source/VoxelForge/Private/VoxelStartupTrace.cpp`, and
|
||||
`Source/VoxelForge/Public/VoxelStartupTrace.h` in the BuildHost VoxelForge module. The test-harness
|
||||
change is PowerShell in `Tools/TestVoxelForgeCoreWorldHost.ps1`; no Core source, generated header,
|
||||
`.uasset`, owner `.uproject`, or editor was modified or built.
|
||||
- No commit, push, or stash was created. RealtimeMeshComponent was read-only.
|
||||
|
||||
### Dialogue
|
||||
|
||||
**User:** Count the workers and their idle gaps, preserve the streaming priorities and safety rules,
|
||||
and get the full set under six seconds without losing the 40 m/s walkable ring.
|
||||
|
||||
**Codex:** The actor had ten TaskGraph workers available but only eight background workers for its
|
||||
background-priority tile tasks. A queue of eight plus an eight-slot admission cap reduced the
|
||||
2,578-tile startup to 4.911 s; the moving 3×3 ring stayed ready in all 75 gate samples. The process
|
||||
remains Normal priority and limited to 12 CPUs. The measured p95 tick increase is small but recorded,
|
||||
and the worker pool shows why this round did not reach the 3 s ideal for ten workers.
|
||||
@@ -0,0 +1,277 @@
|
||||
# World Assembler S13 — Round 17
|
||||
|
||||
**2026-10-19 · What does a tile actually cost?**
|
||||
|
||||
## Result
|
||||
|
||||
No generation optimization shipped. The measurements show that owner-plan tile time is mostly
|
||||
column evaluation plus MC, that LOD4 is dominated by column-cache misses, and that cross-worker XY
|
||||
reuse is common. The interpolation and global octave-drop probes fail the 2 cm quality bar. A shared
|
||||
column page still needs a measured candidate with bounded memory, synchronization, and lifecycle
|
||||
proof, so I did not add one. Density, mesh, collision, and recipe output are unchanged; no recipe
|
||||
version bump is needed.
|
||||
|
||||
The current BuildHost 40 m/s trace passed the support gate **75/75**. It reported a 4.825 s
|
||||
initial-set ready time, 28.760 worker-seconds, and a 0.510 s stationary ring. The last initial LOD0
|
||||
tile applied at 1.146 s. At 40 m/s, `UWorld::Tick` was 3.133/5.426 ms p95/max at spawn and
|
||||
30.314/43.142 ms while walking. The worker-second and full-set targets passed in this trace; the
|
||||
LOD0 and strict S12 tick-tail targets did not. Startup-clock measurements and worker-task intervals
|
||||
use different origins from the S12 actor report, so I do not treat 4.825 s as an apples-to-apples
|
||||
replacement for S12's 4.911 s.
|
||||
|
||||
## 1. Exclusive tile cost on the owner plan
|
||||
|
||||
The BuildHost audit measures eight cold, no-hash tiles per requested LOD, with a separate hashed
|
||||
full-feature-list versus per-tile-list parity check (`hashes_identical=1`). The table gives p95
|
||||
stage time and the p95 of each tile's `stage time / density samples`, in `ms / ns per sample`.
|
||||
Percentiles are computed independently, so stage p95 values do not add to the full-tile p95. The
|
||||
sample denominator includes the normal halo: LOD0–1 are 32 MC cells / 35³ = 42,875 samples;
|
||||
LOD3–8 are 16 coarse cells / 19³ = 6,859 samples. The owner configuration is not a 32³ lattice at
|
||||
every LOD.
|
||||
|
||||
| LOD | Full scan → per-tile list p95 (ms) | Classify excl. | MC column eval. | MC excl. | Ground column eval. | Ground excl. | Cap column eval. | Cap excl. | Mesh assembly |
|
||||
|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
|
||||
| 0 | 13.806 → 14.160 | 0.0064 / 0.15 | 3.708 / 86.48 | 10.436 / 243.40 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0.0251 / 0.59 |
|
||||
| 1 | 9.616 → 9.584 | 0.0821 / 0.02 | 4.096 / 95.52 | 7.191 / 167.72 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0.0314 / 0.73 |
|
||||
| 3 | 6.952 → 6.878 | 0.0286 / 9.90 | 3.989 / 1,090.54 | 2.879 / 419.80 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0.0075 / 2.97 |
|
||||
| 4 | 36.445 → 35.790 | 0.0015 / 0.22 | 29.361 / 4,280.71 | 2.948 / 429.84 | 0 / 0 | 0.0001 / 0.01 | 4.865 / 709.35 | 1.259 / 183.61 | 0.0231 / 3.37 |
|
||||
| 5 | 10.586 → 10.420 | 0.0010 / 0.15 | 2.958 / 431.27 | 1.195 / 174.25 | 4.894 / 713.57 | 2.234 / 325.63 | 0.405 / 59.06 | 0.241 / 35.08 | 0.0054 / 0.79 |
|
||||
| 8 | 14.778 → 14.507 | 0.0046 / 0.67 | 5.671 / 826.84 | 2.366 / 345.01 | 1.775 / 258.74 | 1.652 / 240.87 | 1.823 / 265.78 | 1.348 / 196.50 | 0.0252 / 3.67 |
|
||||
|
||||
The paired full/candidate timings are the feature-query negative control: the full plan scans feature
|
||||
bounds; the candidate builds the per-tile feature lists used by Core. All tested hashes matched.
|
||||
Their timing differences are small and mixed in sign. Feature-list p95 itself was only 0.0009–
|
||||
0.0015 ms on this owner sample.
|
||||
|
||||
There is no separate volumetric 3D density-noise stage in native SurfaceWorld. Its surface recipe
|
||||
does call `FractalNoiseQ16`/Perlin while evaluating 2D XY columns, so that work is included in
|
||||
column evaluation. Material/color assignment is not a separate timer; it is included in meshing and
|
||||
the final mesh/payload path. The current route has no tunnel, room, shaft, or route-density stage.
|
||||
Classification-exclusive time subtracts column work done while classifying; MC/ground/cap column
|
||||
time is reported beside the corresponding non-column exclusive time. The `horizon_p95_ms` counter
|
||||
wraps ground and cap refinement and is inclusive, so it is not another exclusive stage. Far-shell
|
||||
repair was negligible in this sample (at most 0.0003 ms p95).
|
||||
|
||||
### Why LOD4 is expensive
|
||||
|
||||
LOD4 full tile p95 is 35.790 ms, versus 6.878 ms at LOD3 and 10.420 ms at LOD5. LOD4 is the first
|
||||
cap-refined level: it samples cap at 16 voxels (4 m); LOD3 has no cap refinement, and LOD5 cap uses
|
||||
the 128-voxel (32 m) boundary grid. Ground refinement starts at LOD5. LOD4's cap work costs
|
||||
4.865 ms of column evaluation and 1.259 ms exclusive at p95.
|
||||
|
||||
That cap difference does not explain most of the spike. LOD4 MC performs 29.361 ms p95 of column
|
||||
evaluation, and its sampled tile has 8,224 column misses versus 1,634 at LOD3 and 1,916 at LOD5.
|
||||
Thus the measured anomaly is primarily poor column reuse at LOD4, with cap refinement adding a
|
||||
smaller separate cost. The data does not isolate why the thread-local direct-mapped cache misses
|
||||
rise at LOD4; tile extent, halo/normal probes, and XY spread all differ with LOD.
|
||||
|
||||
## 2. Do far tiles evaluate detail they cannot show?
|
||||
|
||||
The LOD8 tile p95 spends 9.203 ms in column evaluation out of 14.507 ms. There is no volumetric
|
||||
cave-noise loop in this path, but the 2D heightfield recipe still evaluates its full configured
|
||||
noise octaves at every requested XY column. A measurement-only probe dropped the highest one or two
|
||||
octaves globally on two LOD8 tiles. It reported 26.50% / 40.31% less column time, but ground-height
|
||||
p95 errors of 7,545 / 7,581 cm and cap-height errors of 2,427 / 7,859 cm; all 578 cap samples were
|
||||
over 2 cm. Near LOD0–1 the same probe was slower than baseline, so its timing is not a reliable
|
||||
frequency cost estimate. It also renormalizes the remaining octaves and does not implement a
|
||||
per-recipe wavelength cutoff at half the MC cell size.
|
||||
|
||||
This rejects global octave removal. A frequency-aware cutoff could change appearance while keeping
|
||||
determinism, but this probe does not justify a cutoff or quantify its screen-space result. It was
|
||||
measurement-only and did not affect tile hashes.
|
||||
|
||||
## 3. Per-tile feature lists and 2D cache reuse
|
||||
|
||||
Core's `World::generateTile` builds bounded per-tile query lists for overlapping
|
||||
`Heightfield2D` strata and `FloatingIslandFieldV1` plans, including the normal halo. Those two
|
||||
WorldAssembler families share the scoped feature-list route. The legacy Unreal `UVoxelGenerator`
|
||||
room/tunnel/shaft families use their own room, tunnel, and generator caches; Round 1's Core tile list
|
||||
is not one shared list for all legacy generator families. On the owner SurfaceWorld tiles, list-build
|
||||
time is under 0.002 ms p95.
|
||||
|
||||
`Heightfield2D::point(x,y,z)` may be called at many Z/normal samples, but the thread-local XY cache
|
||||
normally evaluates a column once per worker-cache miss. The cold BuildHost sample shows:
|
||||
|
||||
| LOD | Field-point calls p95 | Column misses p95 | Approx. hit rate |
|
||||
|---:|---:|---:|---:|
|
||||
| 0 | 44,100 | 2,244 | 94.9% |
|
||||
| 1 | 44,100 | 2,289 | 94.8% |
|
||||
| 3 | 4,191 | 1,634 | 61.0% |
|
||||
| 4 | 9,405 | 8,224 | 12.6% |
|
||||
| 5 | 8,197 | 1,916 | 76.6% |
|
||||
| 8 | 4,441 | 2,708 | 39.0% |
|
||||
|
||||
The Standalone W8 capture recorded all tiles and all LODs. `repeated` means an XY coordinate was
|
||||
re-evaluated by a different same-LOD tile; the neighbor count includes any prior adjacent tile,
|
||||
and the cross-worker column counts a neighbor repeat observed on a different worker.
|
||||
|
||||
| LOD | Tiles | Unique XY | Repeated tile evaluations | Neighbor repeats | Cross-worker neighbor repeats |
|
||||
|---:|---:|---:|---:|---:|---:|
|
||||
| 0 | 512 | 128,240 | 347,280 | 280,233 | 276,658 |
|
||||
| 1 | 448 | 103,302 | 300,242 | 249,825 | 244,941 |
|
||||
| 2 | 448 | 32,274 | 102,713 | 84,318 | 79,402 |
|
||||
| 3 | 384 | 33,279 | 87,158 | 81,680 | 78,272 |
|
||||
| 4 | 320 | 91,325 | 230,492 | 229,811 | 202,684 |
|
||||
| 5 | 144 | 71,950 | 118,630 | 118,580 | 112,191 |
|
||||
| 6 | 96 | 280,313 | 63,523 | 63,523 | 63,435 |
|
||||
| 7 | 48 | 71,529 | 7,780 | 7,780 | 7,138 |
|
||||
| 8 | 153 | 106,219 | 32,879 | 32,879 | 30,956 |
|
||||
|
||||
This makes immutable shared column pages worth a candidate A/B, especially for LOD0–5. The counts
|
||||
do not measure synchronization, page compilation, eviction, memory, or resulting wall-time savings.
|
||||
No page cache was added on counts alone. The column capture is opt-in, worker-local, and read back
|
||||
after generation.
|
||||
|
||||
## 4. Coarse-lattice interpolation probe
|
||||
|
||||
The measurement-only probe evaluated exact ground/cap columns at every MC XY sample, then sampled
|
||||
every second MC sample and bilinearly interpolated the rest. No near-zero or thin-feature fallback
|
||||
was included, so this is a lower-cost bound and a failure screen, not a production candidate. The
|
||||
table is two tiles per LOD. Errors are p95 over sampled columns; counts over 2 cm are explicit.
|
||||
|
||||
| LOD | Measured column-compute time saved at stride 2 | Ground p95 / >2 cm | Cap p95 / >2 cm |
|
||||
|---:|---:|---:|---:|
|
||||
| 0 | 73.48% | 0.78 cm / 0 of 2,178 | 1.32 cm / 25 of 2,178 |
|
||||
| 1 | 73.96% | 2.54 cm / 236 of 2,178 | 3.00 cm / 375 of 2,178 |
|
||||
| 3 | 71.99% | 388.62 cm / 405 of 578 | 37.70 cm / 397 of 578 |
|
||||
| 4 | 71.39% | 702.29 cm / 403 of 578 | 68.92 cm / 401 of 578 |
|
||||
| 5 | 71.27% | 1,248.85 cm / 411 of 578 | 87.74 cm / 395 of 578 |
|
||||
| 8 | 72.81% | 4,369.95 cm / 414 of 578 | 2,201.17 cm / 415 of 578 |
|
||||
|
||||
At stride two, exact column evaluations fell from 2,178 to 578 at LOD0–1 and from 578 to 162 at
|
||||
LOD3–8. The measured column-compute time reduction is shown above; it was 71–74%. Stride four
|
||||
reduced exact evaluations from 2,178 to 162 at LOD0–1 and from 578 to 50 at LOD3–8, roughly
|
||||
90–92%. It already gives LOD0 ground/cap p95 errors of 2.72/2.09 cm (293/2,178 and 123/2,178
|
||||
samples over 2 cm). At LOD1, stride two fails the
|
||||
2 cm threshold in both fields; coarse LOD errors are much larger. A near-zero exact fallback could
|
||||
recover surface crossings, but it was not simulated here and could erase much of the nominal saving.
|
||||
This probe does not exercise volumetric tunnel/wall thickness or the arrival-to-departure route
|
||||
law. No interpolation was enabled; exact sampled outputs, walkability, and route behavior are
|
||||
unchanged.
|
||||
|
||||
## 5. S12 worker-cap follow-up and current trace
|
||||
|
||||
The matched cap comparison kept `voxel.StreamingReadyQueueDepth=8` and changed only
|
||||
`voxel.StreamingBackgroundWorkerCap`. Both controls were recorded in the JSONL trace, as were the
|
||||
effective slots and the eight actual background worker count.
|
||||
|
||||
| Speed | Background cap | Effective slots / actual tile workers | Initial set ready | Spawn tick p95/max | Walk tick p95/max | Ring |
|
||||
|---:|---:|---:|---:|---:|---:|---:|
|
||||
| 6 m/s | 0 | 10 / 8 | 4.669 s | 3.483 / 5.184 ms | 2.708 / 28.581 ms | — |
|
||||
| 6 m/s | 1 | 8 / 8 | 4.745 s | 3.283 / 14.945 ms | 2.696 / 28.535 ms | — |
|
||||
| 40 m/s | 0 | 10 / 8 | 4.633 s | 3.455 / 5.468 ms | 32.345 / 55.115 ms | 75/75 |
|
||||
| 40 m/s | 1, matched | 8 / 8 | 4.712 s | 3.031 / 5.364 ms | 30.541 / 41.598 ms | 75/75 |
|
||||
| 40 m/s | 1, final build | 8 / 8 | 4.825 s | 3.133 / 5.426 ms | 30.314 / 43.142 ms | 75/75 |
|
||||
|
||||
Cap 0 gained only 76 ms at 6 m/s and about 79 ms in the matched 40 m/s pair, while its 40 m/s
|
||||
walk tick tail was substantially worse. The final cap-1 run confirms the ring at 75/75 gates. Keep
|
||||
cap 1 as the default; the latest tick p95/max is still 0.752/3.915 ms above Round 16's 29.562 /
|
||||
39.227 ms 40 m/s result, so the strict tick-tail target is not claimed.
|
||||
|
||||
On the final cap-1 40 m/s trace, the initial set contains 2,578 tiles and totals 28.760 worker-
|
||||
seconds. The worker-seconds by LOD were: LOD0 3.81, LOD1 3.94, LOD2 0.81, LOD3 2.36, LOD4 7.73,
|
||||
LOD5 1.68, LOD6 2.17, LOD7 1.97, LOD8 4.31. The ring was ready at 0.510 s; full initial set
|
||||
ready at 4.825 s. LOD0's last worker ended at 1.131 s and its last apply was at 1.146 s.
|
||||
|
||||
## Builds, quality, determinism, and files
|
||||
|
||||
Build commands:
|
||||
|
||||
```powershell
|
||||
.\Tools\BuildVoxelForgeCoreHost.ps1 -MaxParallelActions 12 -TimeoutSeconds 900
|
||||
.\Standalone\Build.ps1 -Target All -CompileWorkers 12 -BuildPriority Normal
|
||||
```
|
||||
|
||||
Measurement commands (each was a fresh process; BuildHost runs were serial, Normal priority, and
|
||||
limited to the 12-CPU affinity):
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -SharedFeatureAuditOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 0 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 600 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 1 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 4000 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 0 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -StreamingTraceOnly -StreamingOrder Legacy -NearReserveMode Dynamic -CoreVoxelSizeCm 25 -StreamingCollisionLookahead 1 -TestMoveDirection '0,1,0' -CoreRegionConcurrentAdmission 1 -StreamingResultBacklogCap 256 -TestMoveSpeedCmPerSecond 4000 -StreamingReadyQueueDepth 8 -StreamingBackgroundWorkerCap 1 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The final Standalone commands used the same options for each worker count; W8 also enabled the
|
||||
all-LOD overlap capture:
|
||||
|
||||
```powershell
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=1 --world-assembler-prototype --stream-benchmark --stream-pipeline --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=8 --world-assembler-prototype --stream-benchmark --stream-pipeline --stream-hash --profile-column-overlap --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
.\Standalone\bin\VoxelForgeCoreStandalone.exe --workers=12 --world-assembler-prototype --stream-benchmark --stream-pipeline --stream-hash --force-generate --clip-radius=3 --max-clip-level=8 --camera=0,-35,-487.94,0,-22 --far-horizon-lod8-step=0 --process-priority=Normal --process-affinity=4095 --frame-limit=60
|
||||
```
|
||||
|
||||
Current-build compatibility gates:
|
||||
|
||||
```powershell
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -CoreOffTest -CoreVoxelSizeCm 12.5 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV1 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -HybridFixturesOnly -CoreMesherRecipe WorldAssemblerHybridV2 -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
.\Tools\TestVoxelForgeCoreWorldHost.ps1 -FloatingIslandsOnly -CoreVoxelSizeCm 25 -TimeoutSeconds 900
|
||||
```
|
||||
|
||||
The current BuildHost SurfaceWorld actor run passed and reported stable W1/W8/W16 hashes:
|
||||
density/mesh/payload/topology `0cd2a1a4152ee4aa / a06243aee16b65d5 / c700162935c262d7 /
|
||||
0af901aa42b452bc`. The current BuildHost cap audit passed S4 agreement (128 points, max 0.0504 cm
|
||||
against 2 cm) and 1,584/1,584 cap rays (100%). The BuildHost actor run also passed S3 far-horizon
|
||||
agreement at max 0.0427 cm against 2 cm. Current Standalone W1/W8/W12 each matched full-view hashes:
|
||||
density/mesh/payload/topology `c10697a8f48380c7 / e75c9119a1498cd5 / 49a9a8d1835a6c8c /
|
||||
edcb23288b5e8724`. W8's final full-view pipeline was 3.518 s for 2,553/2,553 tiles.
|
||||
|
||||
The current-build Core-off gate passed `legacy_unchanged=PASS` at 12.5 cm. M2 Hybrid V1 and V2
|
||||
each passed all five analytic fixtures and the border suite at 25 cm. FloatingIslands passed at
|
||||
25 cm with stable W1/W8/W16 hashes `4dcfb37585d7d986 / f14f76fbf065c6ed / 53035c45fd1a082e /
|
||||
23550100654a4ec3`; its island and span capsule contacts, content anchors, and carve/fill checks
|
||||
passed. These runs used the current BuildHost binaries. No density output changed, so paired
|
||||
near/far captures and a recipe bump were not required. No runtime CVar or behavior change was
|
||||
introduced; the cap-0 negative controls above were trace-read back.
|
||||
|
||||
Full BuildHost logs are under
|
||||
`Saved/BuildHost/HostProject/Plugins/VoxelForge/Saved/CoreWorldValidation/Logs/` with stems
|
||||
`CoreWorldValidation-core_off_voxel_12.5_applyboost_default_legacy_order_nearreserve_auto`,
|
||||
`CoreWorldValidation-owner_surface_applyboost_default_legacy_order_nearreserve_auto_worldassemblerhybridv1`,
|
||||
`CoreWorldValidation-owner_surface_applyboost_default_legacy_order_nearreserve_auto_worldassemblerhybridv2`,
|
||||
and `CoreWorldValidation-floating_islands_applyboost_default_legacy_order_nearreserve_auto`.
|
||||
|
||||
Current binary SHA-256:
|
||||
|
||||
| Binary | SHA-256 |
|
||||
|---|---|
|
||||
| BuildHost `UnrealEditor-VoxelForge.dll` | `811F83D43EDE47EE870DD608F25C9F902422E1B264901917726CDBECE0EC0A37` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeCore.dll` | `AA74A8BC8E1C9C59FB7EA94D5A6BA71341EF8208EDE2458A7B5FAC0045FF2520` |
|
||||
| BuildHost `UnrealEditor-VoxelForgeEditor.dll` | `A851836ED435E8795AF860EBFB49AD84B603FF0D94600637D9B8CE52E0710EE3` |
|
||||
| Standalone `VoxelForgeCoreStandalone.exe` | `704F433791AF0D483D082CCBB2043DB4194323F40A986DA72F338FC424BF82F3` |
|
||||
|
||||
Round 17 changed these existing source files; no new source file was added:
|
||||
|
||||
| File | Likely compile spot |
|
||||
|---|---|
|
||||
| `Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h`, `Standalone/Core/src/VoxelForgeCore.cpp`, `Standalone/Core/src/WorldAssemblerInternal.h` | BuildHost VoxelForgeCore and Standalone Core |
|
||||
| `Source/VoxelForgeEditor/Private/VoxelForgeExploreCommandlet.cpp` | BuildHost VoxelForgeEditor commandlet |
|
||||
| `Standalone/Source/StreamingWorld.h`, `Standalone/Source/StandaloneViewer.cpp` | Standalone viewer executable |
|
||||
|
||||
Async-safety review: no actor queues or worker mutation code changed. `Epoch`, MPSC queue modes,
|
||||
`EndPlay` draining, worker `bShuttingDown` checks, `ModsLock`, and shared region-page lifetime are
|
||||
unchanged. Coordinate capture is opt-in thread-local diagnostic data copied into each tile result;
|
||||
UObject and RMC mutation remains on the game thread. RealtimeMeshComponent was read-only. No
|
||||
`.uproject`, owner editor, `.uasset`, generated header, `Binaries/`, or `Intermediate/` source was
|
||||
edited. Files over 300 KB are under `Saved/BuildHost/`. No `0xC0000142` occurred and no new
|
||||
`UECC-*` crash folder appeared.
|
||||
|
||||
The first BuildHost compile failed because two probe lambdas omitted the configured tile-size
|
||||
capture; that was fixed and the next build passed. The Standalone build passed with the existing
|
||||
`vswhere.exe` lookup warning and `VoxelStrateManager.cpp` C4838 warnings. A final source check and
|
||||
both current targets passed. No commit, push, or stash.
|
||||
|
||||
### Dialogue
|
||||
|
||||
**User:** Shouldn't a tile be way cheaper? Measure the stages and explain LOD4 before choosing a fix.
|
||||
|
||||
**Codex:** The largest measured cost is XY column evaluation, and LOD4 has a sharp spike in cache
|
||||
misses plus its first fine cap pass. Two-step interpolation reduced measured column-compute time by
|
||||
roughly 72%, but moved far ground by tens of meters; global octave dropping also fails badly.
|
||||
Cross-worker column
|
||||
reuse is a strong candidate for a future measured page-cache experiment, so Round 17 keeps output
|
||||
unchanged and records the floor instead of shipping an unproven approximation.
|
||||
@@ -0,0 +1,175 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Label,
|
||||
[Parameter(Mandatory = $true)][string[]]$ViewerArguments,
|
||||
[ValidateSet('Spawn', 'Flight')][string]$CaptureMode = 'Spawn',
|
||||
[switch]$WaitForFlightDrain
|
||||
)
|
||||
|
||||
# Capture through the viewer's D3D back buffer; no desktop or window capture is used.
|
||||
# Capturer le tampon D3D du viewer; aucune capture du bureau ou de la fenetre n'est utilisee.
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
$PluginRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../../../..'))
|
||||
$ViewerExe = Join-Path $PluginRoot 'Standalone/bin/VoxelForgeCoreStandalone.exe'
|
||||
$CaptureRoot = Join-Path $PSScriptRoot 'captures'
|
||||
$LogRoot = Join-Path $PSScriptRoot 'viewer_logs'
|
||||
[IO.Directory]::CreateDirectory($CaptureRoot) | Out-Null
|
||||
[IO.Directory]::CreateDirectory($LogRoot) | Out-Null
|
||||
|
||||
if (-not ('VoxelForgeR9MemoryProbe' -as [type])) {
|
||||
Add-Type -TypeDefinition @'
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
public static class VoxelForgeR9MemoryProbe {
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
private struct MEMORYSTATUSEX {
|
||||
public uint dwLength, dwMemoryLoad;
|
||||
public ulong ullTotalPhys, ullAvailPhys, ullTotalPageFile, ullAvailPageFile;
|
||||
public ulong ullTotalVirtual, ullAvailVirtual, ullAvailExtendedVirtual;
|
||||
}
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX status);
|
||||
public static ulong AvailablePhysicalBytes() {
|
||||
var status = new MEMORYSTATUSEX();
|
||||
status.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX));
|
||||
if (!GlobalMemoryStatusEx(ref status)) throw new InvalidOperationException("GlobalMemoryStatusEx failed.");
|
||||
return status.ullAvailPhys;
|
||||
}
|
||||
}
|
||||
'@
|
||||
}
|
||||
|
||||
if ([VoxelForgeR9MemoryProbe]::AvailablePhysicalBytes() -lt 4GB) {
|
||||
throw 'Viewer launch skipped: less than 4 GiB of free physical memory.'
|
||||
}
|
||||
if (Get-Process UnrealEditor* -ErrorAction SilentlyContinue) {
|
||||
throw 'Viewer launch skipped: an UnrealEditor process is still running.'
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $ViewerExe -PathType Leaf)) {
|
||||
throw "Standalone viewer is missing: $ViewerExe"
|
||||
}
|
||||
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
$SafeLabel = $Label -replace '[^A-Za-z0-9_-]', '_'
|
||||
$SequenceSuffix = if ($CaptureMode -eq 'Spawn') { 'spawn' } else { 'mid_sprint' }
|
||||
$CapturePrefix = Join-Path $CaptureRoot "${SafeLabel}_${SequenceSuffix}"
|
||||
$RunArguments = [Collections.Generic.List[string]]::new()
|
||||
foreach ($Argument in $ViewerArguments) { $RunArguments.Add($Argument) }
|
||||
if ($CaptureMode -eq 'Spawn') {
|
||||
$RunArguments.Add("--capture-spawn-sequence-prefix=$CapturePrefix")
|
||||
$RunArguments.Add('--quit-after-spawn-captures')
|
||||
$ExpectedIndices = @(0, 1, 2)
|
||||
$TimeLimitSeconds = 60
|
||||
} else {
|
||||
$RunArguments.Add("--capture-flight-sequence-prefix=$CapturePrefix")
|
||||
if (-not $WaitForFlightDrain) { $RunArguments.Add('--flight-capture-close-index=1') }
|
||||
$ExpectedIndices = @(1)
|
||||
$TimeLimitSeconds = if ($WaitForFlightDrain) { 900 } else { 45 }
|
||||
}
|
||||
$StdoutPath = Join-Path $LogRoot "$SafeLabel`_$SequenceSuffix.stdout.log"
|
||||
$StderrPath = Join-Path $LogRoot "$SafeLabel`_$SequenceSuffix.stderr.log"
|
||||
$QuotedArguments = @($RunArguments | ForEach-Object { '"' + $_.Replace('"', '\"') + '"' })
|
||||
$ArgumentLine = $QuotedArguments -join ' '
|
||||
$Process = Start-Process -FilePath $ViewerExe -ArgumentList $ArgumentLine `
|
||||
-WorkingDirectory (Split-Path -Parent $ViewerExe) -PassThru -WindowStyle Normal `
|
||||
-RedirectStandardOutput $StdoutPath -RedirectStandardError $StderrPath
|
||||
$Started = [Diagnostics.Stopwatch]::StartNew()
|
||||
try {
|
||||
$Process.PriorityClass = [Diagnostics.ProcessPriorityClass]::Normal
|
||||
$Process.ProcessorAffinity = [IntPtr]0xFFF
|
||||
while ($true) {
|
||||
$Process.Refresh()
|
||||
if ($Process.HasExited) { break }
|
||||
if ($Process.PrivateMemorySize64 -gt 8GB) {
|
||||
throw "Owned viewer PID $($Process.Id) exceeded the 8 GiB private-memory limit."
|
||||
}
|
||||
if ($Started.Elapsed.TotalSeconds -gt $TimeLimitSeconds) {
|
||||
throw "Owned viewer PID $($Process.Id) exceeded the $TimeLimitSeconds-second capture limit."
|
||||
}
|
||||
Start-Sleep -Milliseconds 200
|
||||
}
|
||||
$Process.WaitForExit()
|
||||
$Process.Refresh()
|
||||
if ($Process.ExitCode -ne 0) {
|
||||
throw "Owned viewer PID $($Process.Id) exited with code $($Process.ExitCode)."
|
||||
}
|
||||
} catch {
|
||||
$Process.Refresh()
|
||||
if (-not $Process.HasExited) {
|
||||
[void]$Process.CloseMainWindow()
|
||||
if (-not $Process.WaitForExit(3000)) {
|
||||
Stop-Process -Id $Process.Id -Force -ErrorAction SilentlyContinue
|
||||
$Process.WaitForExit()
|
||||
}
|
||||
}
|
||||
throw
|
||||
}
|
||||
|
||||
function Save-DownscaledJpeg([string]$Source, [string]$Destination, [long]$Quality) {
|
||||
$Original = [Drawing.Image]::FromFile($Source)
|
||||
try {
|
||||
$Width = [Math]::Min(960, $Original.Width)
|
||||
$Height = [int][Math]::Round($Original.Height * $Width / $Original.Width)
|
||||
$Small = New-Object Drawing.Bitmap($Width, $Height)
|
||||
$Graphics = [Drawing.Graphics]::FromImage($Small)
|
||||
try {
|
||||
$Graphics.InterpolationMode = [Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
|
||||
$Graphics.PixelOffsetMode = [Drawing.Drawing2D.PixelOffsetMode]::HighQuality
|
||||
$Graphics.DrawImage($Original, 0, 0, $Width, $Height)
|
||||
$Codec = [Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() |
|
||||
Where-Object { $_.MimeType -eq 'image/jpeg' } | Select-Object -First 1
|
||||
$Parameters = New-Object Drawing.Imaging.EncoderParameters(1)
|
||||
try {
|
||||
$Parameters.Param[0] = New-Object Drawing.Imaging.EncoderParameter(
|
||||
[Drawing.Imaging.Encoder]::Quality, $Quality)
|
||||
$Small.Save($Destination, $Codec, $Parameters)
|
||||
} finally {
|
||||
$Parameters.Dispose()
|
||||
}
|
||||
} finally {
|
||||
$Graphics.Dispose()
|
||||
$Small.Dispose()
|
||||
}
|
||||
} finally {
|
||||
$Original.Dispose()
|
||||
}
|
||||
}
|
||||
|
||||
$ViewerLog = Get-Content -LiteralPath $StdoutPath -Raw
|
||||
foreach ($Index in $ExpectedIndices) {
|
||||
$PngPath = '{0}_{1:D2}.png' -f $CapturePrefix, $Index
|
||||
if (-not (Test-Path -LiteralPath $PngPath -PathType Leaf)) {
|
||||
throw "Viewer exited normally but did not write required back-buffer capture index $Index."
|
||||
}
|
||||
if ($CaptureMode -eq 'Spawn') {
|
||||
$CaptureTime = @('0.5s', '1.0s', '2.0s')[$Index]
|
||||
$JpegPath = Join-Path $CaptureRoot "${SafeLabel}_spawn_$CaptureTime.jpg"
|
||||
} else {
|
||||
$JpegPath = Join-Path $CaptureRoot "${SafeLabel}_mid_sprint.jpg"
|
||||
}
|
||||
Save-DownscaledJpeg $PngPath $JpegPath 72
|
||||
if ((Get-Item -LiteralPath $JpegPath).Length -ge 300KB) {
|
||||
Save-DownscaledJpeg $PngPath $JpegPath 48
|
||||
}
|
||||
$Jpeg = Get-Item -LiteralPath $JpegPath
|
||||
if ($Jpeg.Length -ge 300KB) { throw "Downscaled capture exceeds 300 KB: $($Jpeg.Name)" }
|
||||
Remove-Item -LiteralPath $PngPath -Force
|
||||
$Timing = [regex]::Match($ViewerLog, "\[(Spawn|Flight)SequenceCapture\] index=$Index elapsed_s=([0-9.]+)")
|
||||
$Elapsed = if ($Timing.Success) { $Timing.Groups[2].Value } else { 'missing' }
|
||||
Write-Host ('capture={0} elapsed_s={1} size={2} bytes' -f $Jpeg.Name, $Elapsed, $Jpeg.Length)
|
||||
}
|
||||
if ($CaptureMode -eq 'Flight') {
|
||||
# Keep only the reviewed mid-flight JPG; remove this run's unused raw D3D frames.
|
||||
# Garder uniquement le JPG de vol examine ; supprimer les tampons D3D bruts inutilises de ce run.
|
||||
foreach ($Index in 0..4) {
|
||||
$PngPath = '{0}_{1:D2}.png' -f $CapturePrefix, $Index
|
||||
if (Test-Path -LiteralPath $PngPath -PathType Leaf) {
|
||||
Remove-Item -LiteralPath $PngPath -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Host ('viewer_closed=1 pid={0} exit_code={1} elapsed_s={2:0.000} priority=Normal affinity=0xFFF' -f
|
||||
$Process.Id, $Process.ExitCode, $Started.Elapsed.TotalSeconds)
|
||||
@@ -0,0 +1,147 @@
|
||||
# World Assembler S5 / M3 Round 9 — measured result
|
||||
|
||||
**Status:** Standalone and BuildHost compile. Regression checks pass. The S5 scheduler is retained as an opt-in experiment; legacy order is the default again. S5 did not demonstrate an enclosure or walkability win, and the viewer could not confirm what was presented to the screen. The 60 m/s result also had invalid center deltas.
|
||||
|
||||
## Count, binaries and timing protocol
|
||||
|
||||
The owner clipmap is 2,553 tiles: 960 LOD0/1 and 1,593 coarse tiles. The final Standalone executable is Standalone/bin/VoxelForgeCoreStandalone.exe.
|
||||
|
||||
The matched CPU protocol used a fresh process, the staged owner_world.json, 12 workers, normal priority, affinity 0xFFF, radius 3, max LOD 8, camera 0,-35,-487.94,0,-22, world-assembler-prototype, force-generate, stream-benchmark and stream-hash. Same mode and settings for before/after:
|
||||
|
||||
| Run | 2,553 tiles | Hashes |
|
||||
|---|---:|---|
|
||||
| Legacy order | 3.641 s | Same as candidate |
|
||||
| Coarse-first | 3.620 s | Same as legacy |
|
||||
| Final coarse-first repeat | 3.579 s | Same as legacy |
|
||||
| Final rebuilt default (legacy) smoke | 3.592 s | Same as legacy |
|
||||
|
||||
This is a 0.6–1.7% difference, within run noise. The 27-tile CPU mesh-ready measurement was 55 ms legacy / 22 ms coarse-first; Standalone has no collision cooking, so this is not a walkability result.
|
||||
|
||||
Round 7/8 report 2.975/3.107 s. The saved reproduction log, s4_protocol_reproduce_ffff.stdout.log, reproduces the 3.1 s result at 3.146 s with the prototype route, 2,553 tiles, 12 workers, hash on, normal priority and affinity 0xFFFF. The Round 7/8 reports did not preserve the exact executable hash or full launch command, so the historical binary identity cannot be established. Their Round 8 p95 run also inherited 0xFFFF, while the main S5 before/after protocol pins 0xFFF.
|
||||
|
||||
The reported 16.685 s run has no raw command log. A later run without the prototype route took 18.668 s, produced a different density hash, and emitted no LOD8 cap triangles; the correct prototype route produces density hash c10697a8f48380c7 and the 385-tile cap. This makes a different generation route the likely cause of the 16.685 s result, but the missing original log prevents proving its exact flags. It was not a matched comparison based on tile count alone. CPU-idle state was not controlled.
|
||||
|
||||
## Capture and cap instruments
|
||||
|
||||
The old black sequence logged three Presents with zero tile geometry and zero draw batches before its screenshots. That points to clear-only startup frames, not a capture-before-first-present race. Its logger did not tie each image to a frame index, so the exact capture frame cannot be proven. The matched S5 captures record frame index, prior presents, resident meshes, draw batches and triangle counts at capture:
|
||||
|
||||
| Sample | Legacy frame / tiles / batches / triangles | Coarse-first frame / tiles / batches / triangles |
|
||||
|---|---|---|
|
||||
| Spawn 0.5 s | 4 / 451 / 6 / 151,020 | 5 / 76 / 4 / 834,954 |
|
||||
| Spawn 1.0 s | 13 / 1,801 / 41 / 446,090 | 12 / 133 / 4 / 1,804,858 |
|
||||
| Spawn 2.0 s | 25 / 2,308 / 70 / 904,353 | 27 / 559 / 44 / 3,240,081 |
|
||||
|
||||
The capture reads the D3D back buffer pre-present after earlier frames have presented. The candidate Presents returned DXGI_STATUS_OCCLUDED even though the window was visible, so the images prove rendered back-buffer geometry but cannot establish player-visible pixels. The coarse-first images are visibly much sparser at spawn; treat that as a possible early visual regression, not a confirmed screen result.
|
||||
|
||||
Matched JPEGs are 9.7–21.8 KB, all below 300 KB. The viewer was capped at 60 fps with VSync and closed after capture. Coarse-first is now opt-in with --coarse-first-stream-order; legacy is the default:
|
||||
|
||||
| Capture | Legacy | Coarse-first |
|
||||
|---|---|---|
|
||||
| Spawn 0.5 s | [JPG](captures/s5_before_legacy_spawn_0.5s.jpg) | [JPG](captures/s5_after_coarse_spawn_0.5s.jpg) |
|
||||
| Spawn 1.0 s | [JPG](captures/s5_before_legacy_spawn_1.0s.jpg) | [JPG](captures/s5_after_coarse_spawn_1.0s.jpg) |
|
||||
| Spawn 2.0 s | [JPG](captures/s5_before_legacy_spawn_2.0s.jpg) | [JPG](captures/s5_after_coarse_spawn_2.0s.jpg) |
|
||||
| 10 m/s mid-sprint | [JPG](captures/s5_before_legacy_10ms_mid_sprint.jpg) | [JPG](captures/s5_after_coarse_10ms_mid_sprint.jpg) |
|
||||
| 60 m/s mid-sprint | [JPG](captures/s5_before_legacy_mid_sprint.jpg) | [JPG](captures/s5_after_coarse_mid_sprint.jpg) |
|
||||
|
||||
The S4 low-angle ray audit used the same owner camera at voxel origin (0,-140,-1951.8): all 72 upward rays at that view hit the roof, and all 2,520/2,520 audit rays hit. The dark “sky” region is the cap underside, not uncovered sky. S4 reports 385 refined LOD8 cap tiles; the final band census requested 413 cap bands, emitted 411, and classified the remaining two as zero-area boundary touches, with no unexplained empty bands. Far/near agreement was 0.0504 cm against a 2 cm tolerance.
|
||||
|
||||
## Gates and sprint results
|
||||
|
||||
The BuildHost actor trace reports collision readiness for the support tile and required 3×3 ring. Both orderings reached 9/9 ready at cold spawn:
|
||||
|
||||
| Gate interval | Legacy | Coarse-first |
|
||||
|---|---:|---:|
|
||||
| Cold spawn | 0.583→0.624 s (41.2 ms) | 0.577→0.618 s (41.6 ms) |
|
||||
| Teleport to center (-5,0,-26) | 6.427→6.642 s (215 ms) | 6.389→6.598 s (208 ms) |
|
||||
| Teleport to center (-2,8,-47) | 15.066→15.349 s (283 ms) | 14.943→15.504 s (561 ms) |
|
||||
|
||||
The actor test teleported between centers and logged speed 0; it is not a 10/60 m/s actor walk. Two separate enforced-collision-gate runs, one per order, reached the 900 s limit while support requests kept recentering. Thus the readiness counter passed at cold spawn, but physical gate enforcement during movement remains unverified.
|
||||
|
||||
Standalone cannot measure collision readiness. Its logged full LOD0/1 set completed at 0.889 s in the legacy spawn run. Coarse-first had not completed that set by the 2.053 s capture; its 10 m/s run logged completion at 3.450 s. The 1.57 s refinement target therefore failed for coarse-first in this viewer workload.
|
||||
|
||||
BuildHost full-set residency samples were spaced about 250 ms apart. These are per-LOD total residency times from trace start, not per-tile time-in-range:
|
||||
|
||||
| LOD | Legacy seconds | Coarse-first seconds |
|
||||
|---:|---:|---:|
|
||||
| 8 | 3.352 | 3.338 |
|
||||
| 7 | 3.603 | 3.589 |
|
||||
| 6 | 3.854 | 3.841 |
|
||||
| 5 | 4.105 | 4.092 |
|
||||
| 4 | 4.858 | 4.847 |
|
||||
| 3 | 5.108 | 5.099 |
|
||||
| 2 | 5.360 | 5.351 |
|
||||
| 0 | 5.865 | 5.853 |
|
||||
| 1 | 6.367 | 6.354 |
|
||||
|
||||
The largest difference is 13 ms, below the sample interval. The full desired LOD sets arrive after the 1.57 s goal in both orders. Enclosure gap frames/time were not measured: DXGI reported occlusion, and no reliable screen-visible gap counter exists. The static S4 ray audit proves roof coverage after generation, not startup or moving enclosure.
|
||||
|
||||
The S5 full-view tile p95 probe used the same 12 workers, normal priority, inherited affinity 0xFFFF, 60 fps/VSync and no timeline trace for both orderings. Each viewer was closed immediately after InitialClipmapReady:
|
||||
|
||||
| LOD | Legacy p95 ms | Coarse-first p95 ms |
|
||||
|---:|---:|---:|
|
||||
| 0 | 16.398 | 17.456 |
|
||||
| 1 | 15.665 | 15.804 |
|
||||
| 2 | 4.393 | 4.292 |
|
||||
| 3 | 17.263 | 18.055 |
|
||||
| 4 | 59.038 | 58.867 |
|
||||
| 5 | 17.649 | 17.915 |
|
||||
| 6 | 51.086 | 57.610 |
|
||||
| 7 | 29.419 | 32.116 |
|
||||
| 8 | 82.782 | 85.041 |
|
||||
|
||||
The coarse-first full view took 3.309 s versus 3.187 s legacy. LOD6/7 p95 rose 12.8%/9.2% in this one pair; the result cannot establish “within noise.” S4’s p95 check was a separate eight-key staged test (LOD7 19.801/19.807 ms, LOD8 58.346/58.411 ms for S3/S4) and was not replayed on those exact keys in S5. Do not claim an apples-to-apples S3/S4 p95 pass.
|
||||
|
||||
Standalone sprint benchmark results:
|
||||
|
||||
| Speed | Order | Requests incl. 2,553 spawn | Queued cancellations | Discarded stale results | Nearest-ready p95 / max | Max lag p95 / max | Status |
|
||||
|---:|---|---:|---:|---:|---|---|---|
|
||||
| 10 m/s | Legacy | 33,730 | 3 | 10 | 126.628 / 171.452 ms | 1.27 / 1.71 m | FAIL |
|
||||
| 10 m/s | Coarse-first | 33,730 | 0 | 0 | 129.812 / 148.705 ms | 1.30 / 1.49 m | FAIL |
|
||||
| 60 m/s | Legacy | 39,632 | 29,809 | 138 | 93.101 / 114.475 ms | 5.59 / 6.87 m | FAIL, invalid deltas |
|
||||
| 60 m/s | Coarse-first | 38,679 | 22,662 | 120 | 68.748 / 182.143 ms | 4.12 / 10.93 m | FAIL, invalid deltas |
|
||||
|
||||
The 10 m/s route had valid unit-+Y center deltas: coarse-first slightly worsened p95 lag but improved worst lag. At 60 m/s the center deltas were invalid, so the apparent p95/crossing-wall improvement is not a valid matched gate win; its worst nearest-ready lag was worse by 67.7 ms. Request/cancellation counts cover the initial cold request set and crossings 1–250; stale discards include initial work and crossings 1–250.
|
||||
|
||||
The actor trace’s UpdateChunks sample is not an isolated scheduler timer. Legacy mean/p95/max was 0.549/0.683/5.480 ms; optimized coarse-first was 0.116/0.269/4.860 ms. The pre-optimization candidate had 79.073 and 35.510 ms spikes from sorting each level repeatedly while at capacity. The final candidate skips full queues and only sorts missing, nonpending tiles. No blocking wait was added to Tick.
|
||||
|
||||
## Determinism, regression checks and async safety
|
||||
|
||||
Standalone final 2,553-tile hashes match S4: density c10697a8f48380c7, mesh 430d2be2bdd8b988, payload b7b33e14092225c9, topology c5c46d66606a819e. LOD0–3 hashes also match S4 exactly:
|
||||
|
||||
| LOD | Density | Mesh | Payload | Topology |
|
||||
|---:|---|---|---|---|
|
||||
| 0 | 769f2a706d585a72 | 33eeeb39fa443816 | 645621a1d968983f | c2457ed905036c9d |
|
||||
| 1 | 69cc5a5c0a2c60af | b48335f5410c57d5 | d15c5480162ab8ba | feca1bd025823604 |
|
||||
| 2 | 85deed5683a77202 | 53469895987aeea2 | e55f8ae7e1532033 | d5feb12a0e85c09b |
|
||||
| 3 | 6518caefb3be7e7f | ec513c90b853a614 | f62fa1137ff17f82 | ccf1dcf681965816 |
|
||||
|
||||
BuildHost SurfaceWorld at 25 cm passed W1/W8/W16 with density 0cd2a1a4152ee4aa, mesh 80a5b054b904b1a2, payload bf2f1b40dff38acc, topology 56074198682d5e18. FloatingIslands at 25 cm passed W1/W8/W16, collision, edits and switch-off. Core-off legacy passed at 12.5 cm; M2 V1 and V2 each passed five focused fixtures plus border. S4 roof coverage/agreement and S3 ground agreement passed; final ground delta was 0.000 cm and final far-horizon agreement max was 0.0427 cm.
|
||||
|
||||
Async safety audit: all four result queues remain EQueueMode::Mpsc; EndPlay sets bShuttingDown, waits ActiveTaskCount to zero, then drains queues. Generation workers check shutdown state. Both LoadTile and LoadCoreTile carry GenerationEpoch in the result and reject stale results; ModsLock behavior is unchanged. No async path or generated header was removed or rewritten.
|
||||
|
||||
## Builds, run ledger and changed files
|
||||
|
||||
Final Standalone Build.ps1 -Target All and BuildVoxelForgeCoreHost.ps1 builds passed. BuildHost link safety checked 96,244 dumpbin lines against 421 copied type names, verified five staged asset hashes, and linked/audited 18 Core shims. Recent launches had over 17 GiB free RAM; recorded runtime peaks stayed below 4 GiB. No run returned 0xC0000142. No new UECC-* folder appeared; the only crash folder is dated 2026-09-17.
|
||||
|
||||
Failed, retried or capped attempts:
|
||||
- The first baseline used the default camera and generated 2,226 tiles in 6.521 s; the owner-camera run restored 2,553.
|
||||
- One standalone hash launch omitted stream-benchmark and entered the viewer; it was stopped after 146 s and rerun correctly. A later clip-radius 6 request hit the standalone safety bound.
|
||||
- A generic horizon test targeted invalid /Game/Untitled and failed; it was not an owner-world result. Initial headless/GDI captures did not read the D3D frame; the viewer back-buffer path replaced them.
|
||||
- Get-CimInstance memory preflight was denied; subsequent checks used GlobalMemoryStatusEx. A fresh-shell helper/preflight attempt failed before process launch and was corrected. Two tile-profile command strings also had PowerShell parse errors before launch; the corrected pairs produced complete metrics.
|
||||
- Both enforced-collision-gate actor runs timed out at 900 s while support requests recentered. All four tile-profile viewers reached InitialClipmapReady, were closed deliberately, and returned exit -1 on WM_CLOSE; their timing output was complete.
|
||||
|
||||
**Habits:** Counted 2,553 tiles and checked the executable/mode; evaluated the staged owner plan and walk; used fresh matched before/after settings; explained the Round 7/8 timing discrepancy and affinity difference; kept the result report bounded to measured outcomes.
|
||||
|
||||
## Source files and compile spots
|
||||
|
||||
No new C++ source file was added. Modified C++:
|
||||
- Source/VoxelForge/Private/VoxelWorld.cpp and Source/VoxelForge/Public/VoxelWorld.h — VoxelForge runtime module; BuildHost UBT.
|
||||
- Source/VoxelForge/Private/VoxelStartupTrace.cpp and Source/VoxelForge/Public/VoxelStartupTrace.h — VoxelForge runtime module; BuildHost UBT.
|
||||
- Standalone/Source/StandaloneViewer.cpp and Standalone/Source/StreamingWorld.h — Standalone/Build.ps1 -Target All.
|
||||
|
||||
Modified supporting scripts/docs: Standalone/Build.ps1, Tools/VoxelForgeTest.ps1, Tools/TestVoxelForgeCoreWorldHost.ps1, Standalone/Research/WorldAssemblerM3/Round9/CaptureViewerSequence.ps1, CODEMAP.md §3, ARCHITECTURE.md §8.26. The capture helper is the only new helper source.
|
||||
|
||||
### Dialogue
|
||||
|
||||
**User:** Check the instrument before judging the scheduler.
|
||||
**Luna:** The 3.1 s prototype result reproduced; the matched gates did not justify a default-on order, so coarse-first remains opt-in.
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -1635,6 +1635,9 @@ namespace
|
||||
uint64 GpuFarProtectedThinSamples=0,GpuFarProtectedSolidSamples=0;
|
||||
uint64 GpuFarProtectedSealSamples=0,GpuFarProtectedOverlaySamples=0;
|
||||
uint64 PresentCallCount=0;
|
||||
uint64 LastCapturedFrameOrdinal=0,LastCapturedPresentOrdinal=0;
|
||||
int32 LastCapturedSequenceIndex=-1;
|
||||
bool bLastCapturedSequenceIsFlight=false;
|
||||
uint64 StartupNonBlockingPresentCalls=0,StartupNonBlockingPresentSkips=0;
|
||||
double GpuFarGpuDispatchMs=0.0;
|
||||
double GpuFarGpuDispatchMaxMs=0.0;
|
||||
@@ -1688,10 +1691,16 @@ namespace
|
||||
bool bDensityHash=false;
|
||||
int32 FlightTargetCrossings=0;
|
||||
int32 FlightObservedCrossings=0;
|
||||
int32 FlightCenterUpdates=0;
|
||||
int32 FlightMaximumForwardDelta=0;
|
||||
uint64 FlightStartCrossingIndex=0;
|
||||
float FlightSpeedMps=16.0f;
|
||||
std::string FlightCaptureSequencePrefix;
|
||||
int32 FlightCaptureSequenceIndex=0;
|
||||
int32 FlightCaptureCloseIndex=-1;
|
||||
std::string SpawnCaptureSequencePrefix;
|
||||
int32 SpawnCaptureSequenceIndex=0;
|
||||
bool bQuitAfterSpawnCaptures=false,bSpawnCaptureClosePosted=false;
|
||||
bool bFlightStarted=false;
|
||||
bool bFlightFinished=false;
|
||||
bool bFlightClosePosted=false;
|
||||
@@ -1711,6 +1720,7 @@ namespace
|
||||
bool Keys[256]{};
|
||||
int32 Seed=0;
|
||||
int32 WorkerCount=8;
|
||||
int32 FarHorizonLOD8InteriorStepVoxels=0;
|
||||
int32 ClipRadius=3;
|
||||
int32 MaxClipLevelOverride=-1;
|
||||
int32 CaptureTileLimit=0;
|
||||
@@ -2894,7 +2904,8 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
Streamer=std::make_unique<FStandaloneStreamingGenerator>(*World,StreamWorkers,false,
|
||||
(!bShapeWorld&&MeshCache.IsLoaded())?&MeshCache:nullptr,
|
||||
bFarShapeStagePending?World->FullResClipLevels-1:-1,
|
||||
false,false,false,false,ShapeWorld.get());
|
||||
false,false,false,false,ShapeWorld.get(),false,
|
||||
FarHorizonLOD8InteriorStepVoxels);
|
||||
if(bGpuFarTimelineEnabled)
|
||||
Streamer->EnableColdTimelineTrace(ColdProcessStart,&ColdTimelineFrameOrdinal);
|
||||
if(bGpuFarEnabled&&ShapeWorld&&ShapeWorld->hasFarWorld())
|
||||
@@ -4883,9 +4894,15 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
NewDesired.CenterChunk.Y-Previous.Y,NewDesired.CenterChunk.Z-Previous.Z);
|
||||
if(FlightTargetCrossings>0&&bFlightStarted&&!bFlightFinished)
|
||||
{
|
||||
++FlightObservedCrossings;
|
||||
if(CenterDelta.X!=0||CenterDelta.Y!=1||CenterDelta.Z!=0)
|
||||
++FlightCenterUpdates;
|
||||
if(CenterDelta.X!=0||CenterDelta.Y<=0||CenterDelta.Z!=0)
|
||||
bFlightCrossingsValid=false;
|
||||
else
|
||||
{
|
||||
FlightObservedCrossings+=CenterDelta.Y;
|
||||
FlightMaximumForwardDelta=std::max(
|
||||
FlightMaximumForwardDelta,CenterDelta.Y);
|
||||
}
|
||||
}
|
||||
std::unordered_set<FVoxelTileKey,FStandaloneTileKeyHash> NewSet;
|
||||
NewSet.reserve(NewDesired.Tiles.size()*2+1);
|
||||
@@ -5346,13 +5363,14 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
const double NearestMaximum=NearestReadyMilliseconds.empty()?-1.0:
|
||||
NearestReadyMilliseconds.back();
|
||||
const std::size_t MissingDesired=DesiredTiles.size()-DesiredResidentCount;
|
||||
const bool bPass=FlightObservedCrossings==FlightTargetCrossings
|
||||
const bool bPass=FlightObservedCrossings>=FlightTargetCrossings
|
||||
&&bFlightCrossingsValid&&CacheHits==0&&bCrossingLatencyUnderTarget
|
||||
&&MissingDesired==0&&DeferredLeaverTiles.empty()&&DirtyBatchSet.empty();
|
||||
std::printf("[FlightBenchmarkComplete] crossings=%d/%d speed=%.2fm/s elapsed=%.3fs cache_hits=%llu crossing_deltas=%s nearest_ready_p50=%.3fms nearest_ready_p95=%.3fms nearest_ready_max=%.3fms max_crossing_wall=%.3fs max_worker_cpu_sum=%.3fs resident=%zu/%zu missing_tiles=%zu deferred_leavers=%zu uploads_drained=%s status=%s\n",
|
||||
FlightObservedCrossings,FlightTargetCrossings,FlightSpeedMps,Elapsed,
|
||||
std::printf("[FlightBenchmarkComplete] center_chunks=%d/%d center_updates=%d max_forward_delta_y=%d speed=%.2fm/s elapsed=%.3fs cache_hits=%llu crossing_deltas=%s nearest_ready_p50=%.3fms nearest_ready_p95=%.3fms nearest_ready_max=%.3fms max_crossing_wall=%.3fs max_worker_cpu_sum=%.3fs resident=%zu/%zu missing_tiles=%zu deferred_leavers=%zu uploads_drained=%s status=%s\n",
|
||||
FlightObservedCrossings,FlightTargetCrossings,
|
||||
FlightCenterUpdates,FlightMaximumForwardDelta,FlightSpeedMps,Elapsed,
|
||||
static_cast<unsigned long long>(CacheHits),
|
||||
bFlightCrossingsValid?"unit-+Y":"invalid",
|
||||
bFlightCrossingsValid?"forward-+Y":"invalid",
|
||||
Percentile(50),Percentile(95),NearestMaximum,MaxCrossingWallSeconds,
|
||||
MaxWorkerCpuSeconds,DesiredResidentCount,DesiredTiles.size(),MissingDesired,
|
||||
DeferredLeaverTiles.size(),DirtyBatchSet.empty()?"yes":"no",
|
||||
@@ -5509,6 +5527,71 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
|
||||
void CaptureRenderedFrame()
|
||||
{
|
||||
auto LogCaptureFrameAudit=[&](const char* Mode,int32 Index,double ElapsedSeconds)
|
||||
{
|
||||
std::size_t ReadyTiles=0;
|
||||
for(const FVoxelTileKey& Key:DesiredTiles)
|
||||
if(IsRenderedTileReady(Key))++ReadyTiles;
|
||||
uint64 DrawIndices=0;
|
||||
uint64 DrawBatches=0;
|
||||
for(const auto& Pair:StreamingBatches)
|
||||
{
|
||||
const FStreamingGpuBatch& Batch=Pair.second;
|
||||
if(!bShowLevel[Pair.first.Level]
|
||||
||(CaptureOnlyLod>=0&&Pair.first.Level!=CaptureOnlyLod)
|
||||
||!Batch.VertexBuffer||!Batch.IndexBuffer||!Batch.IndexCount
|
||||
||(bDrawOnlyTile&&Batch.DrawOnlyIndexCount==0))continue;
|
||||
DrawIndices+=bDrawOnlyTile?Batch.DrawOnlyIndexCount:Batch.IndexCount;
|
||||
++DrawBatches;
|
||||
}
|
||||
std::printf("[CaptureFrameAudit] mode=%s index=%d elapsed_s=%.3f capture_phase=pre_present frame=%llu presents_completed=%llu next_present=%llu resident_tiles=%zu/%zu resident_meshes=%zu draw_batches=%llu draw_triangles=%llu queued_upload_batches=%zu gpu_far_tiles=%zu\n",
|
||||
Mode,Index,ElapsedSeconds,
|
||||
static_cast<unsigned long long>(ColdTimelineFrame()),
|
||||
static_cast<unsigned long long>(PresentCallCount),
|
||||
static_cast<unsigned long long>(PresentCallCount+1),
|
||||
ReadyTiles,DesiredTiles.size(),ResidentTiles.size(),
|
||||
static_cast<unsigned long long>(DrawBatches),
|
||||
static_cast<unsigned long long>(DrawIndices/3),DirtyBatchSet.size(),GpuFarTiles.size());
|
||||
std::fflush(stdout);
|
||||
};
|
||||
|
||||
// Capturer apres le rendu, avant le present imminent du meme frame.
|
||||
// Capture after rendering, before this same frame's imminent present.
|
||||
if(!SpawnCaptureSequencePrefix.empty()&&SpawnCaptureSequenceIndex<3
|
||||
&&GenerationStart.time_since_epoch().count()!=0)
|
||||
{
|
||||
static constexpr std::array<double,3> CaptureSeconds={0.5,1.0,2.0};
|
||||
const double SpawnElapsed=std::chrono::duration<double>(
|
||||
std::chrono::steady_clock::now()-GenerationStart).count();
|
||||
if(SpawnElapsed>=CaptureSeconds[SpawnCaptureSequenceIndex])
|
||||
{
|
||||
LogCaptureFrameAudit("spawn",SpawnCaptureSequenceIndex,SpawnElapsed);
|
||||
char Suffix[16]{};
|
||||
std::snprintf(Suffix,sizeof(Suffix),"_%02d.png",SpawnCaptureSequenceIndex);
|
||||
const std::string Path=SpawnCaptureSequencePrefix+Suffix;
|
||||
if(SaveBackBufferPng(Path))
|
||||
{
|
||||
LastCapturedFrameOrdinal=ColdTimelineFrame();
|
||||
LastCapturedPresentOrdinal=PresentCallCount+1;
|
||||
LastCapturedSequenceIndex=SpawnCaptureSequenceIndex;
|
||||
bLastCapturedSequenceIsFlight=false;
|
||||
std::printf("[SpawnSequenceCapture] index=%d elapsed_s=%.3f path=%s\n",
|
||||
SpawnCaptureSequenceIndex,SpawnElapsed,Path.c_str());
|
||||
}
|
||||
else
|
||||
std::fprintf(stderr,"[SpawnSequenceCapture] index=%d elapsed_s=%.3f failed path=%s\n",
|
||||
SpawnCaptureSequenceIndex,SpawnElapsed,Path.c_str());
|
||||
++SpawnCaptureSequenceIndex;
|
||||
std::fflush(stdout);
|
||||
if(bQuitAfterSpawnCaptures&&SpawnCaptureSequenceIndex>=3
|
||||
&&!bSpawnCaptureClosePosted)
|
||||
{
|
||||
bSpawnCaptureClosePosted=true;
|
||||
PostMessageA(Window,WM_CLOSE,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Capturer le vol dans la boucle de rendu conserve les transitions LOD.
|
||||
// Capture the flight inside the render loop to retain LOD transition frames.
|
||||
if(!FlightCaptureSequencePrefix.empty()&&bFlightStarted)
|
||||
@@ -5519,17 +5602,30 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
if(FlightCaptureSequenceIndex<static_cast<int32>(CaptureSeconds.size())
|
||||
&&FlightElapsed>=CaptureSeconds[FlightCaptureSequenceIndex])
|
||||
{
|
||||
LogCaptureFrameAudit("flight",FlightCaptureSequenceIndex,FlightElapsed);
|
||||
char Suffix[16]{};
|
||||
std::snprintf(Suffix,sizeof(Suffix),"_%02d.png",FlightCaptureSequenceIndex);
|
||||
const std::string Path=FlightCaptureSequencePrefix+Suffix;
|
||||
const int32 CapturedIndex=FlightCaptureSequenceIndex;
|
||||
if(SaveBackBufferPng(Path))
|
||||
{
|
||||
LastCapturedFrameOrdinal=ColdTimelineFrame();
|
||||
LastCapturedPresentOrdinal=PresentCallCount+1;
|
||||
LastCapturedSequenceIndex=CapturedIndex;
|
||||
bLastCapturedSequenceIsFlight=true;
|
||||
std::printf("[FlightSequenceCapture] index=%d elapsed_s=%.3f path=%s\n",
|
||||
FlightCaptureSequenceIndex,FlightElapsed,Path.c_str());
|
||||
CapturedIndex,FlightElapsed,Path.c_str());
|
||||
}
|
||||
else
|
||||
std::fprintf(stderr,"[FlightSequenceCapture] index=%d failed path=%s\n",
|
||||
FlightCaptureSequenceIndex,Path.c_str());
|
||||
CapturedIndex,Path.c_str());
|
||||
++FlightCaptureSequenceIndex;
|
||||
std::fflush(stdout);
|
||||
if(FlightCaptureCloseIndex==CapturedIndex&&!bFlightClosePosted)
|
||||
{
|
||||
bFlightClosePosted=true;
|
||||
PostMessageA(Window,WM_CLOSE,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
const bool bReadyToCapture=bCaptureAfterClipmap?bInitialClipmapReported:IsFullDetailUploaded();
|
||||
@@ -5607,8 +5703,9 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
{
|
||||
bFlightStarted=true;FlightStartTime=Now;FlightStartPosition=Position;
|
||||
FlightStartCrossingIndex=CrossingIndex;FlightObservedCrossings=0;
|
||||
FlightCenterUpdates=0;FlightMaximumForwardDelta=0;
|
||||
bFlightCrossingsValid=true;
|
||||
std::printf("[FlightBenchmarkStart] crossings=%d speed=%.2fm/s direction=+Y start=(%.2f,%.2f,%.2f)m cache_mode=none\n",
|
||||
std::printf("[FlightBenchmarkStart] center_chunks=%d speed=%.2fm/s direction=+Y start=(%.2f,%.2f,%.2f)m cache_mode=none\n",
|
||||
FlightTargetCrossings,FlightSpeedMps,Position.X,Position.Y,Position.Z);
|
||||
std::fflush(stdout);
|
||||
}
|
||||
@@ -5816,7 +5913,6 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
bGpuSkirtDrawAuditReported=true;
|
||||
std::fflush(stdout);
|
||||
}
|
||||
CaptureRenderedFrame();
|
||||
const bool bHoldFrontBufferForGpuWarmup=bHoldCpuFrameDuringGpuWarmup
|
||||
&&bCpuReadyFramePresentedBeforeGpu&&bGpuFarEnabled
|
||||
&&GpuFarTilesSubmitted>0&&!bInitialClipmapReported;
|
||||
@@ -5864,6 +5960,8 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
std::chrono::duration<double,std::milli>(GpuPumpEnd-CpuPumpEnd).count());
|
||||
return;
|
||||
}
|
||||
const bool bDidPresent=!bGpuFarNoPresent||bDeferGpuUntilCpuFrame;
|
||||
if(bDidPresent)CaptureRenderedFrame();
|
||||
const auto BeforePresent=std::chrono::steady_clock::now();
|
||||
const bool bNonBlockingStartupPresent=bGpuFarEnabled&&!bInitialClipmapReported
|
||||
&&!bForceBlockingStartupPresent;
|
||||
@@ -5872,10 +5970,23 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
const auto PresentCallStart=std::chrono::steady_clock::now();
|
||||
// The CPU-ready frame is the ownership handoff gate for this route.
|
||||
// Keep that one presentation, then suppress presents while GPU work runs.
|
||||
const bool bDidPresent=!bGpuFarNoPresent||bDeferGpuUntilCpuFrame;
|
||||
const HRESULT PresentResult=bDidPresent
|
||||
?SwapChain->Present(PresentSyncInterval,PresentFlags):S_FALSE;
|
||||
const auto PresentCallEnd=std::chrono::steady_clock::now();
|
||||
if(LastCapturedFrameOrdinal==FrameOrdinal)
|
||||
{
|
||||
std::printf("[CaptureFramePresentation] mode=%s index=%d frame=%llu present_ordinal=%llu hr=0x%08lx present_called=%d status_succeeded=%d occluded=%d window_visible=%d\n",
|
||||
bLastCapturedSequenceIsFlight?"flight":"spawn",LastCapturedSequenceIndex,
|
||||
static_cast<unsigned long long>(LastCapturedFrameOrdinal),
|
||||
static_cast<unsigned long long>(LastCapturedPresentOrdinal),
|
||||
static_cast<unsigned long>(PresentResult),
|
||||
bDidPresent?1:0,SUCCEEDED(PresentResult)?1:0,
|
||||
PresentResult==DXGI_STATUS_OCCLUDED?1:0,IsWindowVisible(Window)?1:0);
|
||||
std::fflush(stdout);
|
||||
LastCapturedFrameOrdinal=0;
|
||||
LastCapturedPresentOrdinal=0;
|
||||
LastCapturedSequenceIndex=-1;
|
||||
}
|
||||
if(!bDidPresent&&!bGpuFarNoPresentReported)
|
||||
{
|
||||
bGpuFarNoPresentReported=true;
|
||||
@@ -6865,7 +6976,8 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
const FVector& CameraPositionVoxels,int32 WorkerCount,int32 MaxLevel,
|
||||
VoxelForgeCore::DetailVariant DetailVariant,const VoxelForgeCore::JobScheduler& Scheduler,
|
||||
bool bHashDensity,bool bSkipUvAndColors,bool bSkipMaterialGroups,bool bSkipUV,bool bSkipColors,
|
||||
std::chrono::steady_clock::time_point ColdStart)
|
||||
std::chrono::steady_clock::time_point ColdStart,bool bProfileColumnOverlap,
|
||||
int32 FarHorizonLOD8InteriorStepVoxels)
|
||||
{
|
||||
using Clock=std::chrono::steady_clock;
|
||||
FStandaloneOwnerWorld& World=*OwnerWorld;
|
||||
@@ -6933,7 +7045,8 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
const auto ShapeReady=Clock::now();
|
||||
const double ShapeSeconds=std::chrono::duration<double>(ShapeReady-ShapeBuildStart).count();
|
||||
FStandaloneStreamingGenerator Streamer(World,WorkerCount,bHashDensity,nullptr,MaxLevel,
|
||||
bSkipUvAndColors,bSkipMaterialGroups,bSkipUV,bSkipColors,&Shape);
|
||||
bSkipUvAndColors,bSkipMaterialGroups,bSkipUV,bSkipColors,&Shape,bProfileColumnOverlap,
|
||||
FarHorizonLOD8InteriorStepVoxels);
|
||||
const auto StreamStart=Clock::now();
|
||||
const FStandaloneStreamingUpdate Update=Streamer.StartWithDesired(Desired);
|
||||
if(Update.DesiredTiles!=static_cast<int32>(Desired.Tiles.size()))
|
||||
@@ -6946,6 +7059,47 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
std::vector<FHashedTile> DensityRows,MeshRows,PayloadRows,TopologyRows;
|
||||
int32 Finished=0,NeighborhoodFinished=0,FullDetailFinished=0;
|
||||
int32 FullDetailExpected=0;
|
||||
struct FColumnXY
|
||||
{
|
||||
std::int64_t X=0,Y=0;
|
||||
bool operator==(const FColumnXY&)const=default;
|
||||
};
|
||||
struct FColumnXYHash
|
||||
{
|
||||
std::size_t operator()(const FColumnXY& Value)const noexcept
|
||||
{
|
||||
const std::size_t X=std::hash<std::int64_t>{}(Value.X);
|
||||
const std::size_t Y=std::hash<std::int64_t>{}(Value.Y);
|
||||
return X^(Y+static_cast<std::size_t>(0x9E3779B9u)+(X<<6)+(X>>2));
|
||||
}
|
||||
};
|
||||
struct FFirstColumnUse
|
||||
{
|
||||
FVoxelTileKey Tile;
|
||||
std::uint64_t WorkerHash=0;
|
||||
};
|
||||
std::array<std::unordered_map<FColumnXY,std::vector<FFirstColumnUse>,FColumnXYHash>,9> ColumnUsesByLOD;
|
||||
std::array<std::uint64_t,9> ColumnDuplicateEventsByLOD{},NeighbourDuplicateEventsByLOD{};
|
||||
std::array<std::uint64_t,9> CrossWorkerNeighbourDuplicateEventsByLOD{};
|
||||
std::array<std::uint64_t,9> ColumnCaptureTilesByLOD{},ExpectedTilesByLOD{};
|
||||
std::array<bool,9> ColumnCaptureCompleteByLOD{};
|
||||
ColumnCaptureCompleteByLOD.fill(true);
|
||||
std::array<double,9> WorkerSecondsByLOD{};
|
||||
std::array<double,9> ColumnEvalMsByLOD{},MarchingExclusiveMsByLOD{};
|
||||
std::array<double,9> GroundRefineExclusiveMsByLOD{},CapRefineExclusiveMsByLOD{};
|
||||
std::array<double,9> MeshAssemblyMsByLOD{};
|
||||
std::array<std::uint64_t,9> TileCountByLOD{};
|
||||
for(const FVoxelTileKey& Tile:Desired.Tiles)
|
||||
if(Tile.Level>=0&&Tile.Level<static_cast<int32>(ExpectedTilesByLOD.size()))
|
||||
++ExpectedTilesByLOD[static_cast<std::size_t>(Tile.Level)];
|
||||
const auto AreSameLODNeighbours=[](const FVoxelTileKey& A,const FVoxelTileKey& B)
|
||||
{
|
||||
if(A.Level!=B.Level)return false;
|
||||
const std::int64_t DX=std::abs(static_cast<std::int64_t>(A.Coord.X)-B.Coord.X);
|
||||
const std::int64_t DY=std::abs(static_cast<std::int64_t>(A.Coord.Y)-B.Coord.Y);
|
||||
const std::int64_t DZ=std::abs(static_cast<std::int64_t>(A.Coord.Z)-B.Coord.Z);
|
||||
return std::max({DX,DY,DZ})<=1&&(DX+DY+DZ)>0;
|
||||
};
|
||||
uint64 NativeSolidBoxes=0,NativeAirBoxes=0,NativeMixedBoxes=0,NativeUnknownBoxes=0;
|
||||
uint64 NativeFieldCalls=0,NativeColumnHits=0,NativeColumnMisses=0,NativeMeshingSkips=0;
|
||||
double NativeClassificationMilliseconds=0.0,NativeColumnComputeMilliseconds=0.0;
|
||||
@@ -6961,6 +7115,53 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
for(const FStandaloneCpuTile& Tile:Ready)
|
||||
{
|
||||
++Finished;
|
||||
if(Tile.Key.Level>=0&&Tile.Key.Level<static_cast<int32>(TileCountByLOD.size()))
|
||||
{
|
||||
const std::size_t LOD=static_cast<std::size_t>(Tile.Key.Level);
|
||||
++TileCountByLOD[LOD];
|
||||
WorkerSecondsByLOD[LOD]+=Tile.WorkerSeconds;
|
||||
ColumnEvalMsByLOD[LOD]+=Tile.CoreDiagnostics.columnEvaluationExclusiveMilliseconds;
|
||||
MarchingExclusiveMsByLOD[LOD]+=Tile.CoreDiagnostics.marchingCubesExclusiveMilliseconds;
|
||||
GroundRefineExclusiveMsByLOD[LOD]+=Tile.CoreDiagnostics.groundRefinementExclusiveMilliseconds;
|
||||
CapRefineExclusiveMsByLOD[LOD]+=Tile.CoreDiagnostics.capRefinementExclusiveMilliseconds;
|
||||
MeshAssemblyMsByLOD[LOD]+=Tile.CoreDiagnostics.meshAssemblyMilliseconds;
|
||||
}
|
||||
if(bProfileColumnOverlap&&Tile.Key.Level>=0
|
||||
&&Tile.Key.Level<static_cast<int32>(ColumnCaptureTilesByLOD.size()))
|
||||
{
|
||||
const std::size_t LOD=static_cast<std::size_t>(Tile.Key.Level);
|
||||
++ColumnCaptureTilesByLOD[LOD];
|
||||
ColumnCaptureCompleteByLOD[LOD]=ColumnCaptureCompleteByLOD[LOD]
|
||||
&&Tile.CoreDiagnostics.columnCoordinateCaptureComplete;
|
||||
std::vector<std::array<std::int64_t,2>> Coordinates=
|
||||
Tile.CoreDiagnostics.evaluatedColumnCoordinates;
|
||||
std::sort(Coordinates.begin(),Coordinates.end());
|
||||
Coordinates.erase(std::unique(Coordinates.begin(),Coordinates.end()),Coordinates.end());
|
||||
for(const auto& Coordinate:Coordinates)
|
||||
{
|
||||
const FColumnXY XY{Coordinate[0],Coordinate[1]};
|
||||
auto [Uses,Inserted]=ColumnUsesByLOD[LOD].try_emplace(XY);
|
||||
std::vector<FFirstColumnUse>& PriorUses=Uses->second;
|
||||
if(Inserted)
|
||||
{
|
||||
PriorUses.push_back({Tile.Key,Tile.CoreDiagnostics.columnEvaluationWorkerHash});
|
||||
continue;
|
||||
}
|
||||
++ColumnDuplicateEventsByLOD[LOD];
|
||||
bool bHasNeighbourDuplicate=false,bHasCrossWorkerNeighbourDuplicate=false;
|
||||
for(const FFirstColumnUse& Prior:PriorUses)
|
||||
{
|
||||
if(!AreSameLODNeighbours(Prior.Tile,Tile.Key))continue;
|
||||
bHasNeighbourDuplicate=true;
|
||||
bHasCrossWorkerNeighbourDuplicate=bHasCrossWorkerNeighbourDuplicate
|
||||
||Prior.WorkerHash!=Tile.CoreDiagnostics.columnEvaluationWorkerHash;
|
||||
}
|
||||
if(bHasNeighbourDuplicate)++NeighbourDuplicateEventsByLOD[LOD];
|
||||
if(bHasCrossWorkerNeighbourDuplicate)
|
||||
++CrossWorkerNeighbourDuplicateEventsByLOD[LOD];
|
||||
PriorUses.push_back({Tile.Key,Tile.CoreDiagnostics.columnEvaluationWorkerHash});
|
||||
}
|
||||
}
|
||||
WholeViewReady=std::max(WholeViewReady,Tile.CompletedAt);
|
||||
if(Neighborhood.contains(Tile.Key))
|
||||
{
|
||||
@@ -7006,6 +7207,31 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
}
|
||||
}
|
||||
Streamer.Stop();
|
||||
bool bColumnOverlapCapturePassing=true;
|
||||
if(bProfileColumnOverlap)
|
||||
{
|
||||
for(std::size_t LOD=0;LOD<ColumnCaptureTilesByLOD.size();++LOD)
|
||||
{
|
||||
const bool bLODComplete=ColumnCaptureCompleteByLOD[LOD]
|
||||
&&ColumnCaptureTilesByLOD[LOD]==ExpectedTilesByLOD[LOD];
|
||||
bColumnOverlapCapturePassing=bColumnOverlapCapturePassing&&bLODComplete;
|
||||
std::printf("[WorldAssemblerLODColumnOverlap] lod=%zu tiles=%llu expected_tiles=%llu unique_xy_columns=%zu repeated_tile_evaluations=%llu neighbouring_duplicate_evaluations=%llu cross_worker_neighbouring_duplicates=%llu capture_complete=%d\n",
|
||||
LOD,static_cast<unsigned long long>(ColumnCaptureTilesByLOD[LOD]),
|
||||
static_cast<unsigned long long>(ExpectedTilesByLOD[LOD]),
|
||||
ColumnUsesByLOD[LOD].size(),
|
||||
static_cast<unsigned long long>(ColumnDuplicateEventsByLOD[LOD]),
|
||||
static_cast<unsigned long long>(NeighbourDuplicateEventsByLOD[LOD]),
|
||||
static_cast<unsigned long long>(CrossWorkerNeighbourDuplicateEventsByLOD[LOD]),
|
||||
bLODComplete?1:0);
|
||||
}
|
||||
}
|
||||
for(std::size_t LOD=0;LOD<TileCountByLOD.size();++LOD)
|
||||
{
|
||||
std::printf("[WorldAssemblerLODWorker] lod=%zu tiles=%llu worker_sum_s=%.6f column_eval_exclusive_ms=%.3f mc_exclusive_ms=%.3f ground_refine_exclusive_ms=%.3f cap_refine_exclusive_ms=%.3f mesh_assembly_ms=%.3f\n",
|
||||
LOD,static_cast<unsigned long long>(TileCountByLOD[LOD]),WorkerSecondsByLOD[LOD],
|
||||
ColumnEvalMsByLOD[LOD],MarchingExclusiveMsByLOD[LOD],
|
||||
GroundRefineExclusiveMsByLOD[LOD],CapRefineExclusiveMsByLOD[LOD],MeshAssemblyMsByLOD[LOD]);
|
||||
}
|
||||
const double NeighborhoodSeconds=std::chrono::duration<double>(NeighborhoodReady-ColdStart).count();
|
||||
const double NeighborhoodMeshSeconds=std::chrono::duration<double>(NeighborhoodReady-ShapeReady).count();
|
||||
const double FullDetailSeconds=std::chrono::duration<double>(FullDetailReady-ColdStart).count();
|
||||
@@ -7051,7 +7277,8 @@ float3 Lit=Rock*(Ambient+0.88*Diffuse)+float3(0.50,0.69,0.82)*Head*0.75;
|
||||
static_cast<unsigned long long>(HashTileRows(TopologyRows)));
|
||||
}
|
||||
return NeighborhoodFinished==static_cast<int32>(Neighborhood.size())
|
||||
&&FullDetailFinished==FullDetailExpected&&Finished==Update.DesiredTiles&&bHashesPassing?0:6;
|
||||
&&FullDetailFinished==FullDetailExpected&&Finished==Update.DesiredTiles&&bHashesPassing
|
||||
&&(!bProfileColumnOverlap||bColumnOverlapCapturePassing)?0:6;
|
||||
}
|
||||
int RunStreamingBenchmark(FStandaloneOwnerWorld& World,VoxelForgeCore::World* CoreWorld,
|
||||
const FVector& CameraPositionVoxels,
|
||||
@@ -9399,6 +9626,8 @@ int main(int Argc,char** Argv)
|
||||
std::string WorldAssemblyManifestOutputPath;
|
||||
bool bStreamBenchmark=false;
|
||||
bool bStreamPipeline=false;
|
||||
bool bProfileColumnOverlap=false;
|
||||
bool bCoarseFirstStreamOrder=false;
|
||||
bool bProfileDetailBand=false;
|
||||
bool bPassageDetailAuditOnly=false;
|
||||
bool bGridStairAudit=false;
|
||||
@@ -9420,9 +9649,19 @@ int main(int Argc,char** Argv)
|
||||
{
|
||||
const std::string_view Arg=Argv[I];
|
||||
if(Arg.starts_with("--capture="))App.CapturePath=std::string(Arg.substr(10));
|
||||
else if(Arg.starts_with("--far-horizon-lod8-step="))
|
||||
App.FarHorizonLOD8InteriorStepVoxels=std::max(0,std::atoi(
|
||||
std::string(Arg.substr(std::string_view("--far-horizon-lod8-step=").size())).c_str()));
|
||||
else if(Arg.starts_with("--capture-flight-sequence-prefix="))
|
||||
App.FlightCaptureSequencePrefix=std::string(
|
||||
Arg.substr(std::string_view("--capture-flight-sequence-prefix=").size()));
|
||||
else if(Arg.starts_with("--flight-capture-close-index="))
|
||||
App.FlightCaptureCloseIndex=std::atoi(
|
||||
std::string(Arg.substr(std::string_view("--flight-capture-close-index=").size())).c_str());
|
||||
else if(Arg.starts_with("--capture-spawn-sequence-prefix="))
|
||||
App.SpawnCaptureSequencePrefix=std::string(
|
||||
Arg.substr(std::string_view("--capture-spawn-sequence-prefix=").size()));
|
||||
else if(Arg=="--quit-after-spawn-captures")App.bQuitAfterSpawnCaptures=true;
|
||||
else if(Arg=="--no-vsync")App.bDisableVSync=true;
|
||||
else if(Arg.starts_with("--frame-limit="))
|
||||
{FrameLimitHz=std::clamp(std::atoi(std::string(Arg.substr(14)).c_str()),1,60);bFrameLimitSpecified=true;}
|
||||
@@ -9521,8 +9760,12 @@ int main(int Argc,char** Argv)
|
||||
else if(Arg=="--round-tunnels-legacy")
|
||||
{App.bRoundTunnels=true;App.bRoundTunnelEnhanced=false;}
|
||||
else if(Arg=="--stream-benchmark")bStreamBenchmark=true;
|
||||
else if(Arg=="--legacy-stream-order")bCoarseFirstStreamOrder=false;
|
||||
else if(Arg=="--coarse-first-stream-order")bCoarseFirstStreamOrder=true;
|
||||
else if(Arg=="--stream-pipeline")
|
||||
{bStreamPipeline=true;bStreamBenchmark=true;App.bShapeWorld=true;App.bForceGenerate=true;}
|
||||
else if(Arg=="--profile-column-overlap"||Arg=="--profile-far-column-overlap")
|
||||
{bProfileColumnOverlap=true;bStreamPipeline=true;bStreamBenchmark=true;App.bShapeWorld=true;App.bForceGenerate=true;}
|
||||
else if(Arg=="--edit-benchmark")
|
||||
{bEditBenchmark=true;bStreamBenchmark=true;App.bShapeWorld=true;}
|
||||
else if(Arg=="--stream-hash")bStreamHash=true;
|
||||
@@ -9613,6 +9856,10 @@ int main(int Argc,char** Argv)
|
||||
}
|
||||
else if(!Arg.empty()&&Arg.front()!='-')App.DataPath=std::string(Arg);
|
||||
}
|
||||
FStandaloneStreamingGenerator::SetCoarseFirstSchedulingEnabled(bCoarseFirstStreamOrder);
|
||||
std::printf("[StandaloneStreamOrder] mode=%s negative_control=%s\n",
|
||||
bCoarseFirstStreamOrder?"walkable_coarse_refine":"legacy_distance_lod",
|
||||
bCoarseFirstStreamOrder?"--legacy-stream-order":"none");
|
||||
std::printf("[FrameLimiter] target_fps=%d maximum=true vsync=%s source=%s\n",FrameLimitHz,
|
||||
App.bDisableVSync?"off":"on",bFrameLimitSpecified?"argument":"default");
|
||||
if(App.bCaptureOnlyTile&&App.bGpuFarEnabled)
|
||||
@@ -9735,7 +9982,8 @@ int main(int Argc,char** Argv)
|
||||
FVector(App.Position.X*4.0,App.Position.Y*4.0,App.Position.Z*4.0),
|
||||
App.WorkerCount,StreamBenchmarkMaxLevel,App.ShapeDetailVariant,App.CoreScheduler,
|
||||
bStreamHash||!BakeMeshCachePath.empty(),bSkipUvAndColors,bSkipMaterialGroups,
|
||||
bSkipUV,bSkipColors,ColdProcessStart);
|
||||
bSkipUV,bSkipColors,ColdProcessStart,bProfileColumnOverlap,
|
||||
App.FarHorizonLOD8InteriorStepVoxels);
|
||||
if(bEditBenchmark)
|
||||
return RunEditTransactionBenchmark(*App.World,*App.ShapeWorld,
|
||||
FVector(App.Position.X*4.0,App.Position.Y*4.0,App.Position.Z*4.0),App.WorkerCount);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <atomic>
|
||||
#include <bit>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <deque>
|
||||
@@ -409,6 +410,11 @@ namespace StandaloneWorldMesher
|
||||
class FStandaloneStreamingGenerator
|
||||
{
|
||||
public:
|
||||
static void SetCoarseFirstSchedulingEnabled(bool bEnabled)
|
||||
{bCoarseFirstSchedulingEnabled.store(bEnabled,std::memory_order_relaxed);}
|
||||
static bool IsCoarseFirstSchedulingEnabled()
|
||||
{return bCoarseFirstSchedulingEnabled.load(std::memory_order_relaxed);}
|
||||
|
||||
explicit FStandaloneStreamingGenerator(FStandaloneOwnerWorld& InWorld,int32 InWorkerCount=8,
|
||||
bool bInHashDensity=false,
|
||||
const FStandaloneMeshCache* InMeshCache=nullptr,
|
||||
@@ -417,11 +423,15 @@ public:
|
||||
bool bInSkipMaterialGroups=false,
|
||||
bool bInSkipUV=false,
|
||||
bool bInSkipColors=false,
|
||||
VoxelForgeCore::World* InCoreWorld=nullptr)
|
||||
VoxelForgeCore::World* InCoreWorld=nullptr,
|
||||
bool bInCaptureColumnCoordinates=false,
|
||||
int32 InLod8HorizonInteriorStepVoxels=0)
|
||||
:World(&InWorld),WorkerCount(FMath::Clamp(InWorkerCount,1,16)),bHashDensity(bInHashDensity),
|
||||
MeshCache(InMeshCache),MaxLevelFilter(InMaxLevelFilter),
|
||||
CoreWorld(InCoreWorld),bSkipUvAndColors(bInSkipUvAndColors),bSkipMaterialGroups(bInSkipMaterialGroups),
|
||||
bSkipUV(bInSkipUV),bSkipColors(bInSkipColors)
|
||||
bSkipUV(bInSkipUV),bSkipColors(bInSkipColors),
|
||||
bCaptureColumnCoordinates(bInCaptureColumnCoordinates),
|
||||
Lod8HorizonInteriorStepVoxels(std::max(0,InLod8HorizonInteriorStepVoxels))
|
||||
{
|
||||
VoxelGenLOD::InitializeConsoleSwitches();
|
||||
UVoxelMarchingCubesMesher::InitializeConsoleSwitches();
|
||||
@@ -448,6 +458,7 @@ public:
|
||||
bStop=false;
|
||||
}
|
||||
for(int32 I=0;I<WorkerCount;++I)Workers.emplace_back([this](){WorkerLoop();});
|
||||
bHasLastCameraPosition=false;TravelDirection=FVector::ZeroVector;
|
||||
return UpdateDesired(CameraPositionVoxels,ResidentKeys,CrossingIndex);
|
||||
}
|
||||
|
||||
@@ -461,6 +472,7 @@ public:
|
||||
bStop=false;
|
||||
}
|
||||
for(int32 I=0;I<WorkerCount;++I)Workers.emplace_back([this](){WorkerLoop();});
|
||||
bHasLastCameraPosition=false;TravelDirection=FVector::ZeroVector;
|
||||
return UpdateDesiredSet(InitialDesired,ResidentKeys,CrossingIndex);
|
||||
}
|
||||
|
||||
@@ -507,6 +519,23 @@ public:
|
||||
const FVector& CameraPositionVoxels,const std::vector<FVoxelTileKey>& ResidentKeys,
|
||||
uint64 CrossingIndex=0)
|
||||
{
|
||||
if(bHasLastCameraPosition)
|
||||
{
|
||||
const FVector Delta=CameraPositionVoxels-LastCameraPositionVoxels;
|
||||
const double LengthSquared=static_cast<double>(Delta.X)*Delta.X
|
||||
+static_cast<double>(Delta.Y)*Delta.Y;
|
||||
if(LengthSquared>1.0e-12)
|
||||
{
|
||||
const double InverseLength=1.0/std::sqrt(LengthSquared);
|
||||
TravelDirection=FVector(static_cast<float>(Delta.X*InverseLength),
|
||||
static_cast<float>(Delta.Y*InverseLength),0.0f);
|
||||
}
|
||||
else TravelDirection=FVector::ZeroVector;
|
||||
}
|
||||
else
|
||||
TravelDirection=FVector::ZeroVector;
|
||||
LastCameraPositionVoxels=CameraPositionVoxels;
|
||||
bHasLastCameraPosition=true;
|
||||
FStandaloneDesiredTileSet NewDesired=StandaloneWorldMesher::BuildDesiredSet(*World,CameraPositionVoxels);
|
||||
if(CoreWorld)
|
||||
{
|
||||
@@ -652,17 +681,60 @@ private:
|
||||
Stats.CancelledByCrossing.reserve(CancelledByCrossing.size());
|
||||
for(const auto& Pair:CancelledByCrossing)Stats.CancelledByCrossing.push_back(Pair);
|
||||
|
||||
std::vector<VoxelForgeCore::TileKey> Unordered;Unordered.reserve(NewDesired.Tiles.size());
|
||||
for(const FVoxelTileKey& Key:NewDesired.Tiles)
|
||||
Unordered.push_back({{Key.Coord.X,Key.Coord.Y,Key.Coord.Z},Key.Level});
|
||||
const auto Prioritized=VoxelForgeCore::World::prioritizeTiles(Unordered,
|
||||
{NewDesired.CenterChunk.X,NewDesired.CenterChunk.Y,NewDesired.CenterChunk.Z});
|
||||
std::vector<FVoxelTileKey> Prioritized=NewDesired.Tiles;
|
||||
if(IsCoarseFirstSchedulingEnabled())
|
||||
{
|
||||
// The local walkable ring leads, the coarse enclosure follows, then target-detail work.
|
||||
// L'anneau praticable local passe d'abord, puis l'enveloppe grossiere, puis le detail cible.
|
||||
const int32 FirstCoarseLevel=FMath::Max(2,World->FullResClipLevels);
|
||||
auto Tier=[&](const FVoxelTileKey& Key)
|
||||
{
|
||||
if(Key.Level==0&&std::abs(Key.Coord.X-NewDesired.CenterChunk.X)<=1
|
||||
&&std::abs(Key.Coord.Y-NewDesired.CenterChunk.Y)<=1
|
||||
&&std::abs(Key.Coord.Z-NewDesired.CenterChunk.Z)<=1)return 0;
|
||||
return Key.Level>=FirstCoarseLevel?1:2;
|
||||
};
|
||||
auto IsAhead=[&](const FVoxelTileKey& Key)
|
||||
{
|
||||
if(TravelDirection.X*TravelDirection.X+TravelDirection.Y*TravelDirection.Y<=1.0e-12f)
|
||||
return false;
|
||||
const double Scale=static_cast<double>(1<<Key.Level);
|
||||
const double OffsetX=(static_cast<double>(Key.Coord.X)+0.5)*Scale-NewDesired.CenterChunk.X;
|
||||
const double OffsetY=(static_cast<double>(Key.Coord.Y)+0.5)*Scale-NewDesired.CenterChunk.Y;
|
||||
return OffsetX*TravelDirection.X+OffsetY*TravelDirection.Y>0.0;
|
||||
};
|
||||
std::sort(Prioritized.begin(),Prioritized.end(),[&](const FVoxelTileKey& A,const FVoxelTileKey& B)
|
||||
{
|
||||
const int32 TierA=Tier(A),TierB=Tier(B);
|
||||
if(TierA!=TierB)return TierA<TierB;
|
||||
if(TierA==1&&A.Level!=B.Level)return A.Level>B.Level;
|
||||
const bool bAheadA=IsAhead(A),bAheadB=IsAhead(B);
|
||||
if(bAheadA!=bAheadB)return bAheadA;
|
||||
const double DA=StandaloneWorldMesher::TileDistanceSquaredChunks(A,NewDesired.CenterChunk);
|
||||
const double DB=StandaloneWorldMesher::TileDistanceSquaredChunks(B,NewDesired.CenterChunk);
|
||||
if(DA!=DB)return DA<DB;
|
||||
if(A.Level!=B.Level)return A.Level<B.Level;
|
||||
if(A.Coord.Z!=B.Coord.Z)return A.Coord.Z<B.Coord.Z;
|
||||
if(A.Coord.Y!=B.Coord.Y)return A.Coord.Y<B.Coord.Y;
|
||||
return A.Coord.X<B.Coord.X;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<VoxelForgeCore::TileKey> Unordered;Unordered.reserve(NewDesired.Tiles.size());
|
||||
for(const FVoxelTileKey& Key:NewDesired.Tiles)
|
||||
Unordered.push_back({{Key.Coord.X,Key.Coord.Y,Key.Coord.Z},Key.Level});
|
||||
const auto CorePrioritized=VoxelForgeCore::World::prioritizeTiles(Unordered,
|
||||
{NewDesired.CenterChunk.X,NewDesired.CenterChunk.Y,NewDesired.CenterChunk.Z});
|
||||
Prioritized.clear();Prioritized.reserve(CorePrioritized.size());
|
||||
for(const auto& Key:CorePrioritized)
|
||||
Prioritized.emplace_back(FIntVector(Key.coordinate.x,Key.coordinate.y,Key.coordinate.z),Key.lod);
|
||||
}
|
||||
std::unordered_map<FVoxelTileKey,size_t,FStandaloneTileKeyHash> PriorityRanks;
|
||||
PriorityRanks.reserve(Prioritized.size()*2+1);
|
||||
for(size_t Rank=0;Rank<Prioritized.size();++Rank)
|
||||
{
|
||||
const auto& Key=Prioritized[Rank];
|
||||
PriorityRanks.emplace(FVoxelTileKey(FIntVector(Key.coordinate.x,Key.coordinate.y,Key.coordinate.z),Key.lod),Rank);
|
||||
PriorityRanks.emplace(Prioritized[Rank],Rank);
|
||||
}
|
||||
for(FStandaloneTileJob& Job:Queue)Job.PriorityRank=PriorityRanks.at(Job.Key);
|
||||
|
||||
@@ -727,6 +799,8 @@ private:
|
||||
Options.bandMinZVoxel=Job.BandZMin;Options.bandMaxZVoxel=Job.BandZMax;
|
||||
Options.hashDensity=bHashDensity;Options.skipUvAndColors=bSkipUvAndColors;
|
||||
Options.skipMaterialGroups=bSkipMaterialGroups;Options.skipUv=bSkipUV;Options.skipColors=bSkipColors;
|
||||
Options.captureColumnCoordinates=bCaptureColumnCoordinates;
|
||||
Options.lod8HorizonInteriorStepVoxels=Lod8HorizonInteriorStepVoxels;
|
||||
std::string Error;
|
||||
auto Result=CoreWorld->generateTile(
|
||||
{{Job.Key.Coord.X,Job.Key.Coord.Y,Job.Key.Coord.Z},Job.Key.Level},Options,Error);
|
||||
@@ -884,6 +958,10 @@ private:
|
||||
TimelineMilliseconds(Started),TimelineMilliseconds(Finished),WorkerMs);
|
||||
}
|
||||
FStandaloneOwnerWorld* World=nullptr;
|
||||
inline static std::atomic<bool> bCoarseFirstSchedulingEnabled{true};
|
||||
FVector LastCameraPositionVoxels=FVector::ZeroVector;
|
||||
FVector TravelDirection=FVector::ZeroVector;
|
||||
bool bHasLastCameraPosition=false;
|
||||
int32 WorkerCount=8;
|
||||
bool bHashDensity=false;
|
||||
const FStandaloneMeshCache* MeshCache=nullptr;
|
||||
@@ -893,6 +971,8 @@ private:
|
||||
bool bSkipMaterialGroups=false;
|
||||
bool bSkipUV=false;
|
||||
bool bSkipColors=false;
|
||||
bool bCaptureColumnCoordinates=false;
|
||||
int32 Lod8HorizonInteriorStepVoxels=0;
|
||||
std::atomic<uint64> CacheHitCount{0};
|
||||
mutable std::mutex Mutex;
|
||||
std::condition_variable Wake;
|
||||
|
||||
@@ -2,6 +2,22 @@
|
||||
param(
|
||||
[ValidateRange(60, 900)][int]$TimeoutSeconds = 900,
|
||||
[ValidateRange(12.5, 25.0)][double]$CoreVoxelSizeCm = 25.0,
|
||||
[ValidateSet('CoarseFirst', 'Legacy')][string]$StreamingOrder = 'Legacy',
|
||||
[ValidateSet('Auto', 'Legacy', 'Dynamic')][string]$NearReserveMode = 'Auto',
|
||||
[switch]$EnforceCollisionGate,
|
||||
[switch]$StartupTrace,
|
||||
[ValidateRange(-1, 1)][int]$StartupApplyBoost = -1,
|
||||
[switch]$StreamingTraceOnly,
|
||||
[ValidateRange(1, 6000)][int]$TestMoveSpeedCmPerSecond = 600,
|
||||
[ValidateRange(0, 1)][int]$StreamingCollisionLookahead = 1,
|
||||
[string]$TestMoveDirection = '0,1,0',
|
||||
[ValidateRange(0, 1)][int]$CoreRegionConcurrentAdmission = 1,
|
||||
[ValidateRange(0, 4096)][int]$StreamingResultBacklogCap = 256,
|
||||
[ValidateRange(0, 10)][int]$StreamingReadyQueueDepth = 8,
|
||||
[ValidateRange(0, 1)][int]$StreamingBackgroundWorkerCap = 1,
|
||||
[ValidateRange(0, 900)][int]$Step1MaxMeshApplies = 0,
|
||||
[ValidateRange(0, 900)][int]$TestTeleportAfterSeconds = 0,
|
||||
[ValidateRange(0, 1000000)][int]$TestTeleportDistanceCm = 0,
|
||||
[string]$WorldAssemblyManifestPath = '',
|
||||
[ValidateSet('MarchingCubesV1', 'WorldAssemblerHybridV1', 'WorldAssemblerHybridV2')][string]$CoreMesherRecipe = 'MarchingCubesV1',
|
||||
[switch]$EnableHybridFixturePlacement,
|
||||
@@ -47,11 +63,17 @@ $RunName = if ($FloatingIslandsOnly) { "floating_islands$CoreSizeSuffix" }
|
||||
elseif ($CoreOffTest) { "core_off$CoreSizeSuffix" }
|
||||
elseif ($CorePlanOnly) { if ($CoreTestSeed -ne [int]::MinValue) { "plan_seed_$CoreTestSeed$CoreSizeSuffix" } else { "plan_only$CoreSizeSuffix" } }
|
||||
else { "owner_surface$CoreSizeSuffix" }
|
||||
$RunName += $(if ($StreamingTraceOnly) { '_stream_trace_only' } else { '' })
|
||||
$StartupApplyBoostLabel = if ($StartupApplyBoost -lt 0) { 'default' } else { [string]$StartupApplyBoost }
|
||||
$RunName += "_applyboost_$StartupApplyBoostLabel"
|
||||
if ($StreamingTraceOnly) {
|
||||
$RunName += "_bgcap_${StreamingBackgroundWorkerCap}_readyq_${StreamingReadyQueueDepth}"
|
||||
}
|
||||
|
||||
if ($MismatchedManifestFallback) { $CoreFallbackTest = $true }
|
||||
$SelectedModeFlags = @(
|
||||
[bool]$FloatingIslandsOnly, [bool]$CoreFallbackTest,
|
||||
[bool]$CoreOffTest, [bool]$CorePlanOnly
|
||||
[bool]$CoreOffTest, [bool]$CorePlanOnly, [bool]$StreamingTraceOnly
|
||||
)
|
||||
$SelectedModeCount = @($SelectedModeFlags | Where-Object { $_ }).Count
|
||||
if ($SelectedModeCount -gt 1) { throw 'Select one Core test mode per BuildHost launch.' }
|
||||
@@ -61,6 +83,31 @@ if ($CorePlanOnly -and $CoreTestSeed -eq [int]::MinValue) {
|
||||
if ($CoreTestSeed -ne [int]::MinValue -and -not $CorePlanOnly) {
|
||||
throw '-CoreTestSeed is valid only with -CorePlanOnly.'
|
||||
}
|
||||
if ($StreamingTraceOnly -and ($SharedFeatureAuditOnly -or $EnableHybridFixturePlacement -or
|
||||
$HybridCliffOnly -or $HybridFixturesOnly -or $WorldAssemblyManifestPath)) {
|
||||
throw '-StreamingTraceOnly uses the staged owner plan without additional fixture or manifest overrides.'
|
||||
}
|
||||
if ($TestMoveDirection -notmatch '^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+),[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+),[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$') {
|
||||
throw '-TestMoveDirection must be three comma-separated invariant-culture numbers without spaces.'
|
||||
}
|
||||
$MoveDirectionComponents = @($TestMoveDirection.Split(',') | ForEach-Object {
|
||||
[double]::Parse($_, [Globalization.CultureInfo]::InvariantCulture)
|
||||
})
|
||||
if ($MoveDirectionComponents[0] -eq 0 -and $MoveDirectionComponents[1] -eq 0 -and
|
||||
$MoveDirectionComponents[2] -eq 0) {
|
||||
throw '-TestMoveDirection must not be the zero vector.'
|
||||
}
|
||||
if (-not $StreamingTraceOnly -and ($TestMoveSpeedCmPerSecond -ne 600 -or
|
||||
$StreamingCollisionLookahead -ne 1 -or $TestMoveDirection -ne '0,1,0' -or
|
||||
$CoreRegionConcurrentAdmission -ne 1 -or $StreamingResultBacklogCap -ne 256 -or
|
||||
$StreamingReadyQueueDepth -ne 8 -or $StreamingBackgroundWorkerCap -ne 1 -or
|
||||
$Step1MaxMeshApplies -ne 0 -or $TestTeleportAfterSeconds -ne 0 -or
|
||||
$TestTeleportDistanceCm -ne 0)) {
|
||||
throw 'Streaming, backlog, apply and teleport controls require -StreamingTraceOnly.'
|
||||
}
|
||||
if (($TestTeleportAfterSeconds -eq 0) -ne ($TestTeleportDistanceCm -eq 0)) {
|
||||
throw 'Set both -TestTeleportAfterSeconds and -TestTeleportDistanceCm for the teleport probe.'
|
||||
}
|
||||
|
||||
function Assert-UnderPath([string]$Candidate, [string]$Root) {
|
||||
$candidateFull = [IO.Path]::GetFullPath($Candidate).TrimEnd('\', '/')
|
||||
@@ -133,6 +180,23 @@ if ($SharedFeatureAuditOnly) {
|
||||
if ($SelectedModeCount -ne 0) { throw '-SharedFeatureAuditOnly uses the SurfaceWorld owner route.' }
|
||||
$RunName = 'shared_feature_audit'
|
||||
}
|
||||
$RunName += if ($StreamingOrder -eq 'Legacy') { '_legacy_order' } else { '_coarse_first' }
|
||||
$RunName += switch ($NearReserveMode) {
|
||||
'Legacy' { '_nearreserve_legacy' }
|
||||
'Dynamic' { '_nearreserve_dynamic' }
|
||||
default { '_nearreserve_auto' }
|
||||
}
|
||||
if ($HybridFixturesOnly) { $RunName += "_$($CoreMesherRecipe.ToLowerInvariant())" }
|
||||
if ($EnforceCollisionGate) { $RunName += '_collision_gate' }
|
||||
if ($StartupTrace -or $StreamingTraceOnly) { $RunName += '_trace' }
|
||||
if ($StreamingTraceOnly) {
|
||||
$DirectionTag = $TestMoveDirection.Replace(',', '_').Replace('-', 'm').Replace('+', 'p').Replace('.', 'p')
|
||||
$RunName += "_move_${TestMoveSpeedCmPerSecond}_lookahead_${StreamingCollisionLookahead}_dir_${DirectionTag}_region_${CoreRegionConcurrentAdmission}_backlog_${StreamingResultBacklogCap}"
|
||||
if ($Step1MaxMeshApplies -gt 0) { $RunName += "_applymax_$Step1MaxMeshApplies" }
|
||||
if ($TestTeleportAfterSeconds -gt 0) {
|
||||
$RunName += "_teleport_${TestTeleportAfterSeconds}s_${TestTeleportDistanceCm}cm"
|
||||
}
|
||||
}
|
||||
|
||||
$foreignEditors = @(Get-Process -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.ProcessName -like 'UnrealEditor*' })
|
||||
@@ -247,6 +311,44 @@ $BaseArguments = @(
|
||||
("-corehybridfixturesonly=$HybridFixturesOnlyFlag"),
|
||||
('-out="{0}"' -f $OutputDirectory)
|
||||
)
|
||||
$CoarseFirstValue = if ($StreamingOrder -eq 'CoarseFirst') { 1 } else { 0 }
|
||||
$DynamicReserveValue = switch ($NearReserveMode) {
|
||||
'Legacy' { 0 }
|
||||
'Dynamic' { 1 }
|
||||
default { 1 }
|
||||
}
|
||||
$LegacyPendingResultCapValue = if ($NearReserveMode -eq 'Legacy') { 1 } else { 0 }
|
||||
$BaseArguments += "-voxel.StreamingCoarseFirst=$CoarseFirstValue"
|
||||
$BaseArguments += "-voxel.StreamingDynamicNearReserve=$DynamicReserveValue"
|
||||
$BaseArguments += "-voxel.StreamingLegacyPendingResultCap=$LegacyPendingResultCapValue"
|
||||
if ($StartupApplyBoost -ge 0) {
|
||||
$BaseArguments += "-voxel.StreamingStartupApplyBoost=$StartupApplyBoost"
|
||||
}
|
||||
$BaseArguments += "-voxel.CoreRegionConcurrentAdmission=$CoreRegionConcurrentAdmission"
|
||||
$BaseArguments += "-voxel.StreamingResultBacklogCap=$StreamingResultBacklogCap"
|
||||
$BaseArguments += "-voxel.StreamingReadyQueueDepth=$StreamingReadyQueueDepth"
|
||||
$BaseArguments += "-voxel.StreamingBackgroundWorkerCap=$StreamingBackgroundWorkerCap"
|
||||
if ($Step1MaxMeshApplies -gt 0) {
|
||||
$BaseArguments += "-voxel.Step1MaxMeshApplies=$Step1MaxMeshApplies"
|
||||
}
|
||||
if ($StreamingTraceOnly) {
|
||||
$BaseArguments += '-coreworldstreamtrace=1'
|
||||
$BaseArguments += '-voxel.TestMove=1'
|
||||
$BaseArguments += "-voxel.TestMoveSpeedCmPerSecond=$TestMoveSpeedCmPerSecond"
|
||||
$BaseArguments += '-voxel.TestMoveStartSeconds=30'
|
||||
$BaseArguments += "-voxel.TestMoveDirection=$TestMoveDirection"
|
||||
$BaseArguments += "-voxel.StreamingCollisionLookahead=$StreamingCollisionLookahead"
|
||||
if ($TestTeleportAfterSeconds -gt 0) {
|
||||
$BaseArguments += "-voxel.TestTeleportAfterSeconds=$TestTeleportAfterSeconds"
|
||||
$BaseArguments += "-voxel.TestTeleportDistanceCm=$TestTeleportDistanceCm"
|
||||
}
|
||||
}
|
||||
if ($StartupTrace -or $StreamingTraceOnly) {
|
||||
$TracePath = Join-Path $LogDirectory "CoreWorldValidation-$RunName.trace.jsonl"
|
||||
$BaseArguments += ('-voxel.StartupTraceFile="{0}"' -f $TracePath)
|
||||
$BaseArguments += '-voxel.StartupTraceUntilEndPlay=1'
|
||||
$BaseArguments += '-voxel.StartupTraceMaxTiles=16384'
|
||||
}
|
||||
if ($SharedFeatureAuditOnly) { $BaseArguments += '-corefeatureauditonly' }
|
||||
if ($HasManifestOverride) {
|
||||
$BaseArguments += ('-coreworldassembly="{0}"' -f $StagedWorldAssembly)
|
||||
@@ -254,7 +356,8 @@ if ($HasManifestOverride) {
|
||||
if ($CoreTestSeed -ne [int]::MinValue) {
|
||||
$BaseArguments += "-coretestseed=$CoreTestSeed"
|
||||
}
|
||||
if ($FloatingIslandsOnly -or (-not $CoreFallbackTest -and -not $CoreOffTest -and -not $CorePlanOnly)) {
|
||||
if (-not $EnforceCollisionGate -and
|
||||
($FloatingIslandsOnly -or (-not $CoreFallbackTest -and -not $CoreOffTest -and -not $CorePlanOnly))) {
|
||||
# This commandlet keeps the travel pawn stationary; surface's initial collision cooks are still audited,
|
||||
# and FloatingIslandsOnly separately probes cooked island/span capsule contacts.
|
||||
# Le pawn de voyage du commandlet reste immobile ; les collisions de surface initiales sont auditees,
|
||||
@@ -371,6 +474,24 @@ if ($SharedFeatureAuditOnly) {
|
||||
Write-Host "Peak commandlet private bytes sampled: $PeakPrivateBytes"
|
||||
return
|
||||
}
|
||||
if ($StreamingTraceOnly) {
|
||||
$ExpectedWalkDirection = "walk_direction=$TestMoveDirection"
|
||||
if ($Text -notmatch '\[VoxelForgeCoreWorldStreamTrace\] initial_ready=1 .*walk_tick_ms_p95=.*walk_tick_ms_max=' -or
|
||||
$Text -notmatch ("\[VoxelForgeCoreWorldStreamTrace\] pass complete=1 .*walk_speed_cm_s=$TestMoveSpeedCmPerSecond") -or
|
||||
-not $Text.Contains($ExpectedWalkDirection) -or
|
||||
$Text -notmatch '\[VoxelForgeCoreWorldTest\] pass complete=1') {
|
||||
throw "BuildHost actor-only stream trace did not prove initial readiness and a completed walk sample. See $FinalLog."
|
||||
}
|
||||
$NewCrashes = @(Get-NewCrashFolders)
|
||||
if ($NewCrashes.Count -gt 0) {
|
||||
throw "New UECC crash folders appeared during the stream trace: $($NewCrashes -join '; ')"
|
||||
}
|
||||
Write-Host "VOXELFORGE_CORE_STREAM_TRACE_PASS boost=$StartupApplyBoostLabel order=$StreamingOrder"
|
||||
Write-Host "Core actor log: $FinalLog"
|
||||
Write-Host "Startup trace: $TracePath"
|
||||
Write-Host "Peak commandlet private bytes sampled: $PeakPrivateBytes"
|
||||
return
|
||||
}
|
||||
if ($CoreFallbackTest) {
|
||||
foreach ($Marker in @(
|
||||
'[VoxelForgeCoreFallbackTest] fallback=PASS core_disabled=1 legacy_generator=1',
|
||||
|
||||
@@ -488,10 +488,10 @@ function Invoke-UnrealLaunch([string]$Kind, [string[]]$Arguments, [string]$LogPa
|
||||
$process = Start-Process -FilePath $EditorExe -ArgumentList $Arguments -WorkingDirectory $HostRoot `
|
||||
-RedirectStandardOutput $StdoutPath -RedirectStandardError $StderrPath -WindowStyle $windowStyle `
|
||||
-PassThru
|
||||
try { $process.PriorityClass = [Diagnostics.ProcessPriorityClass]::BelowNormal }
|
||||
try { $process.PriorityClass = [Diagnostics.ProcessPriorityClass]::Normal }
|
||||
catch {
|
||||
try { Stop-Process -Id ([int]$process.Id) -Force -ErrorAction Stop } catch { }
|
||||
throw "Could not lower owned Unreal PID $($process.Id) to BelowNormal: $($_.Exception.Message)"
|
||||
throw "Could not set owned Unreal PID $($process.Id) to Normal priority: $($_.Exception.Message)"
|
||||
}
|
||||
$ledger.pid = [int]$process.Id
|
||||
$wait = Wait-OwnedProcess $process $LaunchTimeoutSeconds -EnforceMemoryLimit
|
||||
@@ -547,10 +547,10 @@ function Invoke-BuildProcess([string[]]$Arguments, [string]$LogPath, [string]$Er
|
||||
$process = Start-Process -FilePath $dotnet -ArgumentList $Arguments -WorkingDirectory $PluginRoot `
|
||||
-RedirectStandardOutput $StdoutPath -RedirectStandardError $ErrorPath -WindowStyle Hidden `
|
||||
-PassThru
|
||||
try { $process.PriorityClass = [Diagnostics.ProcessPriorityClass]::BelowNormal }
|
||||
try { $process.PriorityClass = [Diagnostics.ProcessPriorityClass]::Normal }
|
||||
catch {
|
||||
try { Stop-Process -Id ([int]$process.Id) -Force -ErrorAction Stop } catch { }
|
||||
throw "Could not lower owned build PID $($process.Id) to BelowNormal: $($_.Exception.Message)"
|
||||
throw "Could not set owned build PID $($process.Id) to Normal priority: $($_.Exception.Message)"
|
||||
}
|
||||
$wait = Wait-OwnedProcess $process $LaunchTimeoutSeconds -EnforceMemoryLimit
|
||||
} finally {
|
||||
|
||||