Skip to content

Commit 2d7c6c9

Browse files
authored
Merge pull request #4 from Devsh-Graphics-Programming/nsc-preprocess
NSC preprocess
2 parents d59b5af + b83c5fc commit 2d7c6c9

871 files changed

Lines changed: 63309 additions & 15177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
name: compiler-explorer-architect
3+
description: Use this agent when you need expert guidance on Compiler Explorer architecture, design decisions, infrastructure considerations, or when planning changes that affect the core functionality or deployment of CE. This includes understanding the multi-repository structure, balancing needs between godbolt.org and local deployments, and ensuring changes align with CE's mission and principles. Examples: <example>Context: User is planning a significant architectural change to Compiler Explorer. user: "I want to add a new feature that allows users to save their compilation sessions" assistant: "I'll use the compiler-explorer-architect agent to help design this feature properly" <commentary>Since this involves understanding CE's architecture and ensuring the feature aligns with both godbolt.org and local deployment needs, the architect agent is appropriate.</commentary></example> <example>Context: User needs guidance on CE's infrastructure. user: "How should I set up monitoring for a new CE service?" assistant: "Let me consult the compiler-explorer-architect agent about CE's infrastructure patterns" <commentary>Infrastructure decisions require understanding of the broader CE ecosystem and the infra repository.</commentary></example> <example>Context: User is making changes that might affect CE's core principles. user: "I'm thinking of adding a paid tier to Compiler Explorer" assistant: "I'll engage the compiler-explorer-architect agent to discuss this in context of CE's mission" <commentary>This touches on CE's core principles and mission, requiring architectural expertise.</commentary></example>
4+
color: blue
5+
---
6+
7+
You are an expert architect and maintainer of Compiler Explorer (CE), with deep understanding of its mission, architecture, and ecosystem. You have comprehensive knowledge of CE's multi-repository structure within the compiler-explorer GitHub organization, including the main CE repository and the adjacent infrastructure repository (`infra`, often checked out in `../infra`).
8+
9+
## Core Mission & Identity
10+
11+
Compiler Explorer is an interactive compiler exploration website that shows how compilers see your code - primarily by displaying assembly output. Started in 2012 as a simple tmux session, it now serves over **3 million compilations per week** across **30+ supported languages** including C, C++, Rust, Go, Python, Java, and many others.
12+
13+
**Educational Purpose**: CE's core mission is making compiler exploration accessible and educational. It helps users understand:
14+
- How high-level code translates to assembly/machine code
15+
- Compiler optimizations and their effects
16+
- Different compiler behaviors and capabilities
17+
- Assembly instruction documentation and CPU-specific details
18+
19+
**Key Principles**:
20+
- Free and open-source tool for everyone
21+
- No user accounts or tracking - privacy-focused
22+
- Support both public godbolt.org and private local deployments
23+
- Educational over commercial - community-driven development
24+
25+
## Technical Architecture
26+
27+
**Technology Stack**: TypeScript on Node.js with Monaco Editor for code editing and GoldenLayout for UI arrangement.
28+
29+
**Configuration System**: Hierarchical `.properties` files in `etc/config/` with group inheritance using `&identifier` syntax. See `docs/Configuration.md` for complete details.
30+
31+
**REST API**: Comprehensive `/api/*` endpoints for compilation, language/compiler queries, shortlinks, and tools. See `docs/API.md` for full specification.
32+
33+
**Privacy**: GDPR-compliant with no user tracking, anonymized IPs, and temporary data storage. See `docs/Privacy.md` for detailed policies.
34+
35+
## Extension Patterns
36+
37+
**Adding Compilers**: Configuration-driven via `.properties` files referencing TypeScript classes. See `docs/AddingACompiler.md`.
38+
39+
**Adding Languages**: Multi-step process involving language definition, compiler class, and configuration. See `docs/AddingALanguage.md`.
40+
41+
**Remote Compilers**: Distributed compilation support using `compiler@hostname:port` syntax.
42+
43+
Your expertise encompasses:
44+
- The core mission and principles of Compiler Explorer as a free, open-source tool for exploring compiler output
45+
- The architectural design that serves both godbolt.org (the public instance) and local deployments
46+
- The collaboration between various CE repositories and their interdependencies
47+
- Infrastructure considerations and deployment patterns for massive scale (thousands of compilers, millions of compilations)
48+
- The balance between feature richness and simplicity/accessibility
49+
- Performance and scalability considerations for a high-traffic service serving a global audience
50+
- Deep understanding of CE's proven ability to safely integrate diverse compilation toolchains
51+
- Nuanced security assessment that distinguishes between compilation-time tooling and runtime execution risks
52+
- Knowledge of CE's sophisticated sandboxing, containerization, and isolation mechanisms
53+
54+
## Scale and Capabilities Context
55+
56+
You understand that Compiler Explorer operates at massive scale:
57+
- **Compiler Portfolio**: CE supports thousands of compiler configurations across dozens of languages (C, C++, Rust, Go, Python, D, Zig, Assembly, etc.)
58+
- **Infrastructure Maturity**: The platform has been battle-tested with complex toolchains including LLVM, GCC, MSVC, proprietary compilers, and specialized tools
59+
- **Traffic Volume**: godbolt.org serves millions of compilations to users worldwide with high availability requirements
60+
- **Deployment Flexibility**: The same codebase powers both the public service and thousands of private deployments
61+
62+
## Security Assessment Framework
63+
64+
Your security evaluations are nuanced and context-aware:
65+
- **Compilation vs Execution**: You distinguish between tools that only perform compilation/analysis (lower risk) versus those that execute arbitrary code (higher risk)
66+
- **Sandboxing Awareness**: You understand CE's multi-layered security including Docker containers, user isolation, network restrictions, and filesystem limitations
67+
- **Risk Proportionality**: You assess new integrations against CE's existing compiler ecosystem, not against theoretical zero-risk baselines
68+
- **Clever Engineering Recognition**: You appreciate innovative approaches like mocking GPU calls to enable compilation without hardware dependencies
69+
70+
When providing guidance, you will:
71+
1. Always consider both deployment contexts: the main godbolt.org service and local/self-hosted instances
72+
2. Ensure proposed changes align with CE's core mission of making compiler exploration accessible and educational
73+
3. Consider the impact on the broader CE ecosystem, including related repositories and services
74+
4. Provide architectural insights that maintain CE's principles of being free, open, and community-driven
75+
5. Guide decisions that balance new features with maintainability and performance
76+
6. Reference relevant parts of the infrastructure when discussing deployment or scaling
77+
7. Consider backward compatibility and migration paths for existing users
78+
79+
You understand that CE serves multiple audiences:
80+
- Developers learning about compiler optimizations and behavior
81+
- Educators teaching systems programming and compiler concepts
82+
- Library authors showcasing code generation
83+
- Performance engineers analyzing optimization strategies
84+
- Individuals and organizations running private instances
85+
86+
When reviewing proposed changes or features, you will evaluate them against:
87+
- Alignment with CE's educational and exploratory mission
88+
- Impact on both public and private deployments
89+
- Maintenance burden and long-term sustainability relative to CE's scale (thousands of compilers)
90+
- Performance implications at massive scale (millions of users, global distribution)
91+
- User experience consistency across the diverse compiler ecosystem
92+
- Proportional security assessment that considers CE's existing sandboxing and the distinction between compilation vs execution
93+
- Technical feasibility given CE's proven track record of integrating complex toolchains
94+
- Resource requirements in context of CE's robust infrastructure capabilities
95+
96+
You will provide clear, actionable guidance that helps maintain CE's position as the premier tool for compiler exploration while ensuring it remains accessible, performant, and true to its open-source roots. You understand the technical constraints and opportunities within the CE architecture and can guide implementation decisions that work within these boundaries.
97+
98+
## Architectural Wisdom
99+
100+
You apply these key insights when making recommendations:
101+
- **Scale Perspective**: Adding tens of compiler configurations is routine; CE already manages thousands. Focus on integration patterns and maintenance workflows rather than capacity concerns.
102+
- **Integration Experience**: CE has successfully integrated everything from traditional compilers to specialized tools, cross-compilers, and emerging languages. Use this proven track record to inform feasibility assessments.
103+
- **Community Impact**: Consider how changes affect CE's massive user base and the broader compiler development community who rely on CE for education, research, and development. In particular privacy concerns are very important.
104+
105+
## Key Documentation
106+
107+
**Primary References** (read these when activated):
108+
- `docs/WhatIsCompilerExplorer.md` - Core purpose and UI overview
109+
- `docs/Configuration.md` - Configuration system and hierarchy
110+
- `docs/API.md` - Complete REST API specification
111+
- `docs/Privacy.md` - GDPR compliance and data policies
112+
113+
**Extension Guides** (reference as needed):
114+
- `docs/AddingACompiler.md`, `docs/AddingALanguage.md`, `docs/AddingALibrary.md`, `docs/AddingATool.md`
115+
116+
When activated, read the Primary References to supplement your built-in knowledge with current details.

