ArchMigrate-Swift: A Compiler-in-the-Loop Retrieval-Augmented Multi-Agent Framework for Objective-C-to-Swift Migration
DOI:
https://doi.org/10.62051/khg1am73Keywords:
Program migration; Objective-C; Swift; Compiler feedback; Retrieval-augmented generation; Multi-agent systems; Executable evaluation.Abstract
Migrating Objective-C systems to Swift is not a token-level translation problem: API-name import rules, Foundation bridging, value semantics, optionality, collection behavior, and project-specific contracts interact with compiler constraints. This paper presents ArchMigrate-Swift, a compiler-in-the-loop, retrieval-augmented multi-agent framework that decomposes migration into schema retrieval, structural intent analysis, candidate generation, diagnostic repair, executable criticism, and evidence-based arbitration. The architecture is language-model agnostic; the released artifact instantiates every role deterministically so that the reported results do not depend on proprietary services or stochastic model drift. Because no established paired Objective-C–Swift benchmark with executable tests was identified, we introduce AMSwiftBench, a fixed-seed controlled benchmark containing 48 retrieval exemplars and 96 held-out Objective-C tasks spanning 12 migration families and eight lexical/structural difficulty modes. All generated Swift candidates are checked by Swift 6.2.1 and executed against public and hidden tests. In the controlled closed-schema setting, retrieval raises family identification from 94.8% to 100%; compiler repair raises compilation from 79.2% to 100%; and public-test-only arbitration raises end-to-end pass rate from 22.9% to 100%, at 190.3 ms amortized wall time per task. Exact McNemar analysis shows that the full system improves 63 of 96 tasks over retrieval plus compiler repair without regressions (p=2.17×10⁻¹⁹). These results establish the value of separating syntactic validity from semantic selection, while explicitly not claiming industrial end-to-end migration performance.
Downloads
References
[1] Apple Inc. (n.d.). Migrating your Objective C code to Swift. Apple Developer Documentation. Retrieved July 30, 2026.
[2] Apple Inc. (n.d.). Importing Objective C into Swift. Apple Developer Documentation. Retrieved July 30, 2026.
[3] Apple Inc. (n.d.). Improving Objective C API declarations for Swift. Apple Developer Documentation. Retrieved July 30, 2026.
[4] Gregor, D. (2016). SE 0005: Better translation of Objective C APIs into Swift. Swift Evolution.
[5] Swift.org. (n.d.). API design guidelines. Swift Documentation. Retrieved July 30, 2026.
[6] Rebouças, M., Pinto, G., Ebert, F., Torres, W., Serebrenik, A., & Castor, F. (2016). An empirical study on the usage of the Swift programming language. In Proceedings of the IEEE SANER (pp. 634–638). https://doi.org/10.1109/SANER.2016.66
[7] Domínguez Álvarez, D., Gorla, A., & Caballero, J. (2022). On the usage of programming languages in the iOS ecosystem. In Proceedings of the IEEE SCAM.
[8] Zak, L. (n.d.). SwiftRewriter: A source to source Objective C to Swift converter. GitHub repository. Retrieved July 30, 2026.
[9] Yandex. (n.d.). Migration toolkit for Swift. GitHub repository. Retrieved July 30, 2026.
[10] Rozière, B., Lachaux, M. A., Chanussot, L., & Lample, G. (2020). Unsupervised translation of programming languages. In Advances in Neural Information Processing Systems 33.
[11] Rozière, B., Zhang, J. M., Charton, F., Harman, M., Synnaeve, G., & Lample, G. (2022). Leveraging automated unit tests for unsupervised code translation. In Proceedings of the ICLR.
[12] Szafraniec, M., Rozière, B., Leather, H. J., Labatut, P., Charton, F., & Synnaeve, G. (2022). Code translation with compiler representations. arXiv preprint arXiv:2207.03578.
[13] Zhu, M., Jain, A., Suresh, K., Ravindran, R., Tipirneni, S., & Reddy, C. K. (2022). XLCoST: A benchmark dataset for cross lingual code intelligence. arXiv preprint arXiv:2206.08474.
[14] Puri, R., et al. (2021). CodeNet: A large scale AI for code dataset for learning a diversity of coding tasks. In NeurIPS Datasets and Benchmarks.
[15] Khan, M. A. M., Bari, M. S., Do, X. L., Wang, W., Parvez, M. R., & Joty, S. (2024). XCodeEval: An execution based large scale multilingual multitask benchmark for code understanding, generation, translation and retrieval. In Proceedings of the ACL (pp. 6766–6805).
[16] Feng, Z., et al. (2020). CodeBERT: A pre trained model for programming and natural languages. In Findings of EMNLP (pp. 1536–1547).
[17] Guo, D., et al. (2021). GraphCodeBERT: Pre training code representations with data flow. In Proceedings of the ICLR.
[18] Wang, Y., Wang, W., Joty, S., & Hoi, S. C. H. (2021). CodeT5: Identifier aware unified pre trained encoder decoder models for code understanding and generation. In Proceedings of the EMNLP (pp. 8696–8708).
[19] Ahmad, W. U., Chakraborty, S., Ray, B., & Chang, K. W. (2021). Unified pre training for program understanding and generation. In Proceedings of the NAACL HLT (pp. 2655–2668).
[20] Lachaux, M. A., Rozière, B., Szafraniec, M., & Lample, G. (2021). DOBF: A deobfuscation pre training objective for programming languages. In Advances in Neural Information Processing Systems 34.
[21] Lewis, P., et al. (2020). Retrieval augmented generation for knowledge intensive NLP tasks. In Advances in Neural Information Processing Systems 33 (pp. 9459–9474).
[22] Madaan, A., et al. (2023). Self Refine: Iterative refinement with self feedback. In Advances in Neural Information Processing Systems 36.
[23] Shinn, N., Cassano, F., Gopinath, A., Narasimhan, K., & Yao, S. (2023). Reflexion: Language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems 36.
[24] Wu, Q., et al. (2024). AutoGen: Enabling next gen LLM applications via multi agent conversation. In Proceedings of the COLM.
[25] Hong, S., et al. (2024). MetaGPT: Meta programming for a multi agent collaborative framework. In Proceedings of the ICLR.
[26] Qian, C., et al. (2024). ChatDev: Communicative agents for software development. In Proceedings of the ACL (pp. 15174–15186).
[27] Huang, D., Bu, Q., Zhang, J. M., Luck, M., & Cui, H. (2023). AgentCoder: Multi agent based code generation with iterative testing and optimisation. arXiv preprint arXiv:2312.13010.
[28] Bouzenia, I., Devanbu, P. T., & Pradel, M. (2025). RepairAgent: An autonomous, LLM based agent for program repair. In Proceedings of the IEEE/ACM ICSE (pp. 2188–2200).
[29] Chen, M., et al. (2021). Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374.
[30] Le, H., Wang, Y., Gotmare, A. D., Savarese, S., & Hoi, S. C. H. (2022). CodeRL: Mastering code generation through pretrained models and deep reinforcement learning. In Advances in Neural Information Processing Systems 35.
[31] Ren, S., et al. (2020). CodeBLEU: A method for automatic evaluation of code synthesis. arXiv preprint arXiv:2009.10297.
[32] Zhao, W., Chen, T., Yang, J. S., & Qiu, L. (2026). AutoML Pipeline: A RAG enhanced code generation framework with pre validation for cloud native machine learning workflows. IEEE Access, 14, 41932–41945. https://doi.org/10.1109/ACCESS.2026.3673923
[33] Mo, T., Zhang, C., Zou, J., Guo, Z., & Rhee, M. (2026). Self evolving AI agents with dual memory for automated software testing and bug localization. IEEE Access, 14, 111086–111102. https://doi.org/10.1109/ACCESS.2026.3713401
[34] Rhee, M., Zou, J., Mo, T., Teng, D., & Yang, J. S. (2026). Enhancing web search agents with self play contrastive fine tuning. IEEE Access. https://doi.org/10.1109/ACCESS.2026.3717594
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Transactions on Computer Science and Intelligent Systems Research

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.








