Integrate reviewed full action pack admission and bounded idle scheduling

This commit is contained in:
zenord
2026-10-13 07:19:34 +08:00
parent 97f87e2409
commit f0620ddd65
21 changed files with 285 additions and 75 deletions
+5 -5
View File
@@ -14,7 +14,7 @@ fun fullActionGraphCheck() {
val rows=bodies.map { (id,body)->mapOf<String,Any?>("id" to id,
"emotion" to if(id.startsWith("idle")) "neutral" else id,"visualIntensity" to if(id in setOf("happy","sad")) 1 else 0,
"mouthBodySha256" to body.body.sha256,"runtimeManifest" to mapOf("path" to "$id/manifest.json","sha256" to body.manifestSha),
"entryAnchor" to "A","exitAnchor" to "A","legalExitFrames" to listOf(body.body.frameCount-1),"loopEdge" to "$id-loop") }
"entryAnchor" to "A","exitAnchor" to "A","legalExitFrames" to if(id=="neutral") listOf(0,96) else listOf(body.body.frameCount-1),"loopEdge" to "$id-loop") }
val mouths=linkedMapOf<String,ContinuousAvatarPack>()
val loops=bodies.map { (id,body)->mapOf<String,Any?>("id" to "$id-loop","from" to id,"to" to id,
"fromFrame" to body.body.frameCount-1,"fromPtsUs" to body.body.ptsUs.last(),"toFrame" to 0,"toPtsUs" to 0L,
@@ -30,8 +30,8 @@ fun fullActionGraphCheck() {
val dance=dynamicPack(241,24,"f".repeat(64))
val actions=listOf("asset_01","asset_02").map { id->mapOf<String,Any?>("id" to id,"kind" to "dance",
"mouthAllowed" to false,"disallowTALK" to true,"entryAnchor" to "A","returnAnchor" to "A",
"sourcePackageId" to "neutral","sourceFrame" to 96,"sourcePtsUs" to 4_000_000L,
"returnPackageId" to "neutral","returnFrame" to 0,"returnPtsUs" to 0L,
"sourcePackageId" to "neutral","sourceFrame" to 0,"sourcePtsUs" to 0L,
"returnPackageId" to "neutral","returnFrame" to 96,"returnPtsUs" to 4_000_000L,
"clip" to clip(dance,"$id.mp4",true),"audioEndUs" to 10_000_000L) }
val root=mapOf<String,Any?>("schemaVersion" to 2,"identityId" to "a01","packId" to "a01-expression-action-v1",
"fallbackPackageId" to "neutral","conversationPackages" to rows,"edges" to loops+bridges,"actions" to actions)
@@ -44,7 +44,7 @@ fun fullActionGraphCheck() {
check(index.actionPack?.assets?.size==2 && index.actionPack.assets.all { it.media?.ptsUs?.size==241 });assertions++
val bytes=index.packages.values.sumOf { it.rgbaBytes }+index.edges.mapNotNull { it.mouthRuntime }.sumOf { it.rgbaBytes }
check(bytes==bodies.values.sumOf { it.rgbaBytes }+mouths.values.sumOf { it.rgbaBytes } && bytes<=BodyTimeline.MAX_PACK_CACHE_BYTES);assertions++
for(change in listOf(mapOf("sourceFrame" to 0),mapOf("sourcePtsUs" to 0L),mapOf("returnPtsUs" to 1L),
for(change in listOf(mapOf("sourceFrame" to 95),mapOf("sourcePtsUs" to 1L),mapOf("returnPtsUs" to 1L),
mapOf("sourcePackageId" to "idle-breathe"),mapOf("returnPackageId" to "idle-shift"))) {
check(read(root+("actions" to listOf(actions[0]+change,actions[1])))==null);assertions++
}
@@ -54,5 +54,5 @@ fun fullActionGraphCheck() {
}
val inflated=bodies.mapValues { (_,body)->body.copy(patches=body.patches.map { it.copy(width=80,height=44) }) }
check(inflated.values.all { it.rgbaBytes<=BodyTimeline.MAX_RGBA_BYTES } && read(bodyData=inflated)==null);assertions++
println("PASS: $assertions full5-body/13-edge/8-own-bridge/two241-frame-action parser assertions; RGBA=$bytes bytes, source96/4s/return binding and total-cache rejection; fixtures only")
println("PASS: $assertions full5-body/13-edge/8-own-bridge/two241-frame-action parser assertions; RGBA=$bytes bytes, source0/return96/4s binding and total-cache rejection; fixtures only")
}