[PR #4990] [MERGED] perf(apktool): avoid duplicated primary strings on request #6713

Closed
opened 2026-11-01 21:42:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4990
Author: @N0zoM1z0
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @N0zoM1z0

Base: main ← Head: perf/4982-apktool-table-projection-20261018


📝 Commits (2)

  • 406af90 perf(apktool): avoid duplicated primary strings on request
  • 6425657 test(perf): qualify Apktool table-only resource queries

📊 Changes

14 files changed (+3106 additions, -81 deletions)

View changed files

📝 docs/apktool-resource-analysis.md (+21 -2)
📝 experiments/analysis-efficiency/README.md (+5 -0)
➕ experiments/analysis-efficiency/apktool-string-tables.json (+2675 -0)
➕ experiments/analysis-efficiency/apktool-string-tables.md (+171 -0)
📝 src/apktool/ApktoolProvider.test.ts (+32 -0)
📝 src/apktool/ApktoolProvider.ts (+1 -1)
📝 src/apktool/ApktoolStringTables.test.ts (+120 -63)
📝 src/apktool/ApktoolStringTables.ts (+11 -5)
📝 src/application/apktool/ApktoolResourceAnalysisService.test.ts (+1 -0)
📝 src/cli/apktoolCommands.ts (+5 -0)
📝 src/contracts/apktool/apktoolToolContracts.ts (+5 -1)
📝 src/domain/apktool/apktoolResourceAnalysis.ts (+22 -7)
📝 tests/boundary/cli/apktoolLocaleOption.test.ts (+23 -0)
📝 tests/boundary/mcp/apktoolMcp.test.ts (+14 -2)

📄 Description

Summary

The existing multi-locale decode repeats primary strings in both strings and string_tables. Add opt-in string_tables_only: true / --string-tables-only to return the requested strings once in typed tables, including single-table queries. Existing defaults and complete legacy replies stay unchanged.

Fixes #4982. Builds on the shared decode already merged in #4804.

Change and scope

The existing resource projection owner selects output and charges the aggregate entry budget for emitted copies. CLI/MCP share the domain contract and implementation. Table identities, counts, coverage, partial observations, alias reads and cleanup remain at that owner. No new tool, cross-call cache or target-execution authority.

Evidence and limits

Pinned measured report: production Linux CLI/MCP, Apktool 3.0.3/JDK 21, official NewPipe 0.29.1, ApiDemos 6.0.18 and small Appium Settings 8.2.1. Separate native XML decodes and independent Expat projection checks agree with the selected facts. Three complete legacy replies stay identical; three CLI Evidence identities, subjects and results match MCP.

Full resource reply bytes decrease about 26%/25%/12%; whole raw JSON token estimates, including catalog/extra calls, decrease 3.9%/3.7%/0.1%. Actual model usage is unmeasured. No consistent latency improvement is established: negative elapsed/CPU results, ranges and the pre-launch host-memory refusal are preserved. Each completed task uses one CPU, an 8 GiB family cap and early-stop protections. Binary ARSC decoder completeness and other platforms/providers are outside this verification.

Validation performed

  • 94 provider/projection/service source tests; nine compiled CLI/MCP boundary tests, including advertised schemas and option/Evidence forwarding.
  • 36 real MCP tasks, nine exact projection oracle pairs, three legacy full-reply comparisons and three real CLI parity tasks. Alias/missing, single-table, omitted-string, aggregate, cancellation and cleanup coverage retained.
  • npm run check:fast, npm run build:cached, npm run check, npm run docs:check (including five README tests), npm run verify:test-discovery (1,579 files exactly once).
  • Normal report-commit formatting and pre-push checks passed. Earlier expected feature-test failures and an authored lint failure are recorded separately in the report.

Author readiness

Human owner: @N0zoM1z0

The owner explicitly delegated preparation and initial-readiness entry in this session. The following diff/evidence review was performed by the agent under that delegation; independent human review of this final diff is not asserted.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4990 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `perf/4982-apktool-table-projection-20261018` --- ### 📝 Commits (2) - [`406af90`](https://github.com/morluto/rea/commit/406af90023a545fb280601bf51f445e122c36378) perf(apktool): avoid duplicated primary strings on request - [`6425657`](https://github.com/morluto/rea/commit/642565742421aa3dbcea53b0f616ad21c65f0381) test(perf): qualify Apktool table-only resource queries ### 📊 Changes **14 files changed** (+3106 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `docs/apktool-resource-analysis.md` (+21 -2) 📝 `experiments/analysis-efficiency/README.md` (+5 -0) ➕ `experiments/analysis-efficiency/apktool-string-tables.json` (+2675 -0) ➕ `experiments/analysis-efficiency/apktool-string-tables.md` (+171 -0) 📝 `src/apktool/ApktoolProvider.test.ts` (+32 -0) 📝 `src/apktool/ApktoolProvider.ts` (+1 -1) 📝 `src/apktool/ApktoolStringTables.test.ts` (+120 -63) 📝 `src/apktool/ApktoolStringTables.ts` (+11 -5) 📝 `src/application/apktool/ApktoolResourceAnalysisService.test.ts` (+1 -0) 📝 `src/cli/apktoolCommands.ts` (+5 -0) 📝 `src/contracts/apktool/apktoolToolContracts.ts` (+5 -1) 📝 `src/domain/apktool/apktoolResourceAnalysis.ts` (+22 -7) 📝 `tests/boundary/cli/apktoolLocaleOption.test.ts` (+23 -0) 📝 `tests/boundary/mcp/apktoolMcp.test.ts` (+14 -2) </details> ### 📄 Description ## Summary The existing multi-locale decode repeats primary strings in both `strings` and `string_tables`. Add opt-in `string_tables_only: true` / `--string-tables-only` to return the requested strings once in typed tables, including single-table queries. Existing defaults and complete legacy replies stay unchanged. Fixes #4982. Builds on the shared decode already merged in #4804. ## Change and scope The existing resource projection owner selects output and charges the aggregate entry budget for emitted copies. CLI/MCP share the domain contract and implementation. Table identities, counts, coverage, partial observations, alias reads and cleanup remain at that owner. No new tool, cross-call cache or target-execution authority. ## Evidence and limits [Pinned measured report](https://github.com/morluto/rea/blob/642565742421aa3dbcea53b0f616ad21c65f0381/experiments/analysis-efficiency/apktool-string-tables.md): production Linux CLI/MCP, Apktool 3.0.3/JDK 21, official NewPipe 0.29.1, ApiDemos 6.0.18 and small Appium Settings 8.2.1. Separate native XML decodes and independent Expat projection checks agree with the selected facts. Three complete legacy replies stay identical; three CLI Evidence identities, subjects and results match MCP. Full resource reply bytes decrease about 26%/25%/12%; whole raw JSON token estimates, including catalog/extra calls, decrease 3.9%/3.7%/0.1%. Actual model usage is unmeasured. No consistent latency improvement is established: negative elapsed/CPU results, ranges and the pre-launch host-memory refusal are preserved. Each completed task uses one CPU, an 8 GiB family cap and early-stop protections. Binary ARSC decoder completeness and other platforms/providers are outside this verification. ## Validation performed - 94 provider/projection/service source tests; nine compiled CLI/MCP boundary tests, including advertised schemas and option/Evidence forwarding. - 36 real MCP tasks, nine exact projection oracle pairs, three legacy full-reply comparisons and three real CLI parity tasks. Alias/missing, single-table, omitted-string, aggregate, cancellation and cleanup coverage retained. - `npm run check:fast`, `npm run build:cached`, `npm run check`, `npm run docs:check` (including five README tests), `npm run verify:test-discovery` (1,579 files exactly once). - Normal report-commit formatting and pre-push checks passed. Earlier expected feature-test failures and an authored lint failure are recorded separately in the report. ## Author readiness Human owner: @N0zoM1z0 The owner explicitly delegated preparation and initial-readiness entry in this session. The following diff/evidence review was performed by the agent under that delegation; independent human review of this final diff is not asserted. - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6713
No description provided.