Files
prometeu-studio/discussion/lessons/DSC-0111-pbs-production-reproductions-and-fixes/LSN-0106-pbs-production-binding-and-lowering-corrections.md
bquarkz 71fb80efc3
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/Prometeu/Studio/pipeline/head There was a failure building this commit
feat(studio): ship JavaFX 2 Play and delegate integration tooling
Launch the JavaFX 2 project shell on Java 25 with an interactive viewport,
managed Play lifecycle and project mutation guards. Preserve headless/MCP and
save compatibility, and qualify exact runtime executable bundles.
Separate unit JaCoCo gates from opt-in integration suites and use the internal
Pong fixture for the headless visual pilot.
Move maintenance and native conformance tools into tooling; retain the VS Code
extension and update current navigation links.

Validation: tooling make verify passed, including 1064 Studio unit tests,
JaCoCo thresholds and 22 headless integration tests.
2026-11-19 17:32:03 +00:00

14 KiB
Raw Permalink Blame History

id, ticket, title, created, tags
id ticket title created tags
LSN-0106 pbs-production-reproductions-and-fixes PBS Production Binding and Lowering Corrections 2026-11-10
compiler
pbs
bugfix
testing

Scope and outcome

Domain owner: compiler/pbs. Discussion: DSC-0111. This lesson consolidates accepted DEC-0088 and completed PLN-0166. It covers all eight reproduced failures, the complete unchanged 28-case corpus, and the compiler-to-guest qualification. The umbrella records the completed coordination of the integrated result.

All eight valid programs now compile and execute with their original source files, names, imports and module boundaries. The other 18 valid programs retain their behavior. File-private access remains a source rejection, and the deliberate runtime trap still faults. No language, visibility, initialization, ABI, PBX or runtime capability was added.

The implementation started after the completed compiler and Studio diagnostic deliveries (LSN-0104 and LSN-0105). On 2026-11-10, the user accepted their submitted evidence and released the dependency gate by directing: “vamos impl o plan 166 dado que agora podemos.” That release was recorded in PLN-0166 and AGD-0106 before product edits.

Why these programs failed

The production investigation reduced Zelda feedback to five families and 28 cases. Eight valid programs failed in the PBS frontend before IRVM. Equivalent controls passed when authors introduced locals, combined files or renamed a private type. Those transformations isolated defects; they were never accepted as required authoring conventions.

Group Corrected cases Demonstrated cause and correction
PBS-EXPRESSION-CONTEXT F1-direct, F1-two-calls, F1-service-this An enclosing bool expectation constrained an int-valued comparison operand. Infer operands outside that enclosing expectation, then lower each using its inferred or contextually required operand type.
PBS-MODULE-PEER-SURFACE F3-function, F3-global, F3-service Sibling semantic context omitted admitted ordinary executable bindings. Carry declaration/signature admission from module assembly and bind calls, storage and singleton accessors to their definitions.
PBS-NOMINAL-DEPENDENCY F4-same-dependency, F4-same-direct Name-only owner lookup and an unscoped synthetic receiver lost declaration identity when a dependency supplied a private homonym. Resolve owners and imported callables by canonical declaration origin and retain definition scope on receivers.

The original inventory retains 168 compilation observations and 76 guest executions of the then-compilable programs. The initial integrated regression reproduced exactly eight failures among the 28 unchanged cases before these corrections.

Scope expected types to their expression

For return receiver.value() != 0, the return expects bool because the comparison produces bool. The operand call still returns int. Propagating the outer bool into callable selection caused a false rejection.

Comparison inference now temporarily clears the enclosing expectation, derives the operand types, and restores the context. Each operand is emitted with its own inferred type, using the opposite operand's known type where contextual selection needs it. Other expression boundaries retain legitimate expected-return overload selection.

Inference does not execute an operand. Emission still evaluates receivers and explicit arguments exactly once in the existing order. The original F2 controls and an additional order-sensitive control check effects; a focused bool/int overload control prevents an unconditional removal of expected-return matching from masquerading as a fix.

Carry visibility and executable identity together

Module assembly now obtains sibling declaration spans from the same signature/name/category interning keys used by barrel validation. Both mod and pub admit same-module access. Omission remains file-private. Admitting one overload does not admit every overload with the same spelling.

PbsImportedSemanticContextService supplies ordinary sibling functions, globals and service methods/accessors with references to their defining module and declaration. Caller-visible names remain distinct from the private dependencies needed to compile a definition's body. An implementation declaration is propagated only when its owner belongs to the current scope or the admitted sibling surface. Otherwise unrelated private implementations could arrive without their private contract types; bundled examples caught that regression during implementation.

Global references must resolve to one storage location. Lowering uses PBS-private temporary slot references for imported globals. After module aggregation, PbsGlobalReferenceLinker resolves them by defining file and global name to the original global slot, before publishing common IRBackend. It preserves the function metadata and semantic facts. It neither clones storage/initialization nor changes the common GET_GLOBAL/SET_GLOBAL contract. Own declarations retain normal shadowing.

Service method and singleton references similarly retain their original owner/accessor. The focused guest controls mutate a sibling global and observe that mutation through the defining function, and compare the sibling service with its defining accessor by reference identity. Successful compilation alone would not prove either property.

Validate nominal identity before choosing a fix

The pre-correction trace compared distinct names, homonyms without a dependency, homonyms with a dependency, and the local rename. In the dependency case, the declared receiver remained src/a/data.pbs, but a flat lookup selected src/b/data.pbs. The synthetic receiver key changed from pbs:struct:file3:0 to pbs:struct:file6:0. The other three controls retained the local owner. This confirmed the localized name-index hypothesis before the nominal correction.

