Single-byte counter support in coverage instrumentation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia leggendo la proposta e l’RFC di LLVM collegato sui contatori a un singolo byte, quindi esamina le due questioni ancora attive nei commenti dell’issue. Non vengono indicati file sorgente o test; essere completato per primo significa risolvere le questioni di progettazione e portare l’MCP attraverso la revisione prima di definire il lavoro di implementazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Proposal
I propose extending rustc's -C instrument-coverage to allow support for LLVM's single-byte counters. No defaults would be changed, but -C instrument-coverage=counter would become the "canonical" variant of the current default.
Specifically, I propose -C instrument-coverage=presence-only as an opt-in mechanism for switching to single-byte counters. This option would be guarded behind -Z unstable-options.
(The name presence-only is picked as a happy medium -- "counters" is confusing in a context where the coverage is binary, and "presence" alone would also be confusing because all coverage is presence.)
Background and motivation
Per https://github.com/llvm/llvm-project/pull/75425, single-byte counters are available in LLVM 19.1.0 and later. The equivalent clang frontend specific option for this is currently tucked behind an -mllvm passthrough, e.g. -mllvm -enable-single-byte-coverage.
The main advantage to single-byte counters is performance: LLVM's own (older) benchmarks show a 3-5% runtime improvement on x86(-64) platforms, and a much more dramatic 40-60% runtime improvement on ARM(-64) platforms. Single-byte counters also significant improve code size, since the instrumentation only needs to inject 8-bit counters rather an 64-bit ones.
The main disadvantage to single-byte counters is a decrease in fidelity: single-byte counters no longer track actual block hit counts, and instead only offer a binary "covered or not." This makes them unsuitable for use cases where the "heat" of covered regions is important, but perfectly suitable for use cases where line/block coverage is the primary concern.
Mentors or Reviewers
None yet. This is my first non-trivial compiler-side contribution to Rust, so I would appreciate a reviewer who is familiar with this part of the compiler.
Process
The main points of the Major Change Process are as follows:
- File an issue describing the proposal.
- A compiler team member who is knowledgeable in the area can second by writing
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.- Refer to Proposals, Approvals and Stabilization docs for when a second is sufficient, or when a full team FCP is required.
- Once an MCP is seconded, the Final Comment Period begins.
- Final Comment Period lasts for 10 days after all outstanding concerns are solved.
- Outstanding concerns will block the Final Comment Period from finishing. Once all concerns are resolved, the 10 day countdown is restarted.
- If no concerns are raised after 10 days since the resolution of the last outstanding concern, the MCP is considered approved.
You can read more about Major Change Proposals on forge.
[!CAUTION]
Concerns (2 active)
Managed by
@rustbot—see help for details.
- Lingua principale
- HTML
- Stelle
- 436
- Fork
- 76
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-lang/compiler-team
-
major-change T-compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
rust-lang/compiler-team#1009 · 1 commento · 3 reazioni ·
-
final-comment-period major-change T-compiler to-announce
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rust-lang/compiler-team#1051 · 2 commenti · 1 reazione ·
-
final-comment-period major-change T-compiler
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
rust-lang/compiler-team#1050 · 6 commenti · 5 reazioni ·
-
final-comment-period has-concerns major-change T-compiler
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
rust-lang/compiler-team#1049 · 8 commenti ·
-
major-change T-compiler
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
rust-lang/compiler-team#1048 · 1 commento ·
Tutte le issue di rust-lang/compiler-team
Issue simili
-
bug core-lang
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Call-argument syntax diagnostic needs example spacing and removal of confusing trailing sentenceAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mw00/project-maya#1368 ·
I maintainer di solito rispondono entro 2 giorni
-
test(bind-json): legacy Solidity fixture requires an unavailable solc on Linux ARM64Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
foundry-rs/foundry#18828 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno