71 lines
2.1 KiB
Markdown
71 lines
2.1 KiB
Markdown
# PR-19.7 - PBS Lowering for IRBackend Globals and Synthetic Callable Model
|
|
|
|
## Briefing
|
|
|
|
As decisions de topic `19` fixaram que globals e artifacts de lifecycle precisam ficar explicitos no `IRBackend`, sem materializacao tardia implicita.
|
|
|
|
Esta PR faz o primeiro corte de lowering:
|
|
|
|
1. introduz globals explicitos no handoff,
|
|
2. introduz callables sinteticos com kind proprio,
|
|
3. introduz origin metadata sintetica suficiente para remapear diagnosticos.
|
|
|
|
## Target
|
|
|
|
Implementar no lowering PBS -> `IRBackend`:
|
|
|
|
1. modelagem explicita de backend globals,
|
|
2. distincao entre callables userland e callables sinteticos,
|
|
3. kinds sinteticos obrigatorios,
|
|
4. attribution/origin metadata para artifacts sinteticos.
|
|
|
|
## Dependencies
|
|
|
|
Prerequisitos diretos:
|
|
|
|
1. `PR-19.1`
|
|
2. `PR-19.5`
|
|
3. `PR-19.6`
|
|
|
|
## Scope
|
|
|
|
1. Introduzir globals explicitos no `IRBackend`.
|
|
2. Introduzir `FILE_INIT_FRAGMENT`, `MODULE_INIT`, `PROJECT_INIT` e `PUBLISHED_FRAME_WRAPPER` como identidade estrutural.
|
|
3. Introduzir `SyntheticOrigin` ou equivalente.
|
|
4. Preservar remap para spans reais quando houver origem defensavel.
|
|
|
|
## Non-Goals
|
|
|
|
1. Nao publicar ainda o wrapper final em `func_id = 0`.
|
|
2. Nao fechar ainda `FRAME_RET` ownership path.
|
|
3. Nao fechar ainda conformance final.
|
|
|
|
## Method
|
|
|
|
1. Modelar globals e callables sinteticos como first-class artifacts.
|
|
2. Evitar conventions baseadas apenas em nome textual.
|
|
3. Garantir que diagnosticos prefiram spans reais em vez de spans sinteticos.
|
|
|
|
## Acceptance Criteria
|
|
|
|
1. `IRBackend` passa a carregar globals explicitamente.
|
|
2. Callables sinteticos possuem class identity observavel.
|
|
3. Artifacts sinteticos carregam attribution suficiente para remap de diagnosticos.
|
|
4. O lowering nao depende de magic late-stage para globals/lifecycle.
|
|
|
|
## Tests
|
|
|
|
1. Fixtures de lowering com inspecao do `IRBackend`.
|
|
2. Verificacao de kinds sinteticos presentes.
|
|
3. Verificacao de origin metadata e remap defensavel.
|
|
|
|
## Affected Artifacts
|
|
|
|
1. lowering PBS -> `IRBackend`
|
|
2. modelo `IRBackend`
|
|
3. testes de lowering/attribution
|
|
|
|
## Open Questions
|
|
|
|
1. Nenhuma. Wrapper publication fica para `PR-19.8`.
|