The corrected path uses existing PbsContractTypes.declaration(TypeRef) and lexical binding data for struct/service ownership. Synthetic receiver types retain their defining function's span. Imported callable surfaces carry the owner declaration span so exact callable matching can distinguish owners with otherwise identical method shapes. Aliases keep the original declaration identity.

The post-correction trace shows the synthetic receiver and declared receiver sharing the local key. Its auxiliary raw flat-map observation still demonstrates the collision; the corrected owner lookup no longer uses that map as authority for a resolved nominal declaration. The regression separately asserts canonical owner equality. Numeric keys illustrate this single observation and are not stable IDs required across builds.

Qualification through production boundaries

The structured qualification and evidence guide contain the commands, input hashes, reports and limits.

Gate Result
Frozen input 28 cases; SHA-256 0ad291942af21e990f5cae3348a5be368dee865aa2843ba0d0effd1a9136cb87; all 181 baseline files retained unchanged.
Complete compilation matrix 168 correctly classified observations: 28 cases × two compiler/SDK origins × three paths.
Source-negative control F3-file-private rejected as a source error in all six configurations.
Complete guest matrix 108 executions: 104 normal three-frame successes and four deliberate faults. Every worker terminated.
Additional behavioral/privacy matrix Seven cases, 42 compilation observations and 16 successful guest executions, including three negative privacy cases.
Required Gradle suites 724 tests recorded, 711 passed, 13 skipped, zero failures/errors.
Producer-to-consumer integration Real project LSP and authenticated HTTP MCP: the eight corrected programs plus F1-local succeed; F3-file-private retains structured rejection, facts, revisions and canonical projection.

Compilation paths are optimized production stages, an investigation-only unoptimized stage sequence, and the public optimized facade. Each observation uses a fresh JVM and scratch project. The unoptimized variant omits OptimizeIRVMPipelineStage and passes original IRVM to emission; it is not a public compiler option. Guest runs cover both stage variants and both origins.

Installed probes run outside the checkout with only the candidate distribution's product JARs/resources. The runner checks product classes against those JARs and records actual frontend/pipeline/SDK origins, Java version, JAR hashes and source/PBX/manifest hashes. Git HEAD alone would be insufficient because this candidate includes uncommitted work; worktree state and source hashes accompany the artifact provenance.

The existing debug headless executable is identified by SHA-256 a0cb4b16a46634d56ffd7ae5f142017158165f297ddf4925c19da34166482ee6. It reports runtime 0.1.0 and protocol 1.1. The harness negotiates only supported boot/advance/state/fault/shutdown capabilities, checks completed frames and faults, then waits for termination. No runtime source, game workspace or user memcard was written, and no commit was created.

Retain diagnostics while removing false rejection

The earlier diagnostic delivery intentionally recorded all eight rejections. Its evidence remains historical and unchanged. Current regression expectations now reflect the corrected valid programs. PbsFacadeDiagnosticTest uses the unchanged F3-file-private program for an actual source-negative result. StructuredDiagnosticsIntegrationTest verifies positive build/analysis results and the negative control through existing public services.

Diagnostic ownership, stable detector IDs, source attribution and failure classifications remain those of the preceding deliveries. Shipper remains internal. AI consumers continue using the specialized public automation/MCP services and the same result projected by the FE. A correctness fix does not require another public diagnostic schema or treating missing/failed analysis as an empty successful result.

Limits and recurring pitfalls

  • The historical MARSHAL_VERIFY_PRECHECK_BAD_RET_STACK_HEIGHT and Unsupported PBS runtime type: Scene failures remain not reproduced in their original failing forms. Passing F2/F5 controls does not establish a general correction of those reports.
  • Installed compiler/SDK proof with this existing headless executable does not qualify an installed runtime distribution. The corpus matrix itself does not establish a live Studio/LSP/MCP session; the separate repository integration test supplies the stated consumer evidence.
  • This execution did not repeat an interactive desktop session. The first delivery's JavaFX proof and its explicit pack/assets/configuration-revision limits remain in LSN-0105.
  • Never fix a contextual-type bug by deleting all contextual resolution, a visibility bug by admitting all same-name overloads, or a nominal bug by requiring globally unique author names.
  • Do not copy sibling globals or singleton initialization to make names visible. Preserve the defining storage/accessor and verify identity through observable behavior.
  • Keep private dependency context separate from caller-visible names. Unconditionally injecting unrelated private implementation declarations can break otherwise valid modules.
  • A loader failure, timeout or partial frame count is neither successful guest execution nor the required source rejection. Keep the deliberately faulting control and check cleanup on every path.
  • Archive before/after evidence separately. The baseline's fixed-output research scripts are retained as historical artifacts; use the maintained runner with a new output directory for subsequent qualification.

Maintenance references

Normative obligations are propagated to PBS 4 — Static Semantics, 12 — Diagnostics, and 13 — Lowering IRBackend. Existing PBS 3 — Core Syntax, 5 — Resolution, and 9 — Dynamic Semantics remain authoritative for the unchanged language contracts.

Durable regressions live in PbsProductionLoweringRegressionTest, PbsNominalOwnerRegressionTest, and the unchanged corpus resource. The maintained runner guide describes reproduction. DEC-0088 and PLN-0166 are completed control artifacts consolidated here; their workflow files are removed by CLI housekeeping.