Add Liam waiting poses with capture and playback fences
This commit is contained in:
@@ -266,6 +266,34 @@ if args.user_asset_candidate:
|
||||
startup_main=startup_main.replace('packages.size==5','packages.size=='+str(len(index['conversationPackages'])))
|
||||
startup_main=startup_main.replace('packages=5|bridge_mouths=8','packages='+str(len(index['conversationPackages']))+
|
||||
'|bridge_mouths='+str(sum('mouthRuntimeManifest' in e for e in index['edges'])))
|
||||
if args.user_asset_candidate and index.get('waiting'):
|
||||
# Use the actual APK's local waiting contract, not the old emotion-idle policy.
|
||||
header=main[:main.index(' run {')]
|
||||
dance=main[main.index(' for(initial in listOf('):main.index(' println("HOST_REPLAY|')]
|
||||
main=header+r'''
|
||||
for(pose in index.waiting!!.poses) {
|
||||
val(view,binding,trace)=rig();var finished=0;var failed=0
|
||||
binding.waitingListener { binding.waitingEligible(false);binding.playWaitingPose(it,{finished++},{failed++}) }
|
||||
binding.waitingEligible(true)
|
||||
val driver=view.javaClass.getDeclaredField("driver").apply { isAccessible=true }.get(view) as ConversationMediaDriver
|
||||
driver.javaClass.getDeclaredField("queuedPose").apply { isAccessible=true }.set(driver,pose)
|
||||
TestScheduler.until(15_000) { trace.lastOrNull()?.second?.actual=="pose_${pose.id}" }
|
||||
TestScheduler.until(15_000) { finished==1 || failed>0 }
|
||||
check(failed==0 && finished==1 && trace.none { it.second.actual=="media_failed" })
|
||||
val frames=trace.count { it.second.actual=="pose_${pose.id}" }
|
||||
check(frames==pose.clip.frameCount && MediaPlayer.created.isEmpty() && binding.currentPackageId==index.waiting!!.idlePackage)
|
||||
println("WAITING_POSE|id=${pose.id}|actual_composed_frames=$frames|music_players=0|return=${binding.currentPackageId}|owner=${driver.layerOwner}|device=false")
|
||||
var ready=0;binding.prepareTalk({ready++},{failed++});TestScheduler.advanceBy(50)
|
||||
check(ready==1 && failed==0)
|
||||
binding.intent(mediaReply(RoleEmotion.HAPPY),true);TestScheduler.advanceBy(1500)
|
||||
check(binding.currentPackageId==index.waiting!!.talkPackage && binding.selection?.selectedEmotion==RoleEmotion.HAPPY)
|
||||
binding.intent(null,false);binding.finishTalk();TestScheduler.advanceBy(1000)
|
||||
check(binding.currentPackageId==index.waiting!!.idlePackage)
|
||||
println("TALK_IDLE|requested=happy|actual=${binding.currentPackageId}|own_mouth=true|closed_to_wait=true|device=false")
|
||||
view.dispose();TestScheduler.advanceBy(100)
|
||||
}
|
||||
'''+dance+' println("HOST_REPLAY|waiting_contract=true|both_poses=true|actual_apk_bytes=true|native_device=false|record_stop_mock=true")\n}\n'
|
||||
main=main.replace(' index.actionPack?.assets?', ' index.waiting?.poses?.forEach { CodecFixture.timelines[index.root+it.clip.path]=it.clip.ptsUs }\n index.actionPack?.assets?')
|
||||
with tempfile.TemporaryDirectory(prefix='baji-runtime-audit-') as td:
|
||||
tmp=Path(td);files=[]
|
||||
for path in (ROOT/'tests/avatar').glob('*.kt'):
|
||||
|
||||
Reference in New Issue
Block a user