Ambyte cost: size proven slices by their length and share literals instead of copying them

Aperta
#433 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
compilers

Direzione di ricerca

Start by reading issue #430 and the Baker Street finding F1 on #432, then trace Core typing for slice and the constant rule to identify what the Echo lowerer and verifier can read. Coordinate the spec, compiler, and Echo judge changes with a component promotion. Done means the two charges stay the same at bounds 32 and 4,352, judges accept the compiler minimum and reject one step or byte below it, and ReplaceRange's before and after costs are recorded.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement release:target-ir
.dag: issue-dag/2
.id: ambyte-lang/ambyte#433
.kind: task
.type: feature
.blocks: [flyingrobots/jim#5]
.after: [flyingrobots/amblicit#430]
.size_hours: 10

Outcome

Under edict.core-cost/v2, two allocation charges stop scaling with declared maxima that the program never reaches:

  1. A slice(b, s, e) whose length e - s is proven (constant bounds, or bounds that differ by a constant) produces a result sized at that length, not at b's bound, in steps and in allocation.
  2. A text or byte literal is shared from the package, like other shared values: it is charged its reference (one cell), not a full copy each time it is evaluated.

Why

This is the attribution on #430, for ReplaceRange on jedit#410 at 9e5863d (173,660,515 allocated bytes in total):

  • literals copied in full account for about 49.2M;
  • slice results for about 8.9M.

After #430, slice still charges its result at the operand's bound (Baker Street finding F1 on #432).

Scope

  • Core typing of the slice result, or a proven-length side fact, that Echo's lowerer and verifier can read. The spec, the compiler and every Echo judge change together, with a component promotion.
  • The constant rule, in the same way.

Test Plan

  • RED: the static charge of slice(b, 0, 4) grows with b's bound, and a fold that reads b"abcd" 100 times allocates the literal 100 times.
  • GREEN: both are the same at bounds 32 and 4,352. Echo's judges admit at exactly the compiler minimum and refuse one step or byte below it.
  • Record ReplaceRange's static steps and bytes before and after.
Lingua principale
Rust
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flyingrobots/edict

Tutte le issue di flyingrobots/edict

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.