Release 2.0.12 with Android graphics recovery and regression checks
This commit is contained in:
1 parent
41f56bdd47
commit
c2b8ed642e
20 files changed
+302
-32
No files matched your search
@@ -1,4 +1,9 @@
|
||||
# Changelog
|
||||
## [2.0.12] - 2026-10-06
|
||||
### Fixed
|
||||
- Restore banners and navigation icons when returning to the Android app or changing orientation.
|
||||
- Keep images from disappearing or showing font characters after graphics resources are recreated.
|
||||
|
||||
## [2.0.11] - 2026-10-04
|
||||
### Changed
|
||||
- Lists, Habits, and Practice now load as separate modules inside Inner Breeze, with shared navigation, settings, and saved data.
|
||||
|
||||
@@ -1670,6 +1670,25 @@ android-lifecycle-zi-test: $(ZI2C_BIN)
|
||||
|
||||
test: android-lifecycle-zi-test
|
||||
|
||||
.PHONY: raylib-graphics-test android-graphics-device-test
|
||||
raylib-graphics-test: $(ZI2C_BIN)
|
||||
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
|
||||
ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BUILD_DIR)/bin/ziran" \
|
||||
sh "$(KRYON_DIR)/tests/ziran_raylib_graphics_test.sh"
|
||||
|
||||
test: raylib-graphics-test
|
||||
|
||||
.PHONY: graphics-transition-test
|
||||
graphics-transition-test: $(ZI2C_BIN)
|
||||
@sh tests/graphics_transition_test.sh $(ZIRAN_BUILD_DIR)/bin
|
||||
|
||||
test: graphics-transition-test
|
||||
|
||||
# Explicit device check; never part of the CI or ordinary test target.
|
||||
# Inbe's Device settings must allow System orientation for real rotation.
|
||||
android-graphics-device-test:
|
||||
@python3 tests/android_graphics_recovery_device.py $(ANDROID_GRAPHICS_ARGS)
|
||||
|
||||
.PHONY: language-selection-zi-test
|
||||
language-selection-zi-test: $(ZI2C_BIN)
|
||||
@env -u DISPLAY -u WAYLAND_DISPLAY \
|
||||
|
||||
@@ -53,8 +53,8 @@ android {
|
||||
applicationId "xyz.waozi.inbe"
|
||||
minSdk 21
|
||||
targetSdk 36
|
||||
versionCode 135
|
||||
versionName "2.0.11"
|
||||
versionCode 136
|
||||
versionName "2.0.12"
|
||||
manifestPlaceholders = [
|
||||
inbeAppLabel: "Inner Breeze",
|
||||
inbeUsesCleartextTraffic: "false"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Fixed
|
||||
---
|
||||
- Restore banners and navigation icons when returning to the Android app or changing orientation.
|
||||
- Keep images from disappearing or showing font characters after graphics resources are recreated.
|
||||
@@ -1,5 +1,5 @@
|
||||
Package: inbe.waozi
|
||||
Version: 2.0.11
|
||||
Version: 2.0.12
|
||||
Architecture: arm64
|
||||
Maintainer: Waozi <[email protected]>
|
||||
Click-Version: 0.4
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.0.11" date="2026-10-04"/>
|
||||
<release version="2.0.12" date="2026-10-06"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "inbe",
|
||||
"title": "Inner Breeze",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.12",
|
||||
"architecture": "arm64",
|
||||
"framework": "ubuntu-sdk-20.04",
|
||||
"description": "Syncable breathing, meditation, and habit practice app.",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 3,
|
||||
"name": "Inner Breeze",
|
||||
"short_name": "Inbe",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.12",
|
||||
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
|
||||
"permissions": [
|
||||
"contextMenus"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.0.11" date="2026-10-04"/>
|
||||
<release version="2.0.12" date="2026-10-06"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -22,7 +22,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.0.11" date="2026-10-04"/>
|
||||
<release version="2.0.12" date="2026-10-06"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -6,7 +6,7 @@ description: |
|
||||
meditation, and habit tracking with visual and audio cues, meditation
|
||||
timers, habit counters, session history, and optional sync.
|
||||
|
||||
version: '2.0.11'
|
||||
version: '2.0.12'
|
||||
license: BSD-3-Clause
|
||||
base: core22
|
||||
confinement: strict
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
|
||||
APP_ROUTE_TRANSITION_SECONDS :: 0.12;
|
||||
|
||||
#program_export
|
||||
app_route_transition_cancel :: (app: *InnerBreeze, context_lost: bool = false) {
|
||||
if app == null { return }
|
||||
surface: FrameSurface
|
||||
surface.texture = app.ui.route_transition_texture
|
||||
if !context_lost && app.ui.route_transition_texture_owned &&
|
||||
FrameSurfaceValid(surface) {
|
||||
FrameSurfaceRelease(surface)
|
||||
}
|
||||
app.ui.route_transition_texture = Texture2D.{}
|
||||
app.ui.route_transition_texture_owned = false
|
||||
app.ui.route_transition_active = false
|
||||
app.ui.route_transition_pending = false
|
||||
}
|
||||
|
||||
#program_export
|
||||
app_route_transition_request :: (app: *InnerBreeze) {
|
||||
if app == null { return }
|
||||
|
||||
@@ -334,12 +334,10 @@ app_reload_graphics_resources :: (app: *InnerBreeze) -> bool {
|
||||
TraceLog(LOG_INFO, "ANDROID: Reloading graphics resources")
|
||||
#if #defined(ANDROID_BUILD) {
|
||||
ResetRaylibGraphics(context_lost)
|
||||
if context_lost {
|
||||
app.ui.route_transition_texture = Texture2D.{}
|
||||
app.ui.route_transition_texture_owned = false
|
||||
app.ui.route_transition_active = false
|
||||
app.ui.route_transition_pending = false
|
||||
}
|
||||
// Retained frames are gone even when the context survived. A route
|
||||
// fade must not keep a borrowed texture from the discarded frame.
|
||||
app_route_transition_cancel(app, context_lost)
|
||||
app.ui.retained_target_active = false
|
||||
app.ui.retained_frame_unchanged = false
|
||||
}
|
||||
if !LoadLocaleFont(app) {
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
#define APP_VERSION_MAJOR 2
|
||||
#define APP_VERSION_MINOR 0
|
||||
#define APP_VERSION_PATCH 11
|
||||
#define APP_VERSION_STRING "2.0.11"
|
||||
#define APP_VERSION_PATCH 12
|
||||
#define APP_VERSION_STRING "2.0.12"
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// Generated by update_version.sh from CHANGELOG.md. Do not edit by hand.
|
||||
VersionMajor :: 2
|
||||
VersionMinor :: 0
|
||||
VersionPatch :: 11
|
||||
VersionString :: "2.0.11"
|
||||
VersionPatch :: 12
|
||||
VersionString :: "2.0.12"
|
||||
@@ -0,0 +1,151 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare Inbe's visible graphics across lifecycle changes on the dev Moto."""
|
||||
import argparse
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from PIL import Image, ImageChops, ImageStat
|
||||
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--host', default='[email protected]')
|
||||
parser.add_argument('--serial', default='ZE2223BQZT')
|
||||
parser.add_argument('--package', default='xyz.waozi.inbe.debug')
|
||||
parser.add_argument('--cycles', type=int, default=10)
|
||||
parser.add_argument('--output', type=Path, default=Path('build/android/graphics-recovery'))
|
||||
args = parser.parse_args()
|
||||
if args.serial != 'ZE2223BQZT':
|
||||
parser.error('This test is restricted to the development Moto; never use the Pixel.')
|
||||
if args.package not in ('xyz.waozi.inbe.debug', 'xyz.waozi.inbe'):
|
||||
parser.error('This test may operate only on Inbe.')
|
||||
if args.cycles < 1:
|
||||
parser.error('--cycles must be positive')
|
||||
for key in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY', 'DBUS_SESSION_BUS_ADDRESS'):
|
||||
os.environ.pop(key, None)
|
||||
args.output.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def adb(*command, binary=False):
|
||||
remote = shlex.join(['adb', '-s', args.serial, *map(str, command)])
|
||||
result = subprocess.run(
|
||||
['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=8', args.host, remote],
|
||||
capture_output=True, timeout=30, check=True)
|
||||
return result.stdout if binary else result.stdout.decode().strip()
|
||||
|
||||
|
||||
def start():
|
||||
output = adb('shell', 'am', 'start', '-W', '-n',
|
||||
args.package + '/xyz.waozi.inbe.MainActivity')
|
||||
if 'Status: ok' not in output:
|
||||
raise RuntimeError('Inbe did not start: ' + output)
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
def frame(name):
|
||||
focus = adb('shell', 'dumpsys', 'window', 'windows')
|
||||
current = next((line for line in focus.splitlines() if 'mCurrentFocus=' in line), '')
|
||||
if args.package + '/xyz.waozi.inbe.MainActivity' not in current:
|
||||
raise RuntimeError('Refusing to capture a window other than Inbe: ' + current)
|
||||
if adb('shell', 'pidof', args.package) != pid:
|
||||
raise RuntimeError('Inbe restarted during the recovery test')
|
||||
data = adb('exec-out', 'screencap', '-p', binary=True)
|
||||
(args.output / (name + '.png')).write_bytes(data)
|
||||
image = Image.open(io.BytesIO(data)).convert('RGB')
|
||||
# Exclude changing Android status/navigation bars. The app, including its
|
||||
# banners and bottom navigation icons, remains inside the comparison.
|
||||
width, height = image.size
|
||||
report.setdefault('frame_sizes', {})[name] = [width, height]
|
||||
return image.crop((0, int(height * .05), width, int(height * .94)))
|
||||
|
||||
|
||||
def compare(reference, actual, name):
|
||||
if reference.size != actual.size:
|
||||
raise RuntimeError(name + ': app dimensions changed unexpectedly')
|
||||
difference = ImageChops.difference(reference, actual)
|
||||
error = sum(ImageStat.Stat(difference).mean) / 3
|
||||
width, height = difference.size
|
||||
worst_tile = 0.0
|
||||
for row in range(8):
|
||||
for column in range(4):
|
||||
tile = difference.crop((column * width // 4, row * height // 8,
|
||||
(column + 1) * width // 4, (row + 1) * height // 8))
|
||||
worst_tile = max(worst_tile, sum(ImageStat.Stat(tile).mean) / 3)
|
||||
# Allow minor antialiasing differences, but reject a missing banner,
|
||||
# font atlas replacing an image, or black navigation icons.
|
||||
if error > 1.5 or worst_tile > 3.0:
|
||||
difference.save(args.output / (name + '-difference.png'))
|
||||
raise RuntimeError(f'{name}: visible graphics changed (mean {error:.3f}, tile {worst_tile:.3f})')
|
||||
results.append({'case': name, 'mean_pixel_error': error, 'worst_tile_error': worst_tile})
|
||||
print(f'{name}: PASS (mean pixel error {error:.3f})', flush=True)
|
||||
|
||||
|
||||
def setting(name, value):
|
||||
if value == 'null':
|
||||
adb('shell', 'settings', 'delete', 'system', name)
|
||||
else:
|
||||
adb('shell', 'settings', 'put', 'system', name, value)
|
||||
|
||||
|
||||
if adb('get-state') != 'device':
|
||||
raise RuntimeError('Moto is not authorized and ready')
|
||||
original_rotation = adb('shell', 'settings', 'get', 'system', 'user_rotation')
|
||||
original_accelerometer = adb('shell', 'settings', 'get', 'system', 'accelerometer_rotation')
|
||||
results = []
|
||||
pid = ''
|
||||
report = {'serial': args.serial, 'package': args.package, 'passed': False, 'cases': results}
|
||||
try:
|
||||
adb('shell', 'input', 'keyevent', 'KEYCODE_WAKEUP')
|
||||
adb('shell', 'wm', 'dismiss-keyguard')
|
||||
setting('accelerometer_rotation', '0')
|
||||
setting('user_rotation', '0')
|
||||
start()
|
||||
pid = adb('shell', 'pidof', args.package)
|
||||
if not pid:
|
||||
raise RuntimeError('Inbe is not running')
|
||||
reference = frame('portrait-reference')
|
||||
for cycle in range(args.cycles):
|
||||
adb('shell', 'input', 'keyevent', 'KEYCODE_HOME')
|
||||
time.sleep(2)
|
||||
start()
|
||||
name = f'resume-{cycle + 1:02}'
|
||||
compare(reference, frame(name), name)
|
||||
|
||||
references = {0: reference}
|
||||
for cycle in range(2):
|
||||
for rotation in (1, 2, 3, 0):
|
||||
setting('user_rotation', str(rotation))
|
||||
time.sleep(4)
|
||||
name = f'rotation-{cycle + 1}-{rotation}'
|
||||
actual = frame(name)
|
||||
if rotation not in references:
|
||||
references[rotation] = actual
|
||||
print(name + ': reference recorded', flush=True)
|
||||
else:
|
||||
compare(references[rotation], actual, name)
|
||||
|
||||
if references[1].size == references[0].size:
|
||||
raise RuntimeError('No actual landscape rotation occurred; use System orientation in Inbe.')
|
||||
|
||||
for cycle in range(3):
|
||||
adb('shell', 'input', 'keyevent', 'KEYCODE_SLEEP')
|
||||
time.sleep(2)
|
||||
adb('shell', 'input', 'keyevent', 'KEYCODE_WAKEUP')
|
||||
adb('shell', 'wm', 'dismiss-keyguard')
|
||||
start()
|
||||
name = f'screen-wake-{cycle + 1}'
|
||||
compare(reference, frame(name), name)
|
||||
report['passed'] = True
|
||||
report['pid'] = pid
|
||||
finally:
|
||||
setting('user_rotation', original_rotation)
|
||||
setting('accelerometer_rotation', original_accelerometer)
|
||||
if pid:
|
||||
logs = adb('logcat', '-d', '--pid=' + pid, '-v', 'brief')
|
||||
(args.output / 'inbe-logcat.txt').write_text(logs)
|
||||
report['graphics_info_log_messages'] = logs.count('Reloading graphics resources')
|
||||
report['info_logs_may_be_disabled'] = True
|
||||
(args.output / 'report.json').write_text(json.dumps(report, indent=2) + '\n')
|
||||
@@ -0,0 +1,50 @@
|
||||
#import, file "../src/app/app_frame_transition.zi";
|
||||
#import, file "../src/app/app_types.zi";
|
||||
#import "drawing_props"
|
||||
|
||||
released: s32;
|
||||
wrong_texture: bool;
|
||||
|
||||
#program_export
|
||||
DisposeFrameTexture :: (texture: Texture2D) {
|
||||
released += 1
|
||||
if texture.id != 42 {
|
||||
wrong_texture = true
|
||||
}
|
||||
}
|
||||
|
||||
Prepared :: (app: *InnerBreeze, owned: bool) {
|
||||
app.ui.route_transition_texture = Texture2D.{42, 20, 20, 1, 7}
|
||||
app.ui.route_transition_texture_owned = owned
|
||||
app.ui.route_transition_active = true
|
||||
app.ui.route_transition_pending = true
|
||||
}
|
||||
|
||||
Cleared :: (app: *InnerBreeze) -> bool {
|
||||
return app.ui.route_transition_texture.id == 0 &&
|
||||
!app.ui.route_transition_texture_owned &&
|
||||
!app.ui.route_transition_active && !app.ui.route_transition_pending
|
||||
}
|
||||
|
||||
#program_export
|
||||
main :: () -> s32 {
|
||||
app: InnerBreeze
|
||||
// The renderer owns borrowed retained frames. Never delete them twice.
|
||||
Prepared(*app, false)
|
||||
app_route_transition_cancel(*app)
|
||||
if released != 0 || !Cleared(*app) { return 1 }
|
||||
|
||||
// An independently captured frame is released while its context is valid.
|
||||
Prepared(*app, true)
|
||||
app_route_transition_cancel(*app)
|
||||
if released != 1 || wrong_texture || !Cleared(*app) { return 2 }
|
||||
|
||||
// Old context names may now identify unrelated textures. Discard only.
|
||||
Prepared(*app, true)
|
||||
app_route_transition_cancel(*app, true)
|
||||
if released != 1 || !Cleared(*app) { return 3 }
|
||||
app_route_transition_cancel(*app)
|
||||
app_route_transition_cancel(null)
|
||||
if released != 1 { return 4 }
|
||||
return 0
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
bin=${1:-"$root/build/ziran-toolchain/bin"}
|
||||
work=$(mktemp -d "$root/build/graphics-transition.XXXXXX")
|
||||
trap 'rm -rf "$work"' EXIT HUP INT TERM
|
||||
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
|
||||
for target in c cpp; do
|
||||
"$bin/ziran" build --target="$target" --root "$root" \
|
||||
--module-path "$root/build/packages/kryon/src/ui" \
|
||||
--module-path "$root/build/packages/ziran/std" \
|
||||
-o "$work/$target" "$root/tests/graphics_transition_behavior.zi"
|
||||
if test "$target" = c; then
|
||||
compiler=${CC:-cc}
|
||||
standard=c11
|
||||
extension=c
|
||||
else
|
||||
compiler=${CXX:-c++}
|
||||
standard=c++17
|
||||
extension=cpp
|
||||
fi
|
||||
find "$work/$target" -name "*.$extension" -print > "$work/$target-files"
|
||||
"$compiler" -std="$standard" -O2 -ffunction-sections -fdata-sections \
|
||||
-Wl,--gc-sections -I"$work/$target" @"$work/$target-files" \
|
||||
-lm -o "$work/$target-test"
|
||||
"$work/$target-test"
|
||||
done
|
||||
echo 'Graphics recovery cancels borrowed, owned and lost-context route frames in C/C++'
|
||||
+4
-4
@@ -6,8 +6,8 @@ IDI_APP_ICON ICON "inbe.ico"
|
||||
IDI_NOTIFICATION_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,11,0
|
||||
PRODUCTVERSION 2,0,11,0
|
||||
FILEVERSION 2,0,12,0
|
||||
PRODUCTVERSION 2,0,12,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -24,11 +24,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "2.0.11"
|
||||
VALUE "FileVersion", "2.0.12"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "2.0.11"
|
||||
VALUE "ProductVersion", "2.0.12"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
+9
-9
@@ -9,6 +9,14 @@
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "86d71f8e4b07c23cbc9024e39854fa33e3239b81",
|
||||
"dependencies": {"oqs": "p55635fc8976895a9"},
|
||||
"id": "p04b37d424f9e9eb8",
|
||||
"name": "DaochiClient",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/daochi-client.git"
|
||||
},
|
||||
{
|
||||
"commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216",
|
||||
"dependencies": {},
|
||||
@@ -79,14 +87,6 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/LoupVaillant/Monocypher.git"
|
||||
},
|
||||
{
|
||||
"commit": "753211d4d6706ef8c38a8de1dfcb20e7d8c401ae",
|
||||
"dependencies": {"oqs": "p55635fc8976895a9"},
|
||||
"id": "pd84d39ba79dc890c",
|
||||
"name": "DaochiClient",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/daochi-client.git"
|
||||
},
|
||||
{
|
||||
"commit": "e1f07e615e9255a513dbb6d66e5e6e9d335ef690",
|
||||
"dependencies": {"kryon": "p0005addd0de6e17d"},
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"curl": "pc4b263336680098b", "daochi_client": "pd84d39ba79dc890c", "game2d": "p7b9204ab0ad2089f", "kryon": "p0005addd0de6e17d", "kss": "pfdf70946e0505dfe", "liboqs": "pb34994bf01670ac3", "monocypher": "pccdfe79ccaafde45", "oqs": "p55635fc8976895a9", "rini": "p09fa77e94b0dfc6c", "sqlite": "p151b83a361c86f2d"},
|
||||
"dependencies": {"curl": "pc4b263336680098b", "daochi_client": "p04b37d424f9e9eb8", "game2d": "p7b9204ab0ad2089f", "kryon": "p0005addd0de6e17d", "kss": "pfdf70946e0505dfe", "liboqs": "pb34994bf01670ac3", "monocypher": "pccdfe79ccaafde45", "oqs": "p55635fc8976895a9", "rini": "p09fa77e94b0dfc6c", "sqlite": "p151b83a361c86f2d"},
|
||||
"name": "Inbe"
|
||||
},
|
||||
"toolchain": {
|
||||
|
||||
Reference in new issue
Block a user