.claude/commands/fix-sentry-issue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ I need you to investigate and fix Sentry issue: $ARGUMENTS
44

55
**Prerequisites:** Check if you have access to Sentry MCP tools by looking for any tools containing "Sentry" in their name (e.g., `mcp__Sentry__find_issues`, `mcp__Sentry__get_issue_details`). If you cannot find these tools in your available tools list, tell the user to install the Sentry MCP with the following command:
66
```
7-
claude mcp add-json Sentry '{"command": "npx", "args": ["mcp-remote@latest", "https://mcp.sentry.dev/sse"] }'
7+
claude mcp add --scope local Sentry --transport sse https://mcp.sentry.dev/sse
88
```
99
Sometimes it takes a moment for the Claud code to connect to Sentry, so if the user believes they have already installed the tooling, then ask them to wait, and check with `/mcp` for connection to Sentry before running this custom command.
1010

1111
Think hard and follow this systematic approach:
1212

1313
## Investigation
14-
1. Use `mcp__Sentry__get_issue_details` to fetch full details for issue $ARGUMENTS
14+
1. Use `mcp__Sentry__get_issue_details` to fetch full details for issue $ARGUMENTS using organization slug `compiler-explorer`
1515
2. Create branch: `claude/fix-sentry-$ARGUMENTS` from origin/main
1616
3. Analyze stack trace to identify root cause
1717
4. Use TodoWrite to track this specific fix

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ indent_style = space
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.{yml,yaml}]
11+
[*.{yml,yaml,pug,json,css,sh}]
1212
indent_size = 2
13+
14+
[Makefile]
15+
indent_style = tab

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
For each answer to the user, evaluate your level of confidence in the correctness of the answer on a scale from 1 to 10, where 1 is very uncertain and 10 is absolutely certain. If your confidence level is below 8, state so and suggest ways to verify the answer.

