Skip to content

Release v1.0.6: clear feasible Linux ABI, APK and bionic technical debt - #7

Merged
aarvsn merged 1 commit into
mainfrom
v1.0.6-technical-debt-cleanup
Nov 22, 2026
Merged

aarvsn merged 1 commit into
mainfrom
v1.0.6-technical-debt-cleanup

Conversation

@aarvsn

@aarvsn aarvsn commented Nov 22, 2026

Copy link
Copy Markdown
Owner

This PR was created by an AI agent (OpenHands) on behalf of the repository owner.

What changed and why

v1.0.6 pays down the technical debt that could be implemented honestly without pretending hard platform blockers do not exist. The Linux ABI matrix moves from 46 emulated / 4 partial / 30 unsupported to 57 / 8 / 15, and the two known placeholder implementations (APK DEFLATE and bionic initial stack) now do real work.

Area Before v1.0.6 After v1.0.6
Linux syscall matrix 46 emulated, 4 partial, 30 unsupported 57 emulated, 8 partial, 15 unsupported
APK manifest inflater STORED + fixed-Huffman only STORED + fixed + dynamic Huffman
Bionic initial stack hardcoded argv/env pointers, AT_PHDR=0x400000 real argc/argv/envp/auxv buffer, AT_PHDR from PT_LOAD
Path resolution host cwd implicit tracked guest cwd via chdir
Guest fd table files, pipes, epoll, eventfd + directories, memfd, flock, poll/ppoll, FIONREAD

Linux ABI additions

New emulated syscalls: madvise, chdir, personality, sched_setaffinity, sched_getaffinity, set_robust_list, wait4, exit, flock, getdents64, memfd_create.

New partial syscalls, with restrictions documented in the syscall table:

  • mremap — in-place shrink and MREMAP_MAYMOVE grow; MREMAP_FIXED/DONTUNMAP refused.
  • arch_prctl — FS/GS values recorded per context; no real TLS base switch.
  • ioctl — FIONREAD only; other requests return ENOTTY.
  • ppoll — readiness polling over guest fds; signal-mask argument ignored.

Supporting work:

  • Tracked guest cwd so relative open, stat, access, mkdir, unlink, readlink, and unlinkat resolve consistently.
  • Directory streams (getdents64) with ./.., O_DIRECTORY enforcement, and EOF.
  • Advisory flock with shared/exclusive/LOCK_NB, per-path ownership, dup/open-file-description semantics, and release on last close.
  • memfd_create with flag validation and full read/write/seek/fstat behavior.
  • poll/ppoll readiness and POLLNVAL reporting.
  • FIONREAD for file, stream, pipe, and memfd descriptors.

APK inspection

The DEFLATE decoder now builds canonical Huffman trees for code-length, literal/length, and distance alphabets. This decodes BTYPE=2 blocks that zlib emits for real AndroidManifest.xml entries. Truncated and oversubscribed streams fail cleanly.

Bionic loader

setup_initial_stack now lays out argc, argv/envp pointers into actual string bytes, NULL terminators, and auxv. AT_PHDR is derived from the PT_LOAD segment covering e_phoff rather than hardcoding 0x400000.

Version and docs

  • Version bumped to 1.0.6 in src/version.h and CMakeLists.txt.
  • README, architecture, platform-constraints, and CHANGELOG updated with the new counts and behavior.

Verification

  • Host build: clean.
  • ctest --test-dir build --output-on-failure: 80/80 pass.
  • Direct ./build/ps5droid_tests: 80/80 pass.
  • ASan/UBSan build and run: 80/80 pass, no reports.
  • ./build/ps5droid-host --version: ps5droid-host 1.0.6 (backend: posix).

New coverage lives in tests/test_compat_debt.cpp, plus dynamic-Huffman DEFLATE and dynamic-AXML APK tests in tests/test_binder_and_apk.cpp and a real-stack bionic test in tests/test_bionic_and_fd.cpp.

Remaining hard blockers

The 15 unsupported syscalls stay honestly marked -ENOSYS: process creation (clone/fork/vfork/execve), sockets, signals, and inotify_init1. These need platform facilities Orbis payloads do not expose, so this PR does not fake them.

@aarvsn can click here to continue refining the PR

- Expand emulated syscalls 46 -> 57, partial 4 -> 8, unsupported 30 -> 15
- Add mremap/madvise, guest cwd/chdir, flock, memfd, getdents64,
  ppoll/poll, FIONREAD ioctl, personality, arch_prctl bookkeeping,
  affinity, set_robust_list, wait4 and exit
- Decode DEFLATE dynamic-Huffman blocks for real APK manifests
- Build a real argv/envp/auxv initial stack and derive AT_PHDR from PT_LOAD
- Add focused tests; 80/80 host tests pass, ASan/UBSan clean
- Bump version to 1.0.6 and update docs/CHANGELOG

Co-authored-by: openhands <openhands@all-hands.dev>
@aarvsn
aarvsn marked this pull request as ready for review November 22, 2026 05:15
@aarvsn
aarvsn merged commit 13e2050 into main Nov 22, 2026
8 checks passed
@aarvsn
aarvsn deleted the v1.0.6-technical-debt-cleanup branch November 22, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants