An Approach for Embedding-Guided Function Reuse Detection in Embedded C Software
- URL: http://arxiv.org/abs/2608.04137v1
- Date: Tue, 04 Aug 2026 18:46:17 GMT
- Title: An Approach for Embedding-Guided Function Reuse Detection in Embedded C Software
- Abstract summary: This paper presents a domain-aware retrieval-augmented generation pipeline for embedded software reuse detection.<n>The pipeline enriches each function by extracting its existing inline comments, callgraph context, and a project before embedding it with eight backbone models.<n>The pipeline reveals that SonarQube produces a 93.6% false-positive rate as a reuse filter, with 83.5% of failures caused by hardware-environment mismatches.
- Score: 1.3114114427206678
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Reusing embedded software functions across products is economically valuable but technically difficult: the same functionality implemented for two different microcontroller platforms can be entirely incompatible at the hardware level, even when the functions score above 0.90 cosine similarity and both pass SonarQube quality checks. Static analysis tools were designed to measure code quality, not hardware-domain compatibility, and have no model of peripheral interfaces, hardware abstraction layer (HAL) dependencies, or register-map constraints. This paper presents a domain-aware retrieval-augmented generation (RAG) pipeline for embedded C software reuse detection that addresses the hardware-compatibility gap directly. The pipeline enriches each function by extracting its existing inline comments, call-graph context, and a project README before embedding it with eight backbone models (MiniLM, MPNet, BGE, E5, GraphCodeBERT, OpenAI text-embedding-3-small, LLaMA 3 8B, StarCoder2 3B) acting as feature extractors. Four hardware-compatibility validators---covering peripheral token overlap, parameter count parity, call-graph dependency overlap, and structural branching pattern---filter candidates directly in the retrieval stack. Evaluated on six public embedded C software projects (184 functions, 4,815 above-plateau pairs), the pipeline reveals that SonarQube produces a 93.6% false-positive rate as a reuse filter, with 83.5% of failures caused by hardware-environment mismatches that static analysis cannot detect. Manual verification of 40 rejected pairs confirms 97.5% validator accuracy, and a diagnostic rule-injection variant identifies the dominant failure categories (McNemar chi-squared~=~294.0, p~$<$~0.001).
Related papers
- MemToC: Benchmarking Memory-Tool Conflict Resolution in Large Language Models [49.47300047353726]
We introduce MemToC, a benchmark for post-tool-return arbitration with executable tools.<n>MemToC comprises 6,504 evaluation episodes constructed from 542 quality-controlled factual questions.<n>Across five open-weight 7-9B models, tool returns strongly dominate elicited closed-book answers.
arXiv Detail & Related papers (2026-08-26T18:22:03Z) - Benchmarking LLMs for Verilog Design Flows [6.24010225101442]
Large language models (LLMs) show promise in code generation, but their capabilities to produce correct, synthesizable hardware description language (HDL) code still remain to be properly benchmarked.<n>This paper presents a reproducible benchmarking platform that evaluates open-source LLMs on Verilog RTL generation.<n>The pipeline improved syntax validity from 0% to a 70.43% average and simulation pass rate to 51.8% across three open-source models.
arXiv Detail & Related papers (2026-07-23T21:00:38Z) - Graph-Based Structural Evaluation of LLM-Translated Adversary Emulation Procedures [0.0]
Adversary emulation plans describe multi-step attacker procedures using MITRE ATT&CK techniques.<n>The framework includes bipartite GED, a telemetry-intent that converts free text into observable classes.
arXiv Detail & Related papers (2026-07-13T13:04:23Z) - Efficient Visual Pointing for Embodied AI:Agent-Driven Data Synthesis, Cross-Block Attention, and Iterative Correction [55.11480729304395]
We describe our PointArena 2026 solution, which achieves 77.2% overall accuracy and ranks second on the benchmark.<n>The ap proach targets three failure modes. First, agent-driven syn thesis builds large semantic and anchor-relative candidate pools.<n>Second, a determinis tic steerable-data pipeline creates a verified 10,000-sample main set, plus reserve samples, using masks, templates, and path verification.
arXiv Detail & Related papers (2026-06-29T06:39:03Z) - What the LLM Should Not Say: Boundary-Aware Context Grounding for A Seven-Channel EEG Agent [8.617463707951673]
Large language models (LLMs) can make scientific software easier to use.<n>We present NeuraDock Agent, an open-source architecture that separates a deterministic local EEG engine from a hardware-aware language layer.
arXiv Detail & Related papers (2026-06-25T01:51:20Z) - Automated Semantic Fault Localization in SysML v2: A Human-in-the-Loop Framework Using Knowledge-Graph Augmented LLMs [0.11744028458220425]
This paper presents a human-in-the-loop framework for identifying and repairing semantic errors automatically.<n>It combines a fine-tuned Small Language Model (SLM) with a domain knowledge graph encoding physical compatibility rules between system elements.<n>We demonstrate the framework using the vehicle systems domain, where the knowledge graph captures the relationships between the mechanical, electrical, fluid, and signal interfaces.
arXiv Detail & Related papers (2026-06-22T14:20:11Z) - Understanding NPM Malicious Package Detection: A Benchmark-Driven Empirical Analysis [10.599261033874884]
NPM ecosystem has become a primary target for software supply chain attacks.<n>We conduct a benchmark-driven empirical analysis of NPM malware detection.<n>We build a dataset of 6,420 malicious and 7,288 benign packages annotated with 11 behavior categories and 8 evasion techniques.
arXiv Detail & Related papers (2026-03-29T07:04:31Z) - AlgoVeri: An Aligned Benchmark for Verified Code Generation on Classical Algorithms [54.99368693313797]
Existing benchmarks test only individual languages/tools, so the performance numbers are not directly comparable.<n>We address this gap with AlgoVeri, a benchmark that evaluates vericoding of $77$ classical algorithms in Dafny, Verus, and Lean.
arXiv Detail & Related papers (2026-02-10T06:58:26Z) - Plug-and-Play Benchmarking of Reinforcement Learning Algorithms for Large-Scale Flow Control [61.155940786140455]
Reinforcement learning (RL) has shown promising results in active flow control (AFC)<n>Current AFC benchmarks rely on external computational fluid dynamics (CFD) solvers, are not fully differentiable, and provide limited 3D and multi-agent support.<n>We introduce FluidGym, the first standalone, fully differentiable benchmark suite for RL in AFC.
arXiv Detail & Related papers (2026-01-21T14:13:44Z) - SemGuard: Real-Time Semantic Evaluator for Correcting LLM-Generated Code [46.20378145112059]
Post-hoc repair pipelines detect such faults only after execution.<n>We present SemGuard, a semantic-evaluator-driven framework that performs real-time, line-level semantic supervision.
arXiv Detail & Related papers (2025-09-29T09:21:32Z) - SOPBench: Evaluating Language Agents at Following Standard Operating Procedures and Constraints [59.645885492637845]
SOPBench is an evaluation pipeline that transforms each service-specific SOP code program into a directed graph of executable functions.<n>Our approach transforms each service-specific SOP code program into a directed graph of executable functions and requires agents to call these functions based on natural language SOP descriptions.<n>We evaluate 18 leading models, and results show the task is challenging even for top-tier models.
arXiv Detail & Related papers (2025-03-11T17:53:02Z) - Global Context Aggregation Network for Lightweight Saliency Detection of
Surface Defects [70.48554424894728]
We develop a Global Context Aggregation Network (GCANet) for lightweight saliency detection of surface defects on the encoder-decoder structure.
First, we introduce a novel transformer encoder on the top layer of the lightweight backbone, which captures global context information through a novel Depth-wise Self-Attention (DSA) module.
The experimental results on three public defect datasets demonstrate that the proposed network achieves a better trade-off between accuracy and running efficiency compared with other 17 state-of-the-art methods.
arXiv Detail & Related papers (2023-09-22T06:19:11Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.