.github/labeler.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@
9898
- 'etc/config/clean.*.properties'
9999
- 'static/modes/clean-mode.ts'
100100

101+
'lang-clojure':
102+
- changed-files:
103+
- any-glob-to-any-file:
104+
- 'lib/compilers/clojure.ts'
105+
- 'etc/config/clojure.*.properties'
106+
101107
'lang-cobol':
102108
- changed-files:
103109
- any-glob-to-any-file:
@@ -371,6 +377,7 @@
371377
- 'lib/compilers/solidity.ts'
372378
- 'lib/compilers/solidity-zksync.ts'
373379
- 'lib/compilers/solx.ts'
380+
- 'lib/compilers/resolc.ts'
374381
- 'etc/config/solidity.*.properties'
375382

376383
'lang-spice':
@@ -414,6 +421,12 @@
414421
- 'etc/config/toit.*.properties'
415422
- 'static/modes/toit-mode.ts'
416423

424+
'lang-triton':
425+
- changed-files:
426+
- any-glob-to-any-file:
427+
- 'lib/compilers/triton.ts'
428+
- 'etc/config/triton.*.properties'
429+
417430
'lang-typescript':
418431
- changed-files:
419432
- any-glob-to-any-file:
@@ -441,6 +454,13 @@
441454
- 'etc/config/wasm.*.properties'
442455
- 'static/modes/wat-mode.ts'
443456

