CRUSTPairs: A Cross-Language Dataset of Paired C and Rust Solutions
Vojtech Hejlek, Leonardo Jesus Almeida, Alneu de Andrade Lopes
Abstract
C-to-Rust migration is an active agenda, but no dataset pairs the two languages at the level of whole solutions to a shared problem. We present CRUSTPairs, 1857 C/Rust implementation pairs drawn from competitive programming archives, normalised, deduplicated, and stratified into difficulty tiers by zero-shot cross-language embedding similarity, with perrecord provenance and licensing. Cross-language retrieval is hard on this data, and harder than a single baseline would suggest: TF-IDF over shared identifiers reaches MRR 0.21 and so beats a pretrained code model at 0.19, which on the hardest quarter of the data scores 1.7x chance. Finetuning reaches 0.79, and lifts that hardest quarter 10x. Renaming every user identifier settles what is being learned: the finetuned models keep 96-97% of their accuracy without them, while the pretrained model keeps 66\% - less than the lexical baseline does - and on structurally divergent pairs the finetuned models are better without identifiers than with them.
Create a lesson
Metadata
- Categories
- cs.SE, cs.LG
Related papers
CratesBump: A Version-Bump Dataset for the Rust Ecosystem
Shared title terminologycs.SEMuhammad Hassnain
From Language-Specific to Cross-DSL: Semantic-Role-Guided Model Completion with LLMs
Shared title terminologycs.SEMeriem Ben Chaaben, Théo Giraudet, Benoit Combemale et al.
Beyond Source Code: Evaluating Natural Language Specifications for LLM-Based C-to-Rust Translation
Shared title terminologycs.SEBiruk Tadesse, Lawrence Arkoh, Marcelo D'Amorim et al.
Interrupt-Aware Static Detection of Deadlocks in Rust Operating Systems
Shared title terminologycs.SEYuzhi Li, Hongliang Tian, Chengjun Chen et al.
ReproShift: Cross-Version Adaptation of Linux Kernel Fuzzing Crash Reproducers
Shared title terminologycs.SEChangjian Liu, Zhiwen Tang, Xianying Wang et al.
ReqSeek: Transformer-Based Automatic Requirements Identification for Building Large Requirements Datasets
Shared title terminologycs.SEMohammad Kasra Habib, Umm-e-Habiba, Daniel Graziotin et al.