mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-17 15:03:25 +09:00
[Docs] (P12): the on-screen server window's plan, audit, harness and device evidence move into the tree, and the status page says what this line is and what it still owes - CURRENT_STAGE_STATUS records that the P12 subset is implemented but NOT handed off (both exit gates unrun: no cross-machine TCP, no FCL + kill-server device-lost), the ROADMAP P12 row stops reading "待排", and notes/p12 carries the brief, the four read-only audits, the gate and device harness, and the curated device evidence (check transcripts, replay verdicts, on-screen captures; logcat left out per notes/README.md's evidence-data rule)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# build.sh <sha>: the window-2 builder (10-build.sh) on a detached tree of the P12 package tree.
|
||||
#
|
||||
# 10-build.sh would create the tree with `git -C ~/w7/pipe worktree add` and copy submodules from
|
||||
# pipe, and falls back to `git lfs pull` for pointer fixtures. The P12 rules forbid touching pipe
|
||||
# and pulling LFS, so the tree is prepared HERE, from the package tree (same object store): the
|
||||
# detached worktree, its submodules and glslang External copied from the package tree's copies
|
||||
# (the p12 branch moves no gitlink), and the hydrated fixtures copied + assume-unchanged. Then
|
||||
# 10-build.sh runs with W2_PIPE=<package tree>, finds everything in place and only builds.
|
||||
set -euo pipefail
|
||||
PKG=/home/swung/w7/p12-onscreen
|
||||
SHA=$(git -C "$PKG" rev-parse --verify "$1^{commit}")
|
||||
SHA8=${SHA:0:8}
|
||||
STAMP=${2:-p12w1-$SHA8}
|
||||
TREE=$HOME/w7/p7w7-tree-$SHA8
|
||||
if [ ! -e "$TREE/.git" ]; then
|
||||
git -C "$PKG" worktree add --detach "$TREE" "$SHA"
|
||||
fi
|
||||
[ "$(git -C "$TREE" rev-parse HEAD)" = "$SHA" ] || { echo "tree $TREE not at $SHA"; exit 1; }
|
||||
for path in $(git -C "$TREE" submodule status | awk '{print $2}'); do
|
||||
want=$(git -C "$TREE" ls-tree HEAD "$path" | awk '{print $3}')
|
||||
base=$(git -C "$PKG" ls-tree HEAD "$path" | awk '{print $3}')
|
||||
[ "$want" = "$base" ] || { echo "gitlink $path differs from the package tree's ($want vs $base)"; exit 1; }
|
||||
if [ -z "$(ls -A "$TREE/$path" 2>/dev/null)" ]; then
|
||||
rm -rf "$TREE/$path"
|
||||
cp -a "$PKG/$path" "$TREE/$path"
|
||||
rm -f "$TREE/$path/.git"
|
||||
echo "submodule $path copied from the package tree ($want)"
|
||||
fi
|
||||
done
|
||||
[ -d "$TREE/3rdparty/glslang/External/spirv-tools" ] || cp -a "$PKG/3rdparty/glslang/External" "$TREE/3rdparty/glslang/"
|
||||
git -C "$TREE" ls-files -z tools/trace_replay/fixtures | while IFS= read -r -d "" f; do
|
||||
if head -c 40 "$TREE/$f" 2>/dev/null | grep -q git-lfs && ! head -c 40 "$PKG/$f" | grep -q git-lfs; then
|
||||
cp "$PKG/$f" "$TREE/$f"
|
||||
fi
|
||||
done
|
||||
git -C "$TREE" ls-files -z tools/trace_replay/fixtures | xargs -0 -r git -C "$TREE" update-index --assume-unchanged
|
||||
if head -c 40 "$TREE/tools/trace_replay/fixtures/openra.tgz" | grep -q git-lfs; then
|
||||
echo "openra.tgz is still an LFS pointer - refusing (no git lfs pull)"; exit 1
|
||||
fi
|
||||
echo "tree ready: $TREE @ $SHA8, stamp $STAMP"
|
||||
W2_PIPE=$PKG bash /home/swung/w7/notes/p7/window2/10-build.sh "$SHA" "$STAMP"
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# Device check 1 (and 2 with BACKEND=DirectVulkan): on-screen replay through the display Activity.
|
||||
# STAMP=p12w1-<sha8> [BACKEND=DirectGLES|DirectVulkan] [CASE=OpenRA] bash check1.sh
|
||||
. "$(dirname "$0")/dev.sh"
|
||||
BACKEND=${BACKEND:-DirectGLES}
|
||||
CASE=${CASE:-OpenRA}
|
||||
CHECK_NAME=${CHECK_NAME:-$([ "$BACKEND" = DirectVulkan ] && echo 2-onscreen-magma || echo 1-onscreen-espryt)}
|
||||
OUT=$DEV/$CHECK_NAME
|
||||
rm -rf "$OUT"; mkdir -p "$OUT"
|
||||
{
|
||||
log "check $CHECK_NAME: stamp $STAMP backend $BACKEND case $CASE"
|
||||
log "found: $(ps_mobilegl | tr '\n' ';')"
|
||||
force_stop; sleep 1
|
||||
wake
|
||||
T0=$(devtime); echo "$T0" > "$OUT/devtime0"
|
||||
PIN=(); [ "$BACKEND" = DirectVulkan ] && PIN=(--backend DirectVulkan)
|
||||
tds start --surface window --forward "${PIN[@]}" > "$OUT/tds-start.txt" 2>&1; cat "$OUT/tds-start.txt"
|
||||
if wait_logcat "$T0" 'listening on tcp://127\.0\.0\.1:40613 \(in-process display server, display installed\)' 30; then
|
||||
log "READY"
|
||||
else
|
||||
log "NOT READY within 30 s"
|
||||
fi
|
||||
WIN=$(pid_of "$PKG:mglwin"); log ":mglwin pid=$WIN"; echo "$WIN" > "$OUT/mglwin.pid"
|
||||
Ash dumpsys window | grep -E "mCurrentFocus|mFocusedApp" | head -2
|
||||
log "replay $CASE $BACKEND --window-surface MOBILEGL_IPC_SURFACE=server"
|
||||
replay_with_shots "$OUT/replay" "$CASE" "$BACKEND" window MOBILEGL_IPC_SURFACE=server
|
||||
log "replay rc=$?"
|
||||
result_summary "$OUT/replay"
|
||||
shot_report "$OUT/replay"
|
||||
log ":mglwin pid after: $(pid_of "$PKG:mglwin")"
|
||||
if [ -n "${SECOND_CASE:-}" ]; then
|
||||
log "a second $BACKEND session in the same process: $SECOND_CASE on-screen"
|
||||
replay_with_shots "$OUT/second" "$SECOND_CASE" "$BACKEND" window MOBILEGL_IPC_SURFACE=server
|
||||
log "second session rc=$?"
|
||||
result_summary "$OUT/second"
|
||||
shot_report "$OUT/second" | tail -2
|
||||
log ":mglwin pid after the second session: $(pid_of "$PKG:mglwin")"
|
||||
fi
|
||||
logcat_since "$T0" > "$OUT/logcat.txt"
|
||||
mglines "$OUT/logcat.txt" | head -60
|
||||
A shell run-as "$PKG" cat files/mglwin.server.log > "$OUT/mglwin.server.log" 2>&1
|
||||
log "done $CHECK_NAME"
|
||||
} 2>&1 | tee "$OUT/check.log"
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# Device check 3: two sequential on-screen sessions in ONE display-Activity process (the second
|
||||
# works), and a second concurrent authenticated client is refused Busy. Runs on the Activity check 1
|
||||
# left serving (it re-checks the pid).
|
||||
# STAMP=p12w1-<sha8> [LONG_CASE=...] bash check3.sh
|
||||
. "$(dirname "$0")/dev.sh"
|
||||
OUT=$DEV/3-sequential-and-busy
|
||||
LONG_CASE=${LONG_CASE:-minecraft-1.21.4-startup}
|
||||
rm -rf "$OUT"; mkdir -p "$OUT"
|
||||
{
|
||||
PREV=$(cat "$DEV/1-onscreen-espryt/mglwin.pid" 2>/dev/null)
|
||||
WIN=$(pid_of "$PKG:mglwin")
|
||||
log ":mglwin pid now=$WIN (check 1's session ran in pid=$PREV)"
|
||||
[ -n "$WIN" ] || { log "no display Activity process - run check1.sh first"; exit 1; }
|
||||
wake
|
||||
T0=$(devtime); echo "$T0" > "$OUT/devtime0"
|
||||
|
||||
log "=== session 2 in the same process: OpenRA on-screen"
|
||||
replay_with_shots "$OUT/second" OpenRA DirectGLES window MOBILEGL_IPC_SURFACE=server
|
||||
log "second session rc=$?"
|
||||
result_summary "$OUT/second"
|
||||
shot_report "$OUT/second" | tail -2
|
||||
log "Welcome server pids seen by the two clients (check 1, this one):"
|
||||
grep -ho "control=tcp data=stream server=[^ ]* pid=[0-9]*" "$DEV/1-onscreen-espryt/replay/output/mobilegl.client.log" "$OUT/second/output/mobilegl.client.log" | sort | uniq -c
|
||||
|
||||
log "=== Busy: a long on-screen session ($LONG_CASE), then a second authenticated client"
|
||||
T1=$(devtime)
|
||||
mkdir -p "$OUT/long"; : > "$OUT/long/shots.tsv"
|
||||
replay "$OUT/long" "$LONG_CASE" DirectGLES window MOBILEGL_IPC_SURFACE=server &
|
||||
LONG=$!
|
||||
shots "$OUT/long" $LONG &
|
||||
SHOOTER=$!
|
||||
if wait_logcat "$T1" 'owner=server' 60; then log "long session is on screen"; else log "long session never reached surface=window"; fi
|
||||
sleep 2
|
||||
kill -0 $LONG 2>/dev/null && log "long session still live - starting the second client" || log "WARNING: the long session already ended"
|
||||
replay "$OUT/concurrent" OpenRA DirectGLES window MOBILEGL_IPC_SURFACE=server
|
||||
log "concurrent client rc=$?"
|
||||
grep -hiE "busy|refuse" "$OUT/concurrent/replay.log" "$OUT/concurrent/output/"mobilegl*.log 2>/dev/null | cut -c1-260 | sort | uniq -c | head
|
||||
wait $LONG; log "long session rc=$?"
|
||||
wait $SHOOTER 2>/dev/null
|
||||
result_summary "$OUT/long"
|
||||
shot_report "$OUT/long" | tail -3
|
||||
log ":mglwin pid after: $(pid_of "$PKG:mglwin")"
|
||||
logcat_since "$T0" > "$OUT/logcat.txt"
|
||||
mglines "$OUT/logcat.txt" | grep -E "MobileGLDisplay|in-process session|Busy|owner=server|surface=window|listening" | head -60
|
||||
log "done 3"
|
||||
} 2>&1 | tee "$OUT/check.log"
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
# Device check 4: HOME during an on-screen replay. The session must end with the named
|
||||
# ServerWindowLost latch, :mglwin must survive, the client must read a clean device loss; bringing
|
||||
# the Activity back must let the next session render.
|
||||
# STAMP=p12w1-<sha8> [LONG_CASE=...] bash check4.sh
|
||||
. "$(dirname "$0")/dev.sh"
|
||||
OUT=$DEV/4-window-lost
|
||||
LONG_CASE=${LONG_CASE:-minecraft-1.21.4-startup}
|
||||
rm -rf "$OUT"; mkdir -p "$OUT"
|
||||
{
|
||||
WIN=$(pid_of "$PKG:mglwin")
|
||||
log ":mglwin pid before=$WIN"
|
||||
[ -n "$WIN" ] || { log "no display Activity process - run check1.sh first"; exit 1; }
|
||||
wake
|
||||
T0=$(devtime); echo "$T0" > "$OUT/devtime0"
|
||||
mkdir -p "$OUT/lost"; : > "$OUT/lost/shots.tsv"
|
||||
replay "$OUT/lost" "$LONG_CASE" DirectGLES window MOBILEGL_IPC_SURFACE=server &
|
||||
LONG=$!
|
||||
shots "$OUT/lost" $LONG &
|
||||
SHOOTER=$!
|
||||
if wait_logcat "$T0" 'owner=server' 60; then log "session is on screen"; else log "session never reached surface=window"; fi
|
||||
sleep 3
|
||||
kill -0 $LONG 2>/dev/null && log "session live - pressing HOME" || log "WARNING: the session already ended before HOME"
|
||||
date +%s.%N > "$OUT/lost/t-home"
|
||||
Ash input keyevent KEYCODE_HOME
|
||||
wait $LONG; RC=$?
|
||||
wait $SHOOTER 2>/dev/null
|
||||
log "client rc=$RC after HOME ($(python3 -c "print(round($(cat "$OUT/lost/t1")-$(cat "$OUT/lost/t-home"),2))") s after the key)"
|
||||
result_summary "$OUT/lost"
|
||||
grep -hiE "ServerWindowLost|device.lost|ServerCrashed|SessionFault|latched" "$OUT/lost/replay.log" "$OUT/lost/output/"mobilegl*.log 2>/dev/null | cut -c1-260 | sort | uniq -c | head -12
|
||||
sleep 2
|
||||
WIN2=$(pid_of "$PKG:mglwin")
|
||||
log ":mglwin pid after HOME=$WIN2 (before=$WIN): $([ "$WIN" = "$WIN2" ] && echo SURVIVED || echo CHANGED)"
|
||||
logcat_since "$T0" > "$OUT/logcat-lost.txt"
|
||||
mglines "$OUT/logcat-lost.txt" | grep -E "surfaceDestroyed|ServerWindowLost|in-process session|detached|reaped|latch" | head -20
|
||||
|
||||
log "=== bring the Activity back, then a new on-screen session"
|
||||
T1=$(devtime)
|
||||
wake
|
||||
tds start --surface window > "$OUT/tds-restart.txt" 2>&1
|
||||
if wait_logcat "$T1" 'surfaceCreated: server window' 20; then log "window re-attached"; else log "no surfaceCreated within 20 s"; fi
|
||||
Ash dumpsys window | grep -E "mCurrentFocus|mFocusedApp" | head -2
|
||||
replay_with_shots "$OUT/after" OpenRA DirectGLES window MOBILEGL_IPC_SURFACE=server
|
||||
log "after-return session rc=$?"
|
||||
result_summary "$OUT/after"
|
||||
shot_report "$OUT/after" | tail -2
|
||||
log ":mglwin pid at the end=$(pid_of "$PKG:mglwin")"
|
||||
logcat_since "$T0" > "$OUT/logcat.txt"
|
||||
mglines "$OUT/logcat.txt" | grep -E "MobileGLDisplay|in-process session|ServerWindowLost|owner=server|window .* (attached|detached)" | head -40
|
||||
A shell run-as "$PKG" cat files/mglwin.server.log > "$OUT/mglwin.server.log" 2>&1
|
||||
log "done 4"
|
||||
} 2>&1 | tee "$OUT/check.log"
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
# Device checks 5 and 6 (and 7b): the offscreen service.
|
||||
# 5 start MobileGLServerService while the display Activity runs -> :mglwin is gone; the same
|
||||
# fixture WITHOUT the knob replays as before (ssim), server log surface=pbuffer.
|
||||
# 6 MOBILEGL_IPC_SURFACE=server against it -> refused by name on both sides; the service still
|
||||
# serves the next (offscreen) session.
|
||||
# STAMP=p12w1-<sha8> bash check5.sh
|
||||
. "$(dirname "$0")/dev.sh"
|
||||
OUT=$DEV/5-offscreen-service
|
||||
OUT6=$DEV/6-negative-serverowned-vs-offscreen
|
||||
rm -rf "$OUT" "$OUT6"; mkdir -p "$OUT" "$OUT6"
|
||||
{
|
||||
WIN=$(pid_of "$PKG:mglwin")
|
||||
log "before: :mglwin pid=${WIN:-none}"
|
||||
ps_mobilegl
|
||||
wake
|
||||
T0=$(devtime); echo "$T0" > "$OUT/devtime0"
|
||||
tds start --forward > "$OUT/tds-start.txt" 2>&1; cat "$OUT/tds-start.txt"
|
||||
if wait_logcat "$T0" 'listening on tcp://127\.0\.0\.1:40613' 30; then log "supervisor READY"; else log "supervisor NOT READY"; fi
|
||||
sleep 1
|
||||
log "after: :mglwin pid=$(pid_of "$PKG:mglwin" || true) (was ${WIN:-none})"
|
||||
ps_mobilegl | tee "$OUT/ps-after-start.txt"
|
||||
logcat_since "$T0" > "$OUT/logcat-start.txt"; mglines "$OUT/logcat-start.txt" | head -20
|
||||
|
||||
log "=== 5: offscreen replay, no knob"
|
||||
replay "$OUT/offscreen" OpenRA DirectGLES pbuffer
|
||||
log "offscreen rc=$?"
|
||||
result_summary "$OUT/offscreen"
|
||||
logcat_since "$T0" > "$OUT/logcat.txt"
|
||||
log "done 5"
|
||||
} 2>&1 | tee "$OUT/check.log"
|
||||
{
|
||||
T0=$(devtime); echo "$T0" > "$OUT6/devtime0"
|
||||
log "=== 6: MOBILEGL_IPC_SURFACE=server --window-surface against the offscreen service"
|
||||
replay "$OUT6/refused" OpenRA DirectGLES window MOBILEGL_IPC_SURFACE=server
|
||||
log "refused client rc=$?"
|
||||
result_summary "$OUT6/refused"
|
||||
grep -hE "NoServerDisplay|owns no display|EGL window surface creation failed|SurfaceRefusal|Refuse ServerOwned" \
|
||||
"$OUT6/refused/replay.log" "$OUT6/refused/output/"mobilegl*.log 2>/dev/null | cut -c1-300 | sort | uniq -c | head
|
||||
log "=== 6: the next offscreen session on the same service"
|
||||
replay "$OUT6/next" OpenRA DirectGLES pbuffer
|
||||
log "next offscreen rc=$?"
|
||||
result_summary "$OUT6/next"
|
||||
ps_mobilegl | tee "$OUT6/ps-end.txt"
|
||||
logcat_since "$T0" > "$OUT6/logcat.txt"
|
||||
mglines "$OUT6/logcat.txt" | grep -E "listening|reaped|Refuse|no display|surface=" | head -20
|
||||
log "done 6"
|
||||
} 2>&1 | tee "$OUT6/check.log"
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# Device check 7: only one server active.
|
||||
# 7a the offscreen service runs with a LIVE session child; starting the display Activity stops
|
||||
# the service - the supervisor goes, and its session child with it (PR_SET_PDEATHSIG) - and the
|
||||
# Activity's server takes the port (listen retry).
|
||||
# 7b starting the service kills :mglwin (also recorded by check 5).
|
||||
# STAMP=p12w1-<sha8> [LONG_CASE=...] bash check7.sh
|
||||
. "$(dirname "$0")/dev.sh"
|
||||
OUT=$DEV/7-one-server
|
||||
LONG_CASE=${LONG_CASE:-minecraft-1.21.4-startup}
|
||||
rm -rf "$OUT"; mkdir -p "$OUT"
|
||||
{
|
||||
wake
|
||||
T0=$(devtime); echo "$T0" > "$OUT/devtime0"
|
||||
if [ -z "$(Ash "ps -A -o ARGS" | grep "libMobileGLServer.so $LISTEN --serve")" ]; then
|
||||
log "no supervisor running - starting the service"
|
||||
tds start --forward > "$OUT/tds-service.txt" 2>&1
|
||||
wait_logcat "$T0" 'listening on tcp://127\.0\.0\.1:40613' 30 || log "supervisor NOT READY"
|
||||
fi
|
||||
log "=== 7a: a live offscreen session, then the display Activity"
|
||||
T1=$(devtime)
|
||||
replay "$OUT/victim" "$LONG_CASE" DirectGLES pbuffer &
|
||||
VICTIM=$!
|
||||
if wait_logcat "$T1" 'surface=pbuffer' 60; then log "offscreen session live"; else log "offscreen session never reached surface=pbuffer"; fi
|
||||
sleep 1
|
||||
ps_mobilegl | tee "$OUT/ps-before.txt"
|
||||
SUP=$(Ash "ps -A -o PID,ARGS" | grep "libMobileGLServer.so $LISTEN --serve" | grep -v grep | awk '{print $1}' | head -1)
|
||||
CHILD=$(Ash "ps -A -o PID,PPID,NAME" | awk -v p="$SUP" '$2==p && $3 ~ /libMobileGLServer/ {print $1}' | head -1)
|
||||
log "supervisor pid=$SUP session child pid=${CHILD:-none}"
|
||||
T2=$(devtime)
|
||||
tds start --surface window > "$OUT/tds-activity.txt" 2>&1; cat "$OUT/tds-activity.txt"
|
||||
if wait_logcat "$T2" 'listening on tcp://127\.0\.0\.1:40613 \(in-process display server, display installed\)' 30; then
|
||||
log "display server READY"
|
||||
else
|
||||
log "display server NOT READY"
|
||||
fi
|
||||
sleep 1
|
||||
log "supervisor $SUP alive? $(Ash "[ -d /proc/$SUP ] && echo yes || echo no") child ${CHILD:-none} alive? $([ -n "$CHILD" ] && Ash "[ -d /proc/$CHILD ] && echo yes || echo no")"
|
||||
ps_mobilegl | tee "$OUT/ps-after-activity.txt"
|
||||
wait $VICTIM; log "the offscreen session's client rc=$? (its server went away)"
|
||||
grep -hiE "device.lost|ServerCrashed|hung up|PeerHungUp|EOF|lost" "$OUT/victim/replay.log" "$OUT/victim/output/"mobilegl.client.log 2>/dev/null | cut -c1-240 | sort | uniq -c | head -8
|
||||
logcat_since "$T2" > "$OUT/logcat-7a.txt"; mglines "$OUT/logcat-7a.txt" | grep -vE "pre-auth deadline" | head -24
|
||||
|
||||
log "=== 7b: the service again - :mglwin must go"
|
||||
WIN=$(pid_of "$PKG:mglwin"); log ":mglwin pid=$WIN"
|
||||
T3=$(devtime)
|
||||
tds start > "$OUT/tds-service2.txt" 2>&1
|
||||
wait_logcat "$T3" 'listening on tcp://127\.0\.0\.1:40613' 30 && log "supervisor READY" || log "supervisor NOT READY"
|
||||
sleep 1
|
||||
log ":mglwin pid now=$(pid_of "$PKG:mglwin") (was $WIN); /proc/$WIN exists? $(Ash "[ -d /proc/$WIN ] && echo yes || echo no")"
|
||||
ps_mobilegl | tee "$OUT/ps-after-service.txt"
|
||||
logcat_since "$T3" > "$OUT/logcat-7b.txt"; mglines "$OUT/logcat-7b.txt" | head -16
|
||||
logcat_since "$T0" > "$OUT/logcat.txt"
|
||||
log "done 7"
|
||||
} 2>&1 | tee "$OUT/check.log"
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# Leaves the phone clean: both servers stopped (am force-stop), the new APK kept, the adb forward
|
||||
# this stage added removed, the Doze whitelist and stay-on setting left as found (never touched).
|
||||
# STAMP=p12w1-<sha8> bash cleanup.sh
|
||||
. "$(dirname "$0")/dev.sh"
|
||||
OUT=$DEV/99-cleanup
|
||||
mkdir -p "$OUT"
|
||||
{
|
||||
force_stop
|
||||
A forward --remove tcp:40613 2>/dev/null || true
|
||||
Ash input keyevent KEYCODE_HOME
|
||||
sleep 1
|
||||
echo "processes : $(ps_mobilegl | tr '\n' ';')"
|
||||
echo "forwards : $(A forward --list | tr '\n' ';')"
|
||||
echo "doze wl : $(Ash 'dumpsys deviceidle whitelist' | grep -i mobilegl | tr '\n' ' ')"
|
||||
echo "stay_on : $(Ash 'settings get global stay_on_while_plugged_in')"
|
||||
echo "focus : $(Ash 'dumpsys window' | grep -m1 mCurrentFocus | tr -s ' ')"
|
||||
echo "installed : $(Ash "dumpsys package $PKG" | grep -E 'versionName|lastUpdateTime' | tr -s ' ' | tr '\n' ' ')"
|
||||
} 2>&1 | tee "$OUT/final-state.txt"
|
||||
@@ -0,0 +1,37 @@
|
||||
diff --git a/MobileGL/MG_Impl/Pipe/PipeFill.cpp b/MobileGL/MG_Impl/Pipe/PipeFill.cpp
|
||||
index 3fb7278c..ea80cba2 100644
|
||||
--- a/MobileGL/MG_Impl/Pipe/PipeFill.cpp
|
||||
+++ b/MobileGL/MG_Impl/Pipe/PipeFill.cpp
|
||||
@@ -1112,7 +1112,14 @@ namespace MobileGL::MG_Pipe {
|
||||
// below and this aborts by name on the first glBufferData that carries data.
|
||||
const Uint64 before = MG_Remote::Client::ClientWireRecordsEmitted();
|
||||
MGPipeEmitResourceSubData(buffer, 0, static_cast<SizeT>(buffer.GetSize()));
|
||||
- if (MG_Remote::Client::ClientWireRecordsEmitted() == before) {
|
||||
+ // EXCEPT ON A LOST DEVICE (P12). Once the session latched device-lost every verb is
|
||||
+ // DECLINED by design (CONTRACT-P6 5.3) - the resource_subdata above included - so "it
|
||||
+ // emitted nothing" is the latch working, not bytes this client forgot to carry: there
|
||||
+ // is no server left for them to exist on. Aborting here turned every clean device loss
|
||||
+ // (a killed server; the on-screen server's window destroyed under the session) into a
|
||||
+ // client SIGABRT at its next glBufferData with data.
|
||||
+ if (MG_Remote::Client::ClientWireRecordsEmitted() == before &&
|
||||
+ !MG_Remote::Client::ClientSession::DeviceLost()) {
|
||||
// UncarriedInitialBytes, not a second word for the same family: WireTables.cpp:418
|
||||
// already dies of exactly this - a respecify that crossed with no initial bytes -
|
||||
// under that name, and two words for one family is the vocabulary drift a6
|
||||
diff --git a/MobileGL/MG_Remote/Client/EmitTables.cpp b/MobileGL/MG_Remote/Client/EmitTables.cpp
|
||||
index fc14e81a..6472e1d6 100644
|
||||
--- a/MobileGL/MG_Remote/Client/EmitTables.cpp
|
||||
+++ b/MobileGL/MG_Remote/Client/EmitTables.cpp
|
||||
@@ -1577,6 +1577,12 @@ namespace MobileGL::MG_Remote::Client {
|
||||
Uint64 replyBytes = 0;
|
||||
session.EmitAndWait(op, payload, bytes, nullptr, 0, &result, sizeof(result),
|
||||
&status, &replyBytes);
|
||||
+ // A LOST DEVICE ANSWERS AS A RESET CONTEXT DOES (P12). After the latch every verb is
|
||||
+ // DECLINED (CONTRACT-P6 5.3), so there is no reply to read - and GL's reset rule is
|
||||
+ // that sync waits then return at once as signaled (ClientWaitSync ALREADY_SIGNALED,
|
||||
+ // the status SIGNALED), not that the client dies of a "malformed" reply.
|
||||
+ if (status != Wire::ReplySink::kStatusOk && ClientSession::DeviceLost())
|
||||
+ return op == MG_Pipe::MGPWireOp::FenceWait ? static_cast<Uint32>(GL_ALREADY_SIGNALED) : 1u;
|
||||
if (status != Wire::ReplySink::kStatusOk || replyBytes != sizeof(result))
|
||||
Wire::WireProtocolFatal("Fence.reply", "missing or malformed sync result");
|
||||
return result;
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd /home/swung/w7/p12-onscreen
|
||||
git add MobileGL/MG_Remote/Server/DisplayServerJni.cpp CMakeLists.txt
|
||||
git commit -q -m "[MG_Remote] (P12): the in-process display server's JNI - install the display with ANativeWindow hooks and a JVM-attached geometry up-call, serve/stop on a Java thread, attach from surfaceCreated/Changed and a blocking detach from surfaceDestroyed (Android split build only)"
|
||||
git add android-plugin/app/src/trace/AndroidManifest.xml \
|
||||
android-plugin/app/src/trace/java/top/mobilegl/plugin/MobileGLDisplayActivity.java \
|
||||
android-plugin/app/src/trace/java/top/mobilegl/plugin/ServerEnvironment.java \
|
||||
android-plugin/app/src/trace/java/top/mobilegl/plugin/MobileGLServerService.java \
|
||||
tools/trace_replay/ServerEnvironmentTest.java tools/trace_replay/test_android_lifecycle.py
|
||||
git commit -q -m "[android-plugin, tools] (P12): MobileGLDisplayActivity - the on-screen display server in :mglwin (software window, fullscreen SurfaceView, aspect-fit geometry, env applied before the library loads), one shared server environment with MobileGLServerService, and one server at a time (the Activity stops the service, the service kills :mglwin)"
|
||||
git add tools/trace_replay/tcp_device_server.py scripts/ci/tcp_lane_tools_test.py
|
||||
git commit -q -m "[tools, scripts] (P12): tcp_device_server.py --surface window|pbuffer (default pbuffer, unchanged) starts the on-screen display Activity on a lit screen, and --backend pins either server"
|
||||
git log --oneline -4
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd /home/swung/w7/p12-onscreen
|
||||
git add MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp MobileGL/MG_Backend/DirectGLES/Managers.cpp \
|
||||
MobileGL/MG_Backend/DirectGLES/Managers.h MobileGL/MG_Test/SanityTest.cpp
|
||||
git commit -q -m "[MG_Backend, MG_Test] (P12): the server backend's destruction drops every Espryt twin under a transport, so the in-process display server's next session no longer adopts the ended session's programs, VAOs and buffers (split build only; the pull build is unchanged, G1)"
|
||||
git add MobileGL/MG_Remote/Server/DisplayServerJni.cpp
|
||||
git commit -q -m "[MG_Remote] (P12): the display geometry up-call attaches the apply thread to the JVM under its own name, so the rest of the session is not logged as the up-call's thread"
|
||||
git log --oneline -3
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd /home/swung/w7/p12-onscreen
|
||||
git add MobileGL/MG_Remote/Server/ServerMain.cpp
|
||||
git commit -q -m "[MG_Remote] (P12): the in-process pin line names the pin it records - MOBILEGL_BACKEND_TYPE when the environment set it, the first session's otherwise"
|
||||
git add android-plugin/app/src/trace/java/top/mobilegl/plugin/MobileGLServerService.java
|
||||
git commit -q -m "[android-plugin] (P12): MobileGLServerService logs its supervisor's closed output as the service stopping, not as a failure with a stack trace, when the display Activity stops it"
|
||||
git add tools/trace_replay/README.md
|
||||
git commit -q -m "[tools] (P12): trace_replay README - the two device servers, tcp_device_server.py --surface window, and the headless client's MOBILEGL_IPC_SURFACE=server --window-surface replay"
|
||||
git log --oneline -3
|
||||
git status --short | grep -v '^??' || true
|
||||
@@ -0,0 +1,163 @@
|
||||
# P12 android stage - device check helpers. Sourced, never run. Needs STAMP (p12w1-<sha8>).
|
||||
# Every script that sources this re-runs itself under the shared device lock (flock -o, like
|
||||
# window-2's lib.sh), so nothing it leaves running keeps the phone locked.
|
||||
SERIAL=2f7cbe2e
|
||||
PKG=top.mobilegl.plugin.p7w1.trace
|
||||
TOKEN=p7w1b-lan-token-20260922 # >= 16 bytes
|
||||
LISTEN=tcp://127.0.0.1:40613 # loopback on the phone, reached through adb forward
|
||||
ENDPOINT=tcp://127.0.0.1:40613
|
||||
: "${STAMP:?set STAMP=p12w1-<sha8>}"
|
||||
BUILD_OUT=$HOME/w7/logs/p7w7/$STAMP
|
||||
HOST=$BUILD_OUT/host
|
||||
BUILD_TREE=$(. "$BUILD_OUT/build.env"; echo "$BUILD_TREE")
|
||||
FIX=$BUILD_TREE/tools/trace_replay/fixtures
|
||||
DEV=$HOME/w7/logs/p12/device
|
||||
LOCK=$HOME/w7/locks/$SERIAL.lock
|
||||
|
||||
if [ "${P12_LOCK_HELD:-}" != 1 ]; then
|
||||
export P12_LOCK_HELD=1
|
||||
exec flock -o -w 3600 "$LOCK" bash "$0" "$@"
|
||||
fi
|
||||
|
||||
A() { adb -s "$SERIAL" "$@"; }
|
||||
Ash() { adb -s "$SERIAL" shell "$@" | tr -d '\r'; }
|
||||
log() { printf '[%s] %s\n' "$(date +%T)" "$*"; }
|
||||
devtime() { Ash "date +'%m-%d %H:%M:%S.000'"; }
|
||||
wake() { Ash input keyevent KEYCODE_WAKEUP; Ash wm dismiss-keyguard > /dev/null 2>&1 || true; }
|
||||
tds() { python3 "$BUILD_TREE/tools/trace_replay/tcp_device_server.py" "$@" --serial "$SERIAL" --package "$PKG" \
|
||||
--listen "$LISTEN" --token "$TOKEN"; }
|
||||
force_stop() { Ash am force-stop "$PKG"; }
|
||||
pid_of() { Ash "pidof $1" | awk '{print $1}'; }
|
||||
ps_mobilegl() { Ash "ps -A -o PID,PPID,NAME,ARGS" | grep -E "mobilegl|MobileGL" | grep -v grep; }
|
||||
logcat_since() { A logcat -d -v threadtime -T "$1"; } # <devtime>
|
||||
# mglines <logcat file>: only this package's own tags (MobileGL native lines, the Activity, the service).
|
||||
mglines() { grep -E " [VDIWEF] (MobileGL|MobileGLDisplay|MobileGLServer) *:" "$1" | cut -c1-300; }
|
||||
|
||||
# wait_logcat <devtime> <extended-regex> <seconds>: 0 once logcat since <devtime> matches.
|
||||
wait_logcat() {
|
||||
local since=$1 pattern=$2 limit=$3 n=0
|
||||
while [ $n -lt $((limit * 2)) ]; do
|
||||
if logcat_since "$since" 2>/dev/null | grep -Eq -- "$pattern"; then return 0; fi
|
||||
sleep 0.5; n=$((n + 1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# case_args <case>: archive trace golden target width height crop_x crop_y crop_w crop_h
|
||||
case_args() {
|
||||
python3 - "$BUILD_TREE/tools/trace_replay/trace_cases.json" "$1" <<'EOF'
|
||||
import json, sys
|
||||
m = json.load(open(sys.argv[1])); d = m["defaults"]
|
||||
c = next(c for c in m["cases"] if c["name"] == sys.argv[2])
|
||||
g = lambda k: c.get(k, d.get(k))
|
||||
print(g("trace_archive"), g("trace_file"), g("golden"), g("target_call"), g("width"), g("height"),
|
||||
g("crop_x"), g("crop_y"), g("crop_width"), g("crop_height"), g("ssim_threshold"))
|
||||
EOF
|
||||
}
|
||||
|
||||
# replay <dir> <case> <backend> <window|pbuffer> [K=V ...]: one host retrace against ENDPOINT, the
|
||||
# run_trace_case.cmake invocation plus the surface flag. Writes <dir>/{replay.log,rc,t0,t1,output/}.
|
||||
replay() {
|
||||
local dir=$1 case=$2 backend=$3 surface=$4; shift 4
|
||||
local archive trace golden target w h cx cy cw ch ssim
|
||||
read -r archive trace golden target w h cx cy cw ch ssim < <(case_args "$case")
|
||||
rm -rf "$dir/input" "$dir/output"; mkdir -p "$dir/input" "$dir/output"
|
||||
tar xzf "$FIX/$archive" -C "$dir/input"
|
||||
local flag=--pbuffer-surface; [ "$surface" = window ] && flag=--window-surface
|
||||
date +%s.%N > "$dir/t0"
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY -u MOBILEGL_IPC_SURFACE \
|
||||
MOBILEGL_TRANSPORT=spawn MOBILEGL_IPC_CONTROL="$ENDPOINT" MOBILEGL_IPC_DATA=stream \
|
||||
MOBILEGL_IPC_TOKEN="$TOKEN" MOBILEGL_IPC_REQUIRE_SAME_BUILD=1 MOBILEGL_IPC_LOG_FORWARD=1 \
|
||||
MOBILEGL_LOG_FILE_PATH="$dir/output/mobilegl.log" "$@" \
|
||||
timeout 900 "$HOST/mobilegl_trace_replay" --trace "$dir/input/$trace" --golden "$FIX/$golden" \
|
||||
--diff "$dir/output/$case-diff.png" --output "$dir/output" --backend "$backend" \
|
||||
--mobilegl-library "$HOST/libMobileGL.so" --target-call "$target" --width "$w" --height "$h" \
|
||||
--ssim-threshold "$ssim" --crop-x "$cx" --crop-y "$cy" --crop-width "$cw" --crop-height "$ch" \
|
||||
"$flag" > "$dir/replay.log" 2>&1
|
||||
local rc=$?
|
||||
date +%s.%N > "$dir/t1"
|
||||
echo "$rc" > "$dir/rc"
|
||||
rm -rf "$dir/input"
|
||||
return $rc
|
||||
}
|
||||
|
||||
# shots <dir> <pid>: adb screencaps every ~1 s while <pid> lives -> <dir>/shots/NN.png + shots.tsv
|
||||
shots() {
|
||||
local dir=$1 pid=$2 n=0
|
||||
mkdir -p "$dir/shots"
|
||||
while kill -0 "$pid" 2> /dev/null; do
|
||||
local t0 t1 f
|
||||
f=$(printf '%s/shots/%02d.png' "$dir" "$n")
|
||||
t0=$(date +%s.%N)
|
||||
A exec-out screencap -p > "$f" 2> /dev/null
|
||||
t1=$(date +%s.%N)
|
||||
printf '%s\t%s\t%s\n' "$n" "$t0" "$t1" >> "$dir/shots.tsv"
|
||||
n=$((n + 1))
|
||||
sleep 0.7
|
||||
done
|
||||
}
|
||||
|
||||
# replay_with_shots <dir> <case> <backend> <surface> [K=V ...]
|
||||
replay_with_shots() {
|
||||
local dir=$1
|
||||
mkdir -p "$dir"; : > "$dir/shots.tsv"
|
||||
replay "$@" &
|
||||
local pid=$!
|
||||
shots "$dir" "$pid" &
|
||||
local shooter=$!
|
||||
wait "$pid"; local rc=$?
|
||||
wait "$shooter" 2> /dev/null
|
||||
return $rc
|
||||
}
|
||||
|
||||
# shot_report <dir>: per screencap, whether it was taken DURING the replay and how much of the
|
||||
# screen is non-black; the best during-replay shot is copied (and a 540p copy made) as evidence.
|
||||
shot_report() {
|
||||
python3 - "$1" <<'EOF'
|
||||
import sys, pathlib
|
||||
from PIL import Image
|
||||
d = pathlib.Path(sys.argv[1])
|
||||
t0 = float((d / "t0").read_text()); t1 = float((d / "t1").read_text())
|
||||
best = None
|
||||
rows = []
|
||||
for line in (d / "shots.tsv").read_text().splitlines():
|
||||
n, a, b = line.split("\t"); a = float(a); b = float(b)
|
||||
f = d / "shots" / f"{int(n):02d}.png"
|
||||
try:
|
||||
im = Image.open(f).convert("L")
|
||||
except Exception as e:
|
||||
rows.append(f"{n} unreadable {e}"); continue
|
||||
small = im.resize((im.width // 4, im.height // 4))
|
||||
px = list(small.getdata())
|
||||
lit = sum(1 for p in px if p > 24) / len(px)
|
||||
mean = sum(px) / len(px)
|
||||
during = a >= t0 and b <= t1
|
||||
rows.append(f"{n} t=+{a - t0:6.2f}s..+{b - t0:6.2f}s during={during} nonblack={lit:.3f} mean={mean:.1f}")
|
||||
if during and (best is None or lit > best[1]):
|
||||
best = (f, lit, mean, a - t0)
|
||||
print(f"replay ran {t1 - t0:.2f}s; {len(rows)} screencaps")
|
||||
print("\n".join(rows))
|
||||
if best:
|
||||
f, lit, mean, at = best
|
||||
ev = d / "evidence-during-replay.png"
|
||||
ev.write_bytes(f.read_bytes())
|
||||
im = Image.open(f); h = 540; w = max(1, im.width * h // im.height)
|
||||
im.resize((w, h)).save(d / "evidence-during-replay-540p.png")
|
||||
print(f"BEST during-replay screencap: {f.name} at +{at:.2f}s nonblack={lit:.3f} mean={mean:.1f} -> {ev}")
|
||||
else:
|
||||
print("NO screencap was taken during the replay")
|
||||
EOF
|
||||
}
|
||||
|
||||
# result_summary <dir>: the runner's own verdict (result.json) and the arm proofs from the logs.
|
||||
result_summary() {
|
||||
local dir=$1
|
||||
echo "rc=$(cat "$dir/rc" 2>/dev/null)"
|
||||
python3 - "$dir/output/result.json" <<'EOF' 2>/dev/null || echo "result.json: missing"
|
||||
import json, sys
|
||||
r = json.load(open(sys.argv[1]))
|
||||
print("result.json:", {k: r.get(k) for k in ("passed", "statusCode", "ssim", "message", "matchedGoldenPath")})
|
||||
EOF
|
||||
grep -hE "surface=(window|pbuffer)|control=tcp data=stream server=|owner=server|Refuse ServerOwned|NoServerDisplay|SurfaceModeMismatch|ServerWindowLost|device lost|DEVICE_LOST|Welcome" \
|
||||
"$dir"/output/mobilegl*.log 2>/dev/null | cut -c1-300 | sort | uniq -c | sort -rn | head -20
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# final-run.sh <stamp>: install and run every device check in order on one build.
|
||||
set -uo pipefail
|
||||
STAMP=$1
|
||||
D=/home/swung/w7/logs/p12/device
|
||||
H=/home/swung/w7/notes/p12/android
|
||||
prev=$(ls -d "$D"/[1-7]-* 2>/dev/null | head -1)
|
||||
if [ -n "$prev" ]; then
|
||||
arch=$D/trial-$(cat "$D/.stamp" 2>/dev/null || echo unknown)
|
||||
mkdir -p "$arch"; mv "$D"/[1-7]-* "$arch"/
|
||||
fi
|
||||
echo "${STAMP#p12w1-}" > "$D/.stamp"
|
||||
bash /home/swung/w7/notes/p7/window2/20-install.sh "$STAMP" 2>&1 | tail -3
|
||||
export STAMP
|
||||
bash "$H/check1.sh" > /dev/null 2>&1 # 1 Espryt on-screen
|
||||
bash "$H/check3.sh" > /dev/null 2>&1 # 3 sequential + Busy
|
||||
LONG_CASE=minecraft-1.21.4-fabric-iris-bsl-esc-menu-854 bash "$H/check4.sh" > /dev/null 2>&1 # 4 window lost
|
||||
BACKEND=DirectVulkan SECOND_CASE=minecraft-1.21.4-startup bash "$H/check1.sh" > /dev/null 2>&1 # 2 Magma
|
||||
bash "$H/check5.sh" > /dev/null 2>&1 # 5 + 6 offscreen service
|
||||
LONG_CASE=minecraft-1.21.4-fabric-iris-bsl-esc-menu-854 bash "$H/check7.sh" > /dev/null 2>&1 # 7 one server
|
||||
echo "all checks ran for $STAMP"
|
||||
ls "$D"
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# g1.sh: the pull build's libMobileGL against the P12 base - .text size and full nm lines (the
|
||||
# base file holds full `nm` lines, so both sides are compared whole and as names).
|
||||
set -uo pipefail
|
||||
cd /home/swung/w7/p12-onscreen || exit 1
|
||||
export MOBILEGL_FLATC_EXECUTABLE=/home/swung/w7/flatc-build/flatc
|
||||
ninja -C build-linux -j 24 MobileGL 2>&1 | tail -1
|
||||
readelf -S -W build-linux/libMobileGL.so | awk '$2==".text"{print "G1 text size (hex):", $6, "(base a52203)"}'
|
||||
T=$(mktemp -d)
|
||||
nm --defined-only build-linux/libMobileGL.so | sort > "$T/now.txt"
|
||||
sort /home/swung/w7/logs/p12/pull-syms-base.txt > "$T/base.txt"
|
||||
echo "G1 full nm lines: added=$(comm -13 "$T/base.txt" "$T/now.txt" | wc -l) removed=$(comm -23 "$T/base.txt" "$T/now.txt" | wc -l)"
|
||||
awk '{print $3}' "$T/now.txt" | sort > "$T/now-n.txt"; awk '{print $3}' "$T/base.txt" | sort > "$T/base-n.txt"
|
||||
echo "G1 names: added=$(comm -13 "$T/base-n.txt" "$T/now-n.txt" | wc -l) removed=$(comm -23 "$T/base-n.txt" "$T/now-n.txt" | wc -l)"
|
||||
rm -rf "$T"
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
"""host-inproc-server.py <libMobileGL.so> <endpoint>: the in-process display server entry
|
||||
(mobilegl_server_serve_inprocess) hosted by a plain host process, no display installed - the host
|
||||
twin of MobileGLDisplayActivity's server thread, for reproducing sequential-session behaviour."""
|
||||
import ctypes, os, sys, signal, threading
|
||||
lib_path, endpoint = sys.argv[1], sys.argv[2]
|
||||
for k in ("MOBILEGL_TRANSPORT", "MOBILEGL_IPC_SERVER_PATH", "MOBILEGL_IPC_RING_MB", "MOBILEGL_IPC_STAGE_MB",
|
||||
"MOBILEGL_IPC_CONTROL", "DISPLAY", "WAYLAND_DISPLAY"):
|
||||
os.environ.pop(k, None)
|
||||
os.environ.update(MOBILEGL_IPC_ROLE="server", MOBILEGL_IPC_DIAL="no", MOBILEGL_IPC_LOG_FORWARD="1")
|
||||
os.environ.setdefault("EGL_PLATFORM", "surfaceless")
|
||||
lib = ctypes.CDLL(lib_path)
|
||||
lib.mobilegl_server_serve_inprocess.argtypes = [ctypes.c_char_p]
|
||||
lib.mobilegl_server_serve_inprocess.restype = ctypes.c_int
|
||||
def stop(*_):
|
||||
lib.mobilegl_server_stop_inprocess()
|
||||
signal.signal(signal.SIGTERM, stop)
|
||||
signal.signal(signal.SIGINT, stop)
|
||||
rc = [None]
|
||||
t = threading.Thread(target=lambda: rc.__setitem__(0, lib.mobilegl_server_serve_inprocess(endpoint.encode())))
|
||||
t.start()
|
||||
while t.is_alive():
|
||||
t.join(0.2)
|
||||
print("serve returned", rc[0], flush=True)
|
||||
sys.exit(rc[0] or 0)
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
# hostkill.sh <libdir> <outdir> [case] [kill-after-s]: a replay against the host in-process server,
|
||||
# whose process is SIGKILLed mid-session. The client must latch DEVICE LOST and end without a
|
||||
# SIGABRT (rc 134).
|
||||
set -uo pipefail
|
||||
LIBDIR=$1; OUT=$2; CASE=${3:-minecraft-1.21.4-fabric-iris-bsl-esc-menu-854}; AFTER=${4:-6}
|
||||
TREE=/home/swung/w7/p12-onscreen
|
||||
FIX=$TREE/tools/trace_replay/fixtures
|
||||
REPLAY=${REPLAY:-/home/swung/w7/logs/p7w7/p12w1-a4a940db/host/mobilegl_trace_replay}
|
||||
EP=tcp://127.0.0.1:41998
|
||||
TOKEN=p12-host-repro-token-0001
|
||||
rm -rf "$OUT"; mkdir -p "$OUT"
|
||||
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
|
||||
MOBILEGL_IPC_TOKEN=$TOKEN MOBILEGL_LOG_FILE_PATH=$OUT/server.log \
|
||||
python3 /home/swung/w7/notes/p12/android/host-inproc-server.py "$LIBDIR/libMobileGL.so" "$EP" > "$OUT/server.out" 2>&1 &
|
||||
SERVER=$!
|
||||
sleep 1.5
|
||||
read -r archive trace golden target w h cx cy cw ch ssim < <(python3 - "$TREE/tools/trace_replay/trace_cases.json" "$CASE" <<'EOF'
|
||||
import json, sys
|
||||
m = json.load(open(sys.argv[1])); d = m["defaults"]
|
||||
c = next(c for c in m["cases"] if c["name"] == sys.argv[2])
|
||||
g = lambda k: c.get(k, d.get(k))
|
||||
print(g("trace_archive"), g("trace_file"), g("golden"), g("target_call"), g("width"), g("height"),
|
||||
g("crop_x"), g("crop_y"), g("crop_width"), g("crop_height"), g("ssim_threshold"))
|
||||
EOF
|
||||
)
|
||||
d=$OUT/run; mkdir -p "$d/input" "$d/output"; tar xzf "$FIX/$archive" -C "$d/input"
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY MOBILEGL_TRANSPORT=spawn MOBILEGL_IPC_CONTROL=$EP MOBILEGL_IPC_DATA=stream \
|
||||
MOBILEGL_IPC_TOKEN=$TOKEN MOBILEGL_IPC_LOG_FORWARD=1 MOBILEGL_LOG_FILE_PATH=$d/output/mobilegl.log \
|
||||
timeout 600 "$REPLAY" --trace "$d/input/$trace" --golden "$FIX/$golden" --diff "$d/output/diff.png" \
|
||||
--output "$d/output" --backend DirectGLES --mobilegl-library "$LIBDIR/libMobileGL.so" --target-call "$target" \
|
||||
--width "$w" --height "$h" --ssim-threshold "$ssim" --crop-x "$cx" --crop-y "$cy" --crop-width "$cw" \
|
||||
--crop-height "$ch" --pbuffer-surface > "$d/replay.log" 2>&1 &
|
||||
CLIENT=$!
|
||||
sleep "$AFTER"
|
||||
kill -0 $CLIENT 2>/dev/null && echo "client live after ${AFTER}s: SIGKILL the server" || echo "WARNING: client already ended"
|
||||
kill -KILL $SERVER
|
||||
wait $CLIENT; RC=$?
|
||||
echo "client rc=$RC $( [ $RC = 134 ] && echo '(SIGABRT)')"
|
||||
grep -hE "DEVICE LOST|FATAL" "$d/output/mobilegl.client.log" | cut -c1-200 | head -4
|
||||
rm -rf "$d/input"
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
# hostrepro.sh <libdir> <outdir> [case] [backend] [runs]: the in-process server on the host (no display),
|
||||
# then <runs> sequential offscreen replays of <case> against it. Reproduces cross-session state leaks.
|
||||
set -uo pipefail
|
||||
LIBDIR=$1; OUT=$2; CASE=${3:-OpenRA}; BACKEND=${4:-DirectGLES}; RUNS=${5:-2}
|
||||
TREE=/home/swung/w7/p12-onscreen
|
||||
FIX=$TREE/tools/trace_replay/fixtures
|
||||
REPLAY=${REPLAY:-/home/swung/w7/logs/p7w7/p12w1-984db455/host/mobilegl_trace_replay}
|
||||
EP=tcp://127.0.0.1:41999
|
||||
TOKEN=p12-host-repro-token-0001
|
||||
rm -rf "$OUT"; mkdir -p "$OUT"
|
||||
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
|
||||
MOBILEGL_IPC_TOKEN=$TOKEN MOBILEGL_LOG_FILE_PATH=$OUT/server.log ${SERVER_ENV:-} \
|
||||
python3 /home/swung/w7/notes/p12/android/host-inproc-server.py "$LIBDIR/libMobileGL.so" "$EP" > "$OUT/server.out" 2>&1 &
|
||||
SERVER=$!
|
||||
sleep 1.5
|
||||
CASES=${CASES:-$(for _ in $(seq 1 "$RUNS"); do printf '%s ' "$CASE"; done)}
|
||||
n=0
|
||||
for CASE in $CASES; do
|
||||
n=$((n + 1))
|
||||
read -r archive trace golden target w h cx cy cw ch ssim < <(python3 - "$TREE/tools/trace_replay/trace_cases.json" "$CASE" <<'EOF'
|
||||
import json, sys
|
||||
m = json.load(open(sys.argv[1])); d = m["defaults"]
|
||||
c = next(c for c in m["cases"] if c["name"] == sys.argv[2])
|
||||
g = lambda k: c.get(k, d.get(k))
|
||||
print(g("trace_archive"), g("trace_file"), g("golden"), g("target_call"), g("width"), g("height"),
|
||||
g("crop_x"), g("crop_y"), g("crop_width"), g("crop_height"), g("ssim_threshold"))
|
||||
EOF
|
||||
)
|
||||
echo "run$n: $CASE"
|
||||
d=$OUT/run$n; mkdir -p "$d/input" "$d/output"; tar xzf "$FIX/$archive" -C "$d/input"
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY MOBILEGL_TRANSPORT=spawn MOBILEGL_IPC_CONTROL=$EP MOBILEGL_IPC_DATA=stream \
|
||||
MOBILEGL_IPC_TOKEN=$TOKEN MOBILEGL_IPC_LOG_FORWARD=1 MOBILEGL_LOG_FILE_PATH=$d/output/mobilegl.log ${CLIENT_ENV:-} \
|
||||
timeout 600 "$REPLAY" --trace "$d/input/$trace" --golden "$FIX/$golden" --diff "$d/output/diff.png" \
|
||||
--output "$d/output" --backend "$BACKEND" --mobilegl-library "$LIBDIR/libMobileGL.so" --target-call "$target" \
|
||||
--width "$w" --height "$h" --ssim-threshold "$ssim" --crop-x "$cx" --crop-y "$cy" --crop-width "$cw" \
|
||||
--crop-height "$ch" ${SURFACE_FLAG:---pbuffer-surface} > "$d/replay.log" 2>&1
|
||||
echo "run$n rc=$? $(python3 -c "import json;r=json.load(open('$d/output/result.json'));print(r['passed'],r.get('ssim'))" 2>/dev/null)"
|
||||
grep -hcE "Program linking failed" "$d/output/mobilegl.server.log" 2>/dev/null | sed "s/^/ link failures: /"
|
||||
rm -rf "$d/input"
|
||||
done
|
||||
kill -TERM $SERVER; wait $SERVER
|
||||
tail -3 "$OUT/server.out"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# launch-build.sh [<sha>]: starts build.sh for the package tree's HEAD (or <sha>) in the background.
|
||||
set -euo pipefail
|
||||
SHA=$(git -C /home/swung/w7/p12-onscreen rev-parse "${1:-HEAD}")
|
||||
mkdir -p /home/swung/w7/logs/p12/android
|
||||
LOG=/home/swung/w7/logs/p12/android/build-${SHA:0:8}.log
|
||||
setsid nohup bash /home/swung/w7/notes/p12/android/build.sh "$SHA" > "$LOG" 2>&1 < /dev/null &
|
||||
echo "started build of ${SHA:0:8}, log $LOG"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# pidlines.sh <logcat> <pid> <from HH:MM:SS> <to HH:MM:SS> [exclude-regex]: that pid's lines in a window.
|
||||
f=$1; pid=$2; from=$3; to=$4; ex=${5:-'^$'}
|
||||
awk -v p="$pid" -v a="$from" -v b="$to" '$3==p && substr($2,1,8)>=a && substr($2,1,8)<=b' "$f" | grep -vE "$ex" | cut -c1-240
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
# Quick compile checks before the full APK build: the trace flavour's new/changed Java against
|
||||
# android-34, and DisplayServerJni.cpp for aarch64-linux-android26 with the split build's flags.
|
||||
set -uo pipefail
|
||||
cd /home/swung/w7/p12-onscreen || exit 1
|
||||
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk PATH=/usr/lib/jvm/java-21-openjdk/bin:$PATH
|
||||
OUT=$(mktemp -d /tmp/p12-precheck-XXXX)
|
||||
J=android-plugin/app/src/trace/java/top/mobilegl/plugin
|
||||
echo "--- javac (android-34)"
|
||||
javac --release 11 -Xlint:all -cp /home/swung/android-sdk/platforms/android-34/android.jar -d "$OUT/classes" \
|
||||
$J/MobileGLDisplayActivity.java $J/MobileGLServerService.java $J/ServerEnvironment.java 2>&1 | grep -v "^warning: \[options\]" | tail -30
|
||||
echo "javac rc=${PIPESTATUS[0]}"
|
||||
|
||||
echo "--- clang++ -fsyntax-only DisplayServerJni.cpp (android26)"
|
||||
NDK=/home/swung/android-sdk/ndk/27.3.13750724/toolchains/llvm/prebuilt/linux-x86_64
|
||||
# The split build's command line for ServerDisplay.cpp gives the include dirs and defines.
|
||||
CMD=$(python3 - <<'EOF'
|
||||
import json,shlex
|
||||
db=json.load(open('build-split/compile_commands.json'))
|
||||
e=next(x for x in db if x['file'].endswith('MG_Remote/Server/ServerDisplay.cpp'))
|
||||
args=shlex.split(e['command'])
|
||||
keep=[a for a in args if a.startswith(('-I','-D','-isystem','-std=')) ]
|
||||
# -isystem takes the next arg
|
||||
out=[];i=0
|
||||
while i<len(args):
|
||||
a=args[i]
|
||||
if a=='-isystem': out+= [a,args[i+1]]; i+=2; continue
|
||||
if a.startswith(('-I','-D','-std=')): out.append(a)
|
||||
i+=1
|
||||
print(' '.join(shlex.quote(a) for a in out))
|
||||
EOF
|
||||
)
|
||||
eval "$NDK/bin/clang++ --target=aarch64-linux-android26 -fsyntax-only -Wall -Wextra $CMD \
|
||||
MobileGL/MG_Remote/Server/DisplayServerJni.cpp" 2>&1 | grep -E "error|warning: .*DisplayServerJni" | head -30
|
||||
echo "clang rc=${PIPESTATUS[0]}"
|
||||
eval "$NDK/bin/clang++ --target=aarch64-linux-android26 -fsyntax-only $CMD \
|
||||
MobileGL/MG_Remote/Server/ServerDisplay.cpp" 2>&1 | grep -E "error" | head -10
|
||||
echo "clang ServerDisplay.cpp (android arm) rc=${PIPESTATUS[0]}"
|
||||
rm -rf "$OUT"
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
# Red-once for the Android stage's host-side tool tests: each mutation must turn its test red, and
|
||||
# the working file is restored from a backup copy (never git checkout) afterwards.
|
||||
set -uo pipefail
|
||||
cd /home/swung/w7/p12-onscreen || exit 1
|
||||
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk PATH=/usr/lib/jvm/java-21-openjdk/bin:$PATH
|
||||
B=$(mktemp -d /tmp/p12-redonce-XXXX)
|
||||
run() { "$@" > "$B/out.txt" 2>&1; local rc=$?; tail -3 "$B/out.txt" | sed 's/^/ /'; echo " rc=$rc"; }
|
||||
|
||||
echo "=== 1. tcp_device_server.py at base (no --surface): DeviceServerSurface must be red"
|
||||
cp tools/trace_replay/tcp_device_server.py "$B/tds.py"
|
||||
git show HEAD:tools/trace_replay/tcp_device_server.py > tools/trace_replay/tcp_device_server.py
|
||||
run python3 scripts/ci/tcp_lane_tools_test.py DeviceServerSurface
|
||||
cp "$B/tds.py" tools/trace_replay/tcp_device_server.py
|
||||
echo " restored; green again:"; run python3 scripts/ci/tcp_lane_tools_test.py DeviceServerSurface
|
||||
|
||||
echo "=== 2. ServerEnvironment.changes without unsets: ServerEnvironmentTest must be red"
|
||||
F=android-plugin/app/src/trace/java/top/mobilegl/plugin/ServerEnvironment.java
|
||||
cp "$F" "$B/se.java"
|
||||
sed -i 's/if (!after.containsKey(name)) edits.put(name, null);/if (false) edits.put(name, null);/' "$F"
|
||||
grep -c 'if (false) edits.put' "$F"
|
||||
run python3 tools/trace_replay/test_android_lifecycle.py
|
||||
cp "$B/se.java" "$F"
|
||||
|
||||
echo "=== 3. applyServerRole keeping the scrub list: ServerEnvironmentTest must be red"
|
||||
sed -i 's/for (String name : SCRUBBED) env.remove(name);/for (String name : SCRUBBED) { }/' "$F"
|
||||
grep -c 'SCRUBBED) { }' "$F"
|
||||
run python3 tools/trace_replay/test_android_lifecycle.py
|
||||
cp "$B/se.java" "$F"
|
||||
|
||||
echo "=== 4. the display Activity without android:process: the manifest check must be red"
|
||||
M=android-plugin/app/src/trace/AndroidManifest.xml
|
||||
cp "$M" "$B/manifest.xml"
|
||||
sed -i '/android:process=":mglwin"/d' "$M"
|
||||
run python3 tools/trace_replay/test_android_lifecycle.py
|
||||
cp "$B/manifest.xml" "$M"
|
||||
|
||||
echo "=== restored: all green"
|
||||
run python3 tools/trace_replay/test_android_lifecycle.py
|
||||
git status --short
|
||||
rm -rf "$B"
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Red-once for the twin drop: the call removed from ~BackendObject_DirectGLES must turn the unit
|
||||
# case red, and the host sequential repro red again; the file is restored from a backup copy.
|
||||
set -uo pipefail
|
||||
cd /home/swung/w7/p12-onscreen || exit 1
|
||||
export MOBILEGL_FLATC_EXECUTABLE=/home/swung/w7/flatc-build/flatc
|
||||
F=MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp
|
||||
B=$(mktemp /tmp/p12-bodg-XXXX.cpp); cp "$F" "$B"
|
||||
sed -i 's/if (MG_Config::Transport != MG_Config::TransportMode::Monolith) DropEveryTwinForEndedServerSession();/(void)0;/' "$F"
|
||||
echo "mutation applied: $(grep -c '(void)0;' "$F") site(s)"
|
||||
ninja -C build-split -j 24 SanityTest MobileGL 2>&1 | tail -1
|
||||
echo "--- unit case WITHOUT the drop"
|
||||
./build-split/MobileGL/MG_Test/SanityTest --gtest_filter='EsprytServerSession.*' 2>&1 | grep -E "Failure|OK \]|FAILED \]|still live" | head -8
|
||||
echo "--- host sequential sessions WITHOUT the drop"
|
||||
bash /home/swung/w7/notes/p12/android/hostrepro.sh /home/swung/w7/p12-onscreen/build-split /tmp/p12-redonce-twins OpenRA DirectGLES 2 2>&1 | grep -E "^run"
|
||||
cp "$B" "$F"; rm -f "$B"
|
||||
touch "$F"
|
||||
ninja -C build-split -j 24 SanityTest MobileGL 2>&1 | tail -1
|
||||
echo "--- restored"
|
||||
./build-split/MobileGL/MG_Test/SanityTest --gtest_filter='EsprytServerSession.*' 2>&1 | grep -E "OK \]|FAILED \]"
|
||||
git diff --stat
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Runs the host-side tool tests the Android stage touches, in the package tree.
|
||||
set -uo pipefail
|
||||
cd /home/swung/w7/p12-onscreen || exit 1
|
||||
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk PATH=/usr/lib/jvm/java-21-openjdk/bin:$PATH
|
||||
echo "--- test_android_lifecycle.py"
|
||||
python3 tools/trace_replay/test_android_lifecycle.py; echo "rc=$?"
|
||||
echo "--- tcp_lane_tools_test.py DeviceServerSurface + DeviceIdleExemption"
|
||||
python3 -m pytest -q scripts/ci/tcp_lane_tools_test.py 2>/dev/null | tail -3 || true
|
||||
python3 scripts/ci/tcp_lane_tools_test.py 2>&1 | tail -4; echo "rc=${PIPESTATUS[0]}"
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
// P12 (on-screen server window): A SERVER SESSION ENDS IN A PROCESS THAT OUTLIVES IT.
|
||||
//
|
||||
// The in-process display server (the display Activity's process) runs its sessions one after
|
||||
// another in ONE process, and each new client mints its handles from the same {slot, gen} space
|
||||
// again. The twin tables are process globals, so the twins the previous session built - naming ids
|
||||
// of the context its backend destroyed - answered for the next session's objects: on the device
|
||||
// the second on-screen OpenRA replay linked no program (ssim 0.00004) and the third crashed inside
|
||||
// Adreno's glDrawElements; on llvmpipe the second replay failed the same way. The server backend's
|
||||
// destruction under a transport - the end of a session - now drops every twin (without a driver
|
||||
// call), and monolith keeps its twins. Red once: remove the DropEveryTwinForEndedServerSession
|
||||
// call from ~BackendObject_DirectGLES and the first half of this case fails at every kind.
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
TEST(EsprytServerSession, TheServerBackendsDestructionDropsEveryTwinTheSessionBuilt) {
|
||||
using namespace MobileGL;
|
||||
namespace GL = MG_Backend::DirectGLES;
|
||||
const auto previousTransport = MG_Config::Transport;
|
||||
const MG_Pipe::MGPipeHandle program{7u, 3u};
|
||||
const MG_Pipe::MGPipeHandle texture{4u, 2u};
|
||||
const MG_Pipe::MGPipeHandle buffer{5u, 1u};
|
||||
// A session's twins: LIVE entries at the generations its client minted. A null twin object is
|
||||
// enough for the program and texture kinds - what the next session trips over is the live
|
||||
// entry itself (its generation, and the driver id a real twin would carry).
|
||||
const auto populate = [&] {
|
||||
ASSERT_NE(GL::PrgramImpl::g_backendProgramObjects.GetOrCreateByHandle(program), nullptr);
|
||||
ASSERT_NE(GL::TextureImpl::g_backendTextureObjects.GetOrCreateByHandle(texture), nullptr);
|
||||
GL::BufferImpl::g_backendBufferResources.GetOrCreate(buffer) =
|
||||
MakeShared<GL::BufferImpl::GLESBufferResource>();
|
||||
ASSERT_EQ(GL::PrgramImpl::g_backendProgramObjects.LiveGenAt(program.Slot), 3u);
|
||||
ASSERT_EQ(GL::TextureImpl::g_backendTextureObjects.LiveGenAt(texture.Slot), 2u);
|
||||
ASSERT_NE(GL::BufferImpl::g_backendBufferResources.FindByHandle(buffer), nullptr);
|
||||
};
|
||||
|
||||
// Under a transport this backend is the SERVER's: its destruction ends the session.
|
||||
MG_Config::Transport = MG_Config::TransportMode::Spawn;
|
||||
populate();
|
||||
{ GL::BackendObject_DirectGLES serverBackend; }
|
||||
EXPECT_EQ(GL::PrgramImpl::g_backendProgramObjects.LiveGenAt(program.Slot), 0u)
|
||||
<< "the ended session's program twin is still live: the next session's client mints {7, 0} "
|
||||
"and is refused as ProtocolCorruption, or adopts a program of the destroyed context";
|
||||
EXPECT_EQ(GL::TextureImpl::g_backendTextureObjects.LiveGenAt(texture.Slot), 0u)
|
||||
<< "the ended session's texture twin is still live";
|
||||
EXPECT_EQ(GL::BufferImpl::g_backendBufferResources.FindByHandle(buffer), nullptr)
|
||||
<< "the ended session's buffer twin is still live";
|
||||
// The next session starts from empty tables: its first handle at that slot is a fresh twin.
|
||||
MG_Pipe::MGPipeHandle nextSession{7u, 0u};
|
||||
auto* fresh = GL::PrgramImpl::g_backendProgramObjects.GetOrCreateByHandle(nextSession);
|
||||
ASSERT_NE(fresh, nullptr);
|
||||
EXPECT_EQ(*fresh, nullptr);
|
||||
|
||||
// Monolith keeps its twins: its backend is not a session's, and nothing here changed for it.
|
||||
GL::PrgramImpl::g_backendProgramObjects = {};
|
||||
MG_Config::Transport = MG_Config::TransportMode::Monolith;
|
||||
populate();
|
||||
{ GL::BackendObject_DirectGLES monolithBackend; }
|
||||
EXPECT_EQ(GL::PrgramImpl::g_backendProgramObjects.LiveGenAt(program.Slot), 3u);
|
||||
EXPECT_EQ(GL::TextureImpl::g_backendTextureObjects.LiveGenAt(texture.Slot), 2u);
|
||||
EXPECT_NE(GL::BufferImpl::g_backendBufferResources.FindByHandle(buffer), nullptr);
|
||||
|
||||
GL::PrgramImpl::g_backendProgramObjects = {};
|
||||
GL::TextureImpl::g_backendTextureObjects = {};
|
||||
GL::BufferImpl::g_backendBufferResources = {};
|
||||
MG_Config::Transport = previousTransport;
|
||||
}
|
||||
#else
|
||||
TEST(EsprytServerSession, TheServerBackendsDestructionDropsEveryTwinTheSessionBuilt) {
|
||||
GTEST_SKIP() << "a server backend exists only in the split build (MOBILEGL_BUILD_DISAGGREGATED)";
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# show.sh <check-dir>...: the non-logcat lines of each check.log, then its logcat lines (trimmed).
|
||||
for c in "$@"; do
|
||||
f=/home/swung/w7/logs/p12/device/$c/check.log
|
||||
echo "######## $c"
|
||||
grep -vE "^09-24" "$f" | grep -v Deprecation | cut -c1-260
|
||||
echo "---- logcat lines"
|
||||
grep -E "^09-24" "$f" | cut -c1-250 | head -${LINES_MAX:-30}
|
||||
done
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
"""thumbs.py <out.png> <png>...: a side-by-side strip of 540p-high thumbnails with labels."""
|
||||
import sys
|
||||
from PIL import Image, ImageDraw
|
||||
out, files = sys.argv[1], sys.argv[2:]
|
||||
thumbs = []
|
||||
for f in files:
|
||||
im = Image.open(f).convert("RGB")
|
||||
h = 540
|
||||
w = max(1, im.width * h // im.height)
|
||||
t = im.resize((w, h))
|
||||
ImageDraw.Draw(t).text((8, 8), f.split("/")[-1], fill=(255, 0, 255))
|
||||
thumbs.append(t)
|
||||
strip = Image.new("RGB", (sum(t.width for t in thumbs) + 8 * (len(thumbs) - 1), 540), (40, 40, 40))
|
||||
x = 0
|
||||
for t in thumbs:
|
||||
strip.paste(t, (x, 0))
|
||||
x += t.width + 8
|
||||
strip.save(out)
|
||||
print(out, strip.size)
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# verify-apk.sh <stamp>: the APK carries the display Activity, its JNI and the in-process entry.
|
||||
O=/home/swung/w7/logs/p7w7/$1
|
||||
NM=/home/swung/android-sdk/ndk/27.3.13750724/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm
|
||||
BT=$(ls -d /home/swung/android-sdk/build-tools/* | sort -V | tail -1)
|
||||
echo "--- JNI + in-process entry exported by the APK's libMobileGL.so"
|
||||
$NM -D --defined-only "$O/apk/lib/libMobileGL.so" | grep -E "MobileGLDisplayActivity|serve_inprocess|stop_inprocess"
|
||||
echo "--- manifest"
|
||||
"$BT/aapt2" dump xmltree --file AndroidManifest.xml "$O/apk/trace-$1.apk" | grep -B2 -A14 'MobileGLDisplayActivity' | grep -E "name|process|hardware|launchMode|taskAffinity|exported|configChanges" | head -12
|
||||
echo "--- classes"
|
||||
unzip -p "$O/apk/trace-$1.apk" classes.dex | strings | grep -E "^Ltop/mobilegl/plugin/(MobileGLDisplayActivity|ServerEnvironment|MobileGLServerService);" | sort -u
|
||||
echo "--- stamp"
|
||||
strings "$O/apk/lib/libMobileGL.so" | grep -F "$1" | head -2
|
||||
cat "$O/build.env"
|
||||
Reference in New Issue
Block a user