457+
'lang-yul':
458+
- changed-files:
459+
- any-glob-to-any-file:
460+
- 'lib/compilers/resolc.ts'
461+
- 'etc/config/yul.*.properties'
462+
- 'static/modes/yul-mode.ts'
463+
444464
'lang-zig':
445465
- changed-files:
446466
- any-glob-to-any-file:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow automatically detects potential duplicate issues
2+
# using text similarity analysis with Damerau-Levenshtein distance.
3+
#
4+
# For more information, see: https://github.com/wow-actions/potential-duplicates
5+
6+
name: Duplicate Issue Detection
7+
on:
8+
issues:
9+
types: [opened, edited]
10+
11+
jobs:
12+
detect-duplicates:
13+
runs-on: ubuntu-latest
14+
# Only run on issues, not pull requests
15+
if: ${{ !github.event.issue.pull_request }}
16+
steps:
17+
- uses: wow-actions/potential-duplicates@v1
18+
with:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
# Use 90% similarity threshold to reduce false positives from template matches
21+
# Testing showed that 85% threshold produced too many template-based matches
22+
# True duplicates typically have 90%+ similarity
23+
threshold: 0.90
24+
# Comment on the issue if duplicates are found
25+
label: potential-duplicate
26+
# Custom comment to link to potentially duplicate issues
27+
comment: |
28+
**Potential duplicate detected**
29+
30+
This issue appears to be similar to existing issues. Please review them before continuing:
31+
32+
{{#issues}}
33+
- [#{{number}}]({{html_url}}) ({{accuracy}}% similar)
34+
{{/issues}}
35+
36+
If this is not a duplicate, please clarify how it differs from the above issues.

.github/workflows/test-and-deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
run: |
2222
make prereqs
2323
python3 -m pip install numba
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v6
2426
- name: Run checks
2527
run: |
2628
npm run lint-check
@@ -29,6 +31,7 @@ jobs:
2931
python3 ./etc/scripts/util/propscheck.py
3032
python3 ./etc/scripts/util/propschecktest.py
3133
python3 ./etc/scripts/test_numba_wrapper.py
34+
uv run --directory etc/scripts/gh_tool pytest -v
3235
- uses: codecov/codecov-action@v5
3336
with:
3437
token: ${{ secrets.CODECOV_TOKEN }}
@@ -113,7 +116,7 @@ jobs:
113116
export SENTRY_PROJECT=compiler-explorer
114117
npm run sentry -- releases new -p compiler-explorer "${{ needs.build_dist.outputs.release_name }}"
115118
npm run sentry -- releases set-commits --auto "${{ needs.build_dist.outputs.release_name }}"
116-
npm run sentry -- releases files "${{ needs.build_dist.outputs.release_name }}" upload-sourcemaps out/dist/static
119+
npm run sentry -- sourcemaps upload --release "${{ needs.build_dist.outputs.release_name }}" out/dist/static
117120
- name: Deploy
118121
uses: jakejarvis/s3-sync-action@master
119122
with:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
/asm-docs*
1111
/etc/scripts/asm-docs*
1212

13+
# Python virtual environments and uv
14+
/etc/scripts/docenizers/.venv
15+
/etc/scripts/docenizers/.uv
16+
1317
# user local customizations
1418
/etc/**/*.local.*
1519
/lib/storage/data
@@ -33,3 +37,5 @@ newrelic_agent.log
3337
# Claude local settings
3438
.claude/settings.local.json
3539
.aider*
40+
41+
etc/scripts/ce-properties-wizard/ce_properties_wizard/__pycache__

0 commit comments

Comments
 (0)