Add uniform Yangmi framing candidate for code37
This commit is contained in:
@@ -11,6 +11,8 @@ parser.add_argument('--sha256',required=True)
|
||||
parser.add_argument('--startup-loader',action='store_true',help='Production background repository over actual APK bytes, isolated private receipt, no rendering/connection')
|
||||
parser.add_argument('--user-asset-candidate',action='store_true',help='Exact user-authorized correct03 APK; this offline replay uses local media callback doubles and does not assert network admission')
|
||||
parser.add_argument('--media-bundle',default='black-correct03',help='Trusted user-debug bundle, when --user-asset-candidate is set')
|
||||
parser.add_argument('--framing-zoom',type=float,default=1)
|
||||
parser.add_argument('--framing-center-y',type=float,default=.5)
|
||||
args=parser.parse_args()
|
||||
assert hashlib.sha256(args.apk.read_bytes()).hexdigest()==args.sha256, 'APK hash drift'
|
||||
ROOT=Path(__file__).resolve().parents[1];script=ROOT/'scripts/check-reply-regressions.py'
|
||||
@@ -95,6 +97,8 @@ object BuildConfig { const val STARTUP_POSTER_RES_ID=1;const val AVATAR_STARTUP_
|
||||
const val EMOTION_MANIFEST_SHA="987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887"
|
||||
const val NATURAL_MANIFEST_SHA="0a3c4918ba746019cf1df885bec66e5858a8950997dac4f64e7d37094be64dad"
|
||||
}'''
|
||||
assert 1<=args.framing_zoom<=2 and .4<=args.framing_center_y<=.6
|
||||
build=build.replace('object BuildConfig {','object BuildConfig { const val AVATAR_FRAME_ZOOM='+str(args.framing_zoom)+'f;const val AVATAR_FRAME_CENTER_Y='+str(args.framing_center_y)+'f;')
|
||||
if args.user_asset_candidate:
|
||||
import importlib.util
|
||||
spec=importlib.util.spec_from_file_location('user_startup',ROOT/'scripts/prepare-user-avatar-startup.py');asset_config=importlib.util.module_from_spec(spec);spec.loader.exec_module(asset_config)
|
||||
@@ -219,6 +223,19 @@ fun main(args: Array<String>) {
|
||||
while(pack==null || base==null) { TestScheduler.advanceBy(0);check(System.nanoTime()<deadline);Thread.sleep(1) }
|
||||
}
|
||||
StartupAvatarRepository.request(context,{base=it},{pack=it.getOrThrow()});waitReady()
|
||||
if(base!!.body.width==720) {
|
||||
val poster=FramedAvatarPoster(context)
|
||||
for((w,h) in listOf(720 to 1280,360 to 800,800 to 480)) {
|
||||
poster.onSizeChanged(w,h,0,0)
|
||||
val zoom=com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_ZOOM
|
||||
val center=com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_CENTER_Y
|
||||
val fitted=bodyFit(w,h,180,320)
|
||||
val composed=bodyFit(w,h,720,1280,zoom,center)
|
||||
val displayedTop=h/2f+(fitted.top-h/2f)*poster.scaleY+poster.translationY
|
||||
check(poster.scaleX==zoom && poster.scaleY==zoom && kotlin.math.abs(displayedTop-composed.top)<.001f)
|
||||
}
|
||||
println("POSTER_FRAMING|viewports=3|matches_compositor=true|zoom=${com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_ZOOM}|center_y=${com.gorios.lanvoice.BuildConfig.AVATAR_FRAME_CENTER_Y}|device=false")
|
||||
}
|
||||
check(base!!.body.frameCount==97 && base!!.patches.isEmpty() && base!!.curves.isEmpty())
|
||||
check(pack!!.emotionAdmission=="accepted" && pack!!.emotionAction!!.packages.size==5)
|
||||
val patchReads=android.content.Archive.reads.count { it.contains("/patches/") }
|
||||
|
||||
Reference in New Issue
Block a user