feat: add aperture mouth candidate and early foreground permissions
Route runtime04 curve values to five source-frame lip geometries with level0 body bypass and spatial opacity1 for all other levels. Preserve the continuous decoded body clock and clean home. Request normal permissions after foreground host layout independently of network; support offline manual consent without capture or connection. Add strict 97x5 parsing, renderer and permission regressions, offline EGL shader pixel goldens and exact debug-candidate packaging. Naturalness, visible talk, device colors and perceived response remain pending.
This commit is contained in:
@@ -92,6 +92,7 @@ fun checkContinuous() {
|
||||
for(b in listOf(0f,.123f,1f)) for(a in listOf(0f,.5f,1f)) check(composeMouthChannel(b,.8f,a,0f)==b)
|
||||
check(kotlin.math.abs(composeMouthChannel(.2f,.8f,.5f,.5f)-.35f)<.00001)
|
||||
checkContinuousRenderer(pack)
|
||||
checkApertureRuntime()
|
||||
println("PASS: continuous runtime strict hash/bounds/97frame/routing/alpha parser; independent mouth state/latest generation/abort/reversal/random continuation; actual decoded-latched frame+loop indexing; Fit/patch mapping/alpha-zero; atomic presenter lifecycle and failure fences")
|
||||
}
|
||||
private fun checkContinuousRenderer(pack: ContinuousAvatarPack) {
|
||||
@@ -107,10 +108,11 @@ private fun checkContinuousRenderer(pack: ContinuousAvatarPack) {
|
||||
TestScheduler.advanceBy(2500)
|
||||
check(errors.isEmpty() && frames.size>97 && frames[97].key.index==0 && frames[97].key.loopOrdinal==1L)
|
||||
check(GLFixture.swaps==frames.size && GLFixture.draws==frames.size)
|
||||
check(frames.map { it.key.index+1 }==GLFixture.rendered.map { it.first })
|
||||
check(frames.map { it.selection.textureSlot+1 }==GLFixture.rendered.map { it.first })
|
||||
check(frames.map { it.selection.opacity }==GLFixture.rendered.map { it.second })
|
||||
check(frames.last().mouth.phase=="idle")
|
||||
val before=frames.size;renderer.close();TestScheduler.advanceBy(1000)
|
||||
check(frames.size==before && CodecFixture.releases==1 && GLFixture.deleted==98 && GLFixture.terminated==1)
|
||||
check(frames.size==before && CodecFixture.releases==1 && GLFixture.deleted==pack.textureImages.size+1 && GLFixture.terminated==1)
|
||||
reset();val (timestamp,_,timestampErrors)=rig();CodecFixture.onRender={pts->SurfaceTexture.lastCreated?.emit(pts*1000+100000)}
|
||||
TestScheduler.advanceBy(100);check(timestampErrors.size==1);timestamp.close()
|
||||
reset();GLFixture.swapFails=true;val (swap,swapFrames,swapErrors)=rig();TestScheduler.advanceBy(100)
|
||||
@@ -123,3 +125,40 @@ private fun checkContinuousRenderer(pack: ContinuousAvatarPack) {
|
||||
check(cancelFrames.isEmpty())
|
||||
println("PASS: real ContinuousBodyRenderer with deterministic Android MediaCodec/EGL doubles: one atomic draw/swap per decoded+latched body frame, 97frame wrap, patch selection, stop body continuity, timestamp/swap/size/timeout failures and resource teardown; actual GPU/device pending")
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun checkApertureRuntime() {
|
||||
val old=continuousFixture()
|
||||
val rows=(old["patches"] as List<Map<String,Any?>>).mapIndexed { index,p ->
|
||||
val levels=(0..4).map { level -> mapOf("levelIndex" to level,"aperture" to level/4f,
|
||||
"path" to "patches/$index-l$level.png","sha256" to runtimeSha) }
|
||||
p+mapOf("levels" to levels,"path" to levels[4]["path"])
|
||||
}
|
||||
val root=old+mapOf("packId" to "a01-neutral-graph-v1-runtime-04","patches" to rows,
|
||||
"patchFormat" to mapOf("format" to "PNG RGBA 8bit","alphaEncoding" to "straight_unassociated",
|
||||
"apertureLevels" to listOf(0f,.25f,.5f,.75f,1f),"requiresRendererExtension" to true))
|
||||
fun read(r: Map<String,Any?>)=ContinuousAvatarManifest.read(r,runtimeSha,runtimeSha,true,"runtime04/")
|
||||
val pack=checkNotNull(read(root));check(pack.apertureMode && pack.textureImages.size==485)
|
||||
for(frame in 0..96) for(level in 0..4) {
|
||||
val selection=selectMouthPatch(pack,frame,level/4f)
|
||||
check(selection.textureSlot==frame*5+level && selection.levelIndex==level)
|
||||
check(selection.opacity==if(level==0) 0f else 1f)
|
||||
check(pack.textureImages[selection.textureSlot].path=="patches/$frame-l$level.png")
|
||||
}
|
||||
for((g,level) in listOf(0f to 0,.1249f to 0,.125f to 0,.1251f to 1,.25f to 1,.375f to 1,.3751f to 2,.5f to 2,.75f to 3,1f to 4))
|
||||
check(selectMouthPatch(pack,0,g).levelIndex==level)
|
||||
for(g in listOf(Float.NaN,-.1f,1.1f)) check(runCatching { selectMouthPatch(pack,0,g) }.isFailure)
|
||||
check(runCatching { selectMouthPatch(pack,97,.5f) }.isFailure)
|
||||
val levels=rows[0]["levels"] as List<Map<String,Any?>>
|
||||
fun invalidFirst(row: Map<String,Any?>) { check(read(root+("patches" to listOf(row)+rows.drop(1)))==null) }
|
||||
invalidFirst(rows[0]+("levels" to levels.dropLast(1)))
|
||||
invalidFirst(rows[0]+("levels" to listOf(levels[0]+("levelIndex" to 3))+levels.drop(1)))
|
||||
invalidFirst(rows[0]+("levels" to listOf(levels[0]+("aperture" to .2f))+levels.drop(1)))
|
||||
invalidFirst(rows[0]+("levels" to listOf(levels[0]+("path" to "../x.png"))+levels.drop(1)))
|
||||
invalidFirst(rows[0]+("levels" to listOf(levels[0]+("path" to levels[1]["path"]))+levels.drop(1)))
|
||||
invalidFirst(rows[0]+("width" to 129));invalidFirst(rows[0]+("x" to 479))
|
||||
check(read(root+("patches" to rows.map { it+mapOf("width" to 128,"height" to 128) }))==null) // total RGBA cache cap
|
||||
check(read(root+("packId" to "a01-neutral-graph-v1-runtime-03"))==null)
|
||||
checkContinuousRenderer(pack) // real driver's chosen texture AND opacity at every present, through wrap/abort/teardown
|
||||
println("PASS: runtime04 strict97x5 levels/hash/path/bounds, nearest aperture ties, zero bypass/nonzero opacity1, cross-schema rejection, actual renderer selection/render opacity through97frame loop and lifecycle; no atlas used")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user