VSC-WebGPU: A Selenium-based VS Code Extension For Local Edit And Cloud Compilation on WebGPU

Hao Bai

Abstract

With the rapid development of information transmission, Software as a Service (SaaS) is developing at a rapid speed that everything originally local tends to be transplanted onto servers and executed on the cloud. WebGPU is such a SaaS system that it holds the GPU-equipped server to execute students' CUDA code and releases the RESTful front-end website for students to write their code on. However, programming on an HTML-based interface is not satisfactory due to a lack of syntax highlighting and automatic keyword complement. Visual Studio Code is now becoming the most popular programming interface due to its strong community and eclectic functionalities. Thus, we propose such a system that, students write code locally using VS Code with its coding-auxiliary extensions, and push the code to WebGPU with only one button pressed using our VSC-WebGPU extension. The extension is divided into 4 parts: the login process, the pull process, the push process, and the exit process. This 4-step architecture is also applicable for any other automated tools to push local code to authorization-required SaaS systems using Web automata.

Introduction

The rise of Software as a Service (SaaS) has moved many specialized computing tasks to the cloud. A prime example is WebGPU, a system used at UIUC that provides students with a GPU-equipped server to run CUDA C++ code. While this solves the hardware accessibility problem, it introduces a "developer experience" problem: the web-based editors provided by these platforms often lack essential features like syntax highlighting, intelligent code completion, and advanced tabbing.

Students are often forced to choose between a subpar web interface or the tedious manual process of writing code locally and copy-pasting it into a browser. VSC-WebGPU addresses this friction by creating an automated pipeline that treats the web interface as a remote backend for the local VS Code editor.

System Architecture

The VSC-WebGPU extension acts as a bridge between the local development environment and the cloud-based compilation platform. The architecture coordinates interactions between VS Code, a Selenium-controlled browser instance, and the remote CentOS server.

System Architecture

The system utilizes restPull() to synchronize code from the server to the local IDE. The seleniumPush() mechanism then automates the browser to inject local changes back into the web interface, which subsequently uses its builtinPush() to execute the code on the GPU backend.

Functional Workflow

The extension's logic is organized into a structured four-step architecture designed for reliability and automation. This workflow handles the complexities of authentication and state synchronization.

Functional Flowchart
  1. Login: Automatically retrieves credentials and logs the user into the WebGPU portal.
  2. Pull: Uses the platform's RESTful API to download the latest code version to the local workspace.
  3. Push: Simulates human interaction via Selenium to focus the browser, select text, and "paste" local code into the web editor before triggering compilation. This process may be repeated multiple times during a development session.
  4. Exit: Safely terminates the browser driver and connection.

Technical Implementation and Insights

A key technical innovation is the "Train Method" for inputs. Because web-based code editors often use non-standard HTML elements (like <a> tags) that are incompatible with standard Selenium sendKeys() commands, the extension sends a serialized "train" of keyboard events (e.g., Ctrl+A, Ctrl+V) directly to the browser event loop.

Additionally, the system optimizes performance through Explicit Waiting. By targeting specific UI elements rather than waiting for entire page loads (Implicit Waiting), the extension minimizes latency during the automated interaction cycle. This ensures that the "push" operation is fully complete before the system attempts to read output messages.

Conclusion

VSC-WebGPU successfully demonstrates how Selenium can be used as middleware to turn a GUI-only web application into a programmable backend for a local IDE. While current limitations include the requirement for a visible browser window ("headed" mode) and sensitivity to network delays, the 4-step architecture provides a robust template for automating interactions with any authorization-required SaaS system.

Summary updated

Abstract

With the rapid development of information transmission, Software as a Service (SaaS) is developing at a rapid speed that everything originally local tends to be transplanted onto servers and executed on the cloud. WebGPU is such a SaaS system that it holds the GPU-equipped server to execute students&#x0027; CUDA code and releases the RESTful front-end website for students to write their code on. However, programming on an HTML-based interface is not satisfactory due to a lack of syntax highlighting and automatic keyword complement. On the other side, Visual Studio Code is now becoming the most popular programming interface due to its strong community and eclectic functionalities. Thus, we propose such a system that, students write code locally using VS Code with its coding-auxiliary extensions, and push the code to WebGPU with only one button pressed using our VSC-WebGPU extension. The extension is divided into 4 parts: the login process for automatically logging the student into WebGPU, the pull process that pulls the code down to the local workspace, the push process that copies the code to the browser for compiling and running, and the exit process to exit the browser and close the connection. This 4-step architecture is also applicable for any other automated tools to push local code to authorization-required SaaS systems using Web automata.
BibTeX
@inproceedings{bai2021vsc,
  author = {Hao Bai},
  title = {{VSC-WebGPU: A Selenium-based VS Code Extension For Local Edit And Cloud Compilation on WebGPU}},
  booktitle = {2021},
  year = {2021},
  doi = {10.1109/icftic54370.2021.9647189},
}
Figure