Skip to content

feat(contentexport): export images to a persistent host catalog - #2232

Closed
erick-dsnk wants to merge 1 commit into
boykopovar:mainfrom
erick-dsnk:codex/feat-content-export
Closed

erick-dsnk wants to merge 1 commit into
boykopovar:mainfrom
erick-dsnk:codex/feat-content-export

Conversation

@erick-dsnk

Copy link
Copy Markdown
Contributor

What

Guest code can now start an export session, import JPEG/PNG/GIF images from a guest file or a data-provider callback, import an explicit image thumbnail, and finish the session. The five exports previously threw unconditionally. Imports preserve source bytes and publish media plus metadata into a persistent host catalog that a separate content-search change can query.

The catalog lives under the launch root's /data/anyps5-content. Each successful import receives its own guest-readable path. An exclusive pending directory reserves the content ID; complete media and metadata are published by directory rename. Native file locks serialize publication and catalog snapshots across processes. A generation assigned at publication advances the update ID even when two exports finish in the opposite order from their start.

Guest allocator callbacks supply the streaming copy buffer and receive their original user data. Callback imports enforce the declared byte total and the 0/more, 1/done protocol; malformed callbacks, allocation failures and failed imports leave the output and published catalog unchanged. Live sessions enforce the ten-execution limit, and an active callback cannot finish, terminate or reenter its own session.

Scope: image imports. PNG/JPEG use the existing source-built decoders; GIF uses the existing stb submodule and validates its first frame. Video imports and nonzero bytes in the ambiguous reserved/comment field throw. Automatic thumbnails, console gallery notifications and sharing are not implemented. Host storage paths, session-limit application, error precedence and all recovered ABI contracts remain unverified on PS5 hardware; these gaps are recorded in TechnicalDebt.

ABI evidence:

Draft limitation: no commercial title has been shown reaching these exports on current main. Maintainer feedback on #1582 requests a title ID and stop log for library additions. This draft supplies working implementation and host test evidence; it does not claim that acceptance requirement is met.

Completion accounting: the unchanged progress scanner reports five newly implemented exports, libSceContentExport 2/7 → 7/7, and overall libraries 2578/3044 (84.69%) → 2583/3044 (84.86%). These figures classify declared exports and do not establish full console compatibility.

Tested

Linux, GCC 13.3.0, Release, BUILD_TESTING=ON, dedicated worktree based on upstream main d70b89989473ba1f6ae13e44e079e67f1f8a44b0.

  • Focused build and guest_content_export: passed in 0.06 seconds. Checks byte-for-byte JPEG/PNG/GIF import, explicit thumbnail bytes, chunked callbacks including separate final completion, dimensions and ownership metadata, session limits, callback reentrance, allocator balance and failure, malformed callbacks, unsupported images and MIME mismatches, output preservation and rollback, parallel exports, concurrent readers during publication, out-of-order publication generations, reinitialization persistence, and a fresh child process reading and publishing the catalog.
  • tools/check_conventions.py --base upstream/main: passed.
  • tools/check_test_registration.py build: passed; no new unregistered tests.
  • git diff --check: passed.
  • Exact commit 88e5bdeebed5b4923b2887c0e50490dc380add20 checked out in the existing USB validation worktree and configured afresh: full default build passed (1,140 rebuild steps), patched libs target passed, and guest_content_export passed again in 0.01 seconds. No build artifacts were copied between trees. The dedicated content-export branch and worktree remain separate and clean. No complete CTest suite was run for this content-export head.
  • No Windows, PS5 hardware or commercial title execution.

Checklist

  • Based on current main; no other open PR implements the same functions (complete paginated baseline audit plus newest PRs through feat(libc): implement IPv4 address helpers #2231; chore: adopt clang-format and pre-commit #1128 only reformats this file)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (existing decoders and stb submodule reused)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2195 docs/dev/TechnicalDebt.md L40

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: as the description says, no title reaches these exports on main, and a host image catalog is a lot to carry without one. Reopen when a title stops at one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants