Skip to content

Use single-selection mapper API for default Classic facade mapping #259

Closed

Description

@opaopa6969

Problem

Tiny f8a0909 + parser faccb2c9 rejects comparison-heavy-x64 (11,456CP) with E-MAPPING-LIMIT: preferred candidates even though the same committed CST maps successfully with the existing single-selection public API and complete source span. complex-x64 additionally triggers a separate quadratic reachability guard upstream. Both inputs are established positive JMH FacadeState fixtures. Existing Classic benchmark manifest13 does not contain x64; those smaller successful observations are not changed.

P4SourceMapping.mapOnce eagerly asks generated mapParsedTree/mapSubtreeTree for every candidate, even when the caller requested only default selection. This needlessly applies the bounded full-inventory4096cap to a one-result production use. Related parser#197/#184 and Tiny#256; no grammar/root-choice/retry changes belong in this issue.

Acceptance criteria

  • Add a default-only adapter using existing selectParsedTokenWithSourceMap/selectSubtreeTokenWithSourceMap (legacy capability fallback unchanged), mapping exactly once and retaining the selected AST/owned source for repeated default selection.
  • Use one retained default AST when allowDefault=true; preserve the facade's existing implicit candidate order, whole-source filtering, fallback, AST and selectionMode by selecting whole-source wrapper nodes already present in that AST. A default request has nonempty implicit candidates, so candidates.isEmpty() is not a valid discriminator. Explicit result preferences continue using the existing full-inventory path. Explicit preferred snapshot remains on existing API/candidate4096/work limits; no fallback retry on projection failure, no reparse, no cap increase.
  • Compare the old full-inventory selection and single-AST implicit selection on the same committed CST across the existing corpus (including every eligible whole-source implicit preference), with independent small expected AST/mode and large x64 outcomes. Test root/alternate/legacy capability paths, same AST instance/snapshot on repeated default selection, source CP/full-span, exceptions propagated, no inventory API call, no preferred-cap bypass.
  • Reproduce established x64 default input acceptance on fixed Java21 artifact without claiming all explicit-preferred large inventories are supported. The independent upstream guard fix handles complex-x64. Keep Java/Rust actual production facade semantics/CP oracle and existing shared corpus tests, separate from Classic SAFE performance. Coordinate source changes with concurrent Tiny256 facade projection.
  • Validate relevant P4 source-mapping/diagnostics and Java/Rust shared acceptance tests, preserve backend pins/production grammar and memo defaults. Archive hashes/source revision/raw outcomes; no dedicated-host latency claim.

One reversible adapter-only unit; PR closes this issue, not parser197/184 or Tiny256.

Integration boundary

Tiny #256 changes canonical root projection and removes parse retries independently. Keep its projection when composing this adapter; do not treat default AST alone as the final facade result. Java Classic uses this Java adapter; the Java UBNFC and Rust facade APIs are unchanged and remain shared-corpus comparison oracles. Public all-candidate inventories remain bounded, and no dedicated-host performance claim follows from these shared-host semantic checks.

Activity

  1. opaopa6969 commented on Oct 17, 2026

    @opaopa6969
    OwnerAuthor

    Source candidate: 7179fe54eb45e3d66a89aff565c8e81b60cc415c, based on #256 dependency caec4615 (which includes #257/#258). Root owns final CI wiring / dependency order / PR / merge.

    The default request's nonempty implicit preferences now select retained whole-source wrapper nodes from one owned default mapping, in their existing order. Explicit preferred requests retain the existing inventory path. Only API absence, including missing legacy source-span capability, uses the historical compatibility path; failed mapping never retries. #256 canonical projection is preserved.

    Java21 candidate parser source de53a229 /3.3.0: 49 tests, failure/error/skip0; old/new same-CST oracle324 accepted +12 independent parse failures +4 inventory-limit rows (2unique x64 positives); facade350 rows fully agree (328same/22both-reject). The two large positives have independent pinned hash/CP/root/mode expectations and still reject explicit full inventories at4096. Rust1.85 consumes the same two files through public parse, owns complete AST/CP across subsequent valid/invalid parses; 1test/2inputs GREEN, Clippy -Dwarnings and rustfmt GREEN.

    Actual current CI dependency fc75fe1e /3.3.0-SNAPSHOT: regenerated and compiled without relabelling, 29 compatibility tests including all350 parity rows GREEN. Its generated mapper predates MappingGuard and4096 inventory caps, so this is not evidence for newer bounded guards. Root will add a dedicated fixed-upstream680 artifact gate; do not skip those bounded large assertions or merge this dependency before upstream682 is confirmed.

    Raw logs / XML / hashes / capabilities: /tmp/tiny-default-mapper-evidence/README.md, handoff-summary.json, dependencies.json. Shared-host semantic checks only (measurement_eligible=false), no final dedicated-host performance claim; parser#197/#184 remain open.

  2. opaopa6969 commented on Oct 17, 2026

    @opaopa6969
    OwnerAuthor

    PR #261 のCI失敗を修正しました。

    歴史依存と新しい上限検証の契約を分離

    現HEAD 419d275fdd9fb2f96af5ec5ebd9899f67475e525。従来parserを使う通常CIで、新しいbounded inventoryの拒否を必須にしていたテスト設定を修正しました。通常互換検証は328入力のAST/位置/選択modeと固定12拒否を照合し、capを許す入力も既知の大入力2種類だけに限定します。新しい P4BoundedMappingConformance は固定bee依存の専用CIで明示実行し、324比較+4cap拒否・両大入力のE-MAPPING-LIMITを厳密に検証します。専用CIの件数・失敗・skip検査にも追加済みです。製品コード、資源上限、旧依存pin、通常CIジョブは変更していません。

    fc75/3.3.0-SNAPSHOTの通常49件とbee/3.3.0の専用検証を含む51件が失敗/skip 0。厳格2件を旧依存で意図的に実行すると、期待件数とcap拒否の欠落により両方が失敗する負検証も確認しました。actionlint成功。Maven依存は別々の専用repoで固定しJAR hashを照合しています。Rust製品/fixtureは前回検証sourceと同一で、Rust再実行は今回の主張に含みません。

    履歴互換と新契約をそれぞれ検証する最小のtest/CI修正を選択しました。本PR単位でrevertできます。parser #682 merge、現HEADの全CI成功、Tiny側mergeはまだ必要です。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions