Commit Graph
204 Commits
Author SHA1 Message Date
Rupert Tombs afccba613e Quash some warnings in tests (#7415)
- Prevent some warnings in the `test-and-deploy` action; see, for
example, `Run checks` at
https://github.com/compiler-explorer/compiler-explorer/actions/runs/13421609790/job/37495341332:
  - Await a result to avoid:
```text
Promise returned by `expect(actual).toMatchFileSnapshot(expected)` was not awaited. Vitest currently auto-awaits hanging assertions at the end of the test, but this will cause the test to fail in Vitest 3. Please remember to await the assertion.
    at it.timeout(/home/runner/work/compiler-explorer/compiler-explorer/test/filter-tests.ts:91:50)
```
- Remove duplicated `AVRrc` entries in
`lib/asm-docs/generated/asm-docs-avr.ts`. `AVRrc` is a [reduced core
AVR](https://ww1.microchip.com/downloads/en/DeviceDoc/AVR-InstructionSet-Manual-DS40002198.pdf#page=18),
not an opcode. This avoids a warning beginning `[vite] warning: This
case clause will never be evaluated because it duplicates an earlier
case clause`.
    - Update generator script to also filter `AVRe`.
- Deduplicate `RLDICL` in `lib/asm-docs/generated/asm-docs-power.ts`.
IBM document this instruction both
[here](https://www.ibm.com/docs/en/aix/7.3?topic=is-rldicl-rotate-left-double-word-immediate-then-clear-left-instruction)
and
[here](https://www.ibm.com/docs/en/aix/7.3?topic=is-rldicl-rotate-left-double-word-immediate-then-clear-left-instruction-1).
I choose the neater-looking one, which is also more similar to their
[`RLDICR`](https://www.ibm.com/docs/en/aix/7.3?topic=is-rldicr-rotate-left-double-word-immediate-then-clear-right-instruction)
documentation. This avoids warnings beginning `[vite] warning: This case
clause will never be evaluated because it duplicates an earlier case
clause`.
2025-02-24 10:05:31 -06:00
Rupert Tombs 5eeded45c4 Test the numba wrapper in test-and-deploy (#7413)
- Resolve comments from #5592:
- Replace a silly indirect import
https://github.com/compiler-explorer/compiler-explorer/pull/5592#discussion_r1962004963
- Run `test_numba_wrapper` in `.github/workflows/test-and-deploy.yml`.
https://github.com/compiler-explorer/compiler-explorer/pull/5592#discussion_r1962004131
- Patch minor errors in `etc/scripts/util/propschecktest.py` and also
test it.
2025-02-24 09:58:31 -06:00
Rupert TombsandMats Jun Larsen ca1ecbb2e3 Add Numba (#5592)
- Add initial support for Numba compilation: asm, demangling, execution

Numba wraps Python functions in `Dispatcher` objects. Each dispatcher
contains zero or more compiled argument-type-indexed overloads of its
function. We import the user's code as a module, and emit the code from
all overloads of all dispatchers that the module publicly exposes.

Name mangling is odd in Numba. It uses a similar mangling syntax to C++,
but also encodes non-symbol (`r"[^a-z0-9_]"`) characters as `_%02x`.
This encoding yields valid identifier names, so it is not strictly
invertible. Here, I have hard-coded some replacements to decode some
common cases at the cost of possible clashes with ugly user-defined
names.

Screenshot captured via `make dev EXTRA_ARGS="--debug --language numba"`

![generator
example](https://github.com/user-attachments/assets/77b8e53a-3589-4e0d-9589-10c36a026b6f)


## To do

- [x] Answer questions of #5591.
- [x] Acquire a python environment.
- [ ] Automatically run the python test?

Locally, I have installed a virtual environment with python 3.12.3 with

```shell
path/to/python -m venv venv_numba
path/to/venv_numba/bin/python -m pip install numba==0.61.0 scipy>=0.16
```

and configured its use with

```properties
# compiler-explorer/etc/config/numba.local.properties
compilers=&numba
defaultCompiler=numba_0_61_0

group.numba.compilers=numba_0_61_0
group.numba.baseName=Numba

compiler.numba_0_61_0.exe=/path/to/python3.13
compiler.numba_0_61_0.semver=0.61.0
```

I run this python-side test file with

```python
path/to/venv_numba/bin/python -m unittest etc/scripts/test_numba_wrapper.py
```

---------

Co-authored-by: Mats Jun Larsen <mats@jun.codes>
2025-02-19 10:41:42 -06:00
Matt GodboltandMats Jun Larsen 3aeed42066 Upgrade to node 20 minimum, target node 22 (#7343)
Co-authored-by: Mats Jun Larsen <mats@jun.codes>
2025-02-18 12:43:21 -06:00
Stephen HeumannandMatt Godbolt 5a72fa0659 Add support for ORCA/C (#7368)
[ORCA/C](https://github.com/byteworksinc/ORCA-C) is a C compiler that
natively runs on and targets the Apple IIGS. ORCA/C and the programs it
generates can be run on modern Linux systems by using an emulation tool
called [Golden Gate](https://goldengate.gitlab.io).

This adds support for ORCA/C (run via Golden Gate) in Compiler Explorer.
It uses its own assembly format and objdumper (provided by Golden Gate),
so support for those is added. An extra configuration option was also
added to support execution via an emulator, bypassing the usual check
that executables can run natively. Asm docs for the WDC 65C816 processor
were also added.

ORCA/C and Golden Gate are not Free Software, but their rights holders
have given permission for them to be used on Compiler Explorer. Tarballs
for them can be supplied privately. See infra PR:
compiler-explorer/infra#1521

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-02-18 10:28:10 -06:00
Mats Jun Larsen 5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Mats Jun Larsen d9093faf18 Replace ts-node with tsx (#7205)
Migrates tooling to TSX (as advised by nodejs) until we are on Node 22
where we can `--watch --experimental-strip-types`
2024-12-10 00:18:46 +09:00
Mats Jun Larsen c256b922f7 Migrate site templates to yaml config (#7189)
Does some winter cleaning on the site-template stuff :)

1. Migrated away from the custom conf format to plain old yaml
2. Made the images and image files match with the name from the yaml
file. (It's not a problem to have spaces in file paths, nor urls so I
don't see why we shouldn't)
3. Updated the relevant documentation

There is a small breakage in the api response for the meta field. It now
returns `{"screenshot_dimensions":{"width":1000,"height":800}}` which I
believe is a lot more useful than
`{"meta.screenshot_dimensions":"1000x800"}`

Besides, I don't believe this endpoint has any third-party consumers
that rely on the metadata since it's a rarely known feature anyways
2024-12-08 00:59:58 +09:00
Mats Jun 73ee43da66 Handle site template importing asynchronously (#7089)
1. Gives a proper type to the metadata
2. Fixes a typo in `screenshot_dimentions`
3. Removes home-made partition function in favor of underscore
4. Reads file asynchronously (and consequently rest of API is async)
5. Strips the `https://godbolt.org/#` from each entry in the config file

As an added benefit this should also cut some startup time reading this
file before it's used :)
2024-11-15 10:03:12 +09:00
Matt Godbolt 0d2fc74419 Deduplicate ARM opcodes (#7067)
Prevents us generating duplicate case statements, though this doesn't
mean we correctly collate things. This has no functional change (as the
duplicate switches the first one wins) but reduces the amount of code
generated.
2024-11-05 07:31:20 -06:00
Ofek 93f75efc55 Update nvidia docenizer and docs (#6952)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-10-16 18:11:54 +03:00
Ofek f3b14d1e1b Small build/docz fixes (#6951)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-10-09 23:12:09 +03:00
Ofek 9dd45914aa Tooltips for llvm ir (#6937)
The docenizer was there - just needed some updating.

There is some duplicity created between `ir-view` and `compiler` that I
hope to address in a future PR.
2024-10-07 08:37:10 +03:00
Jan KühleandMatt Godbolt f4619aa8c6 Update Python asm docs (#6903)
When playing with Python 3.12 in the compiler explorer, I noticed some
instructions don't have documentation. I think that's true for new
instructions in 3.12. This PR updates the asm docs and the docenizer.

Update Python docenizer to handle new dis.html formatting:

- The JUMP bytecode has no description (i.e. no `<p>` elements).

- Docs now often include code snippets in `<code>` or `<pre>` tags.
Sanitize HTML but keep some known tags.

- Exit when failing to parse dis.html rather than emitting new file
without any instructions.

- Fix check for existing dis.html file.

Not sure if HTML markup is desired. It feels easier to read to me. But
I'm happy to revert that, too.

Docs updated using:

./etc/scripts/docenizers/docenizer-python.py -o
lib/asm-docs/generated/asm-docs-python.ts

---

Here's a preview:

| Before | After |
| --- | --- |
|
![image](https://github.com/user-attachments/assets/b1ae4c5e-5854-46e5-8f36-4e692566d85d)
|
![image](https://github.com/user-attachments/assets/278d4e34-377f-4301-b7e2-01226c14ddc3)
|


---

`make check` passes. But I had to commit using `--no-verify`. The
precommit hook failed on line-files with one warning:

```
/usr/local/google/home/jankuehle/Code/compiler-explorer/lib/asm-docs/generated/asm-docs-python.ts
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override
```



<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2024-09-30 22:11:04 -05:00
Nicholas Hubbard a9257430f3 Add assembly documentation for PowerPC platform (#6665)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

Hello all, I've added assembly documentation for the PowerPC platform
with this PR.

There's a couple of notes to keep in mind, mostly regarding automatic
processing:

1. Unfortunately, IBM made their documentation site very difficult to
automatically scrape. It uses dynamic rendering with a documentation API
that's protected by cookies, requiring the use of Selenium to scrape it.
2. While it is possible to scrape the documentation pages, it's
maddeningly difficult to do so, because the structure of the pages is
not guaranteed.
- Some pages have invisible elements in their headers that make matching
elements very difficult.
     - Some pages are missing entire sections.
- Some pages are written without an introduction for the instruction
mnemonic, making the resulting documentation impossible to understand.
- Some pages, specifically for instructions without arguments, are
missing the table that lists the mnemonics out in order.
- I could go on, but I abandoned trying to do automatic processing after
running into this many roadblocks.
3. The automatic processing script is available in the docenizers
directory, but since it's not complete, feel free to ask to remove it.
4. I couldn't test the actual mnemonics appearing the editor, because my
local test setup kept trying to map the PowerPC instructions into AMD64
documentation, with predictably unusual results.
5. I didn't include AltiVec instructions, because there isn't any
webpage that documents them; they are only documented in a PDF file
provided by NXP.

Please let me know if there's anything else I need to do for this to
work. Thank you so much for your wonderful service!
2024-07-01 14:52:10 +02:00
Matt Godbolt e91b5d12da Comply with some MS terms (#6627)
- Ensure MSVC license terms are clearly shown to the user.
- Simplify config of vc and vcpp slightly by extracting common stuff
into a group.
- Remove reference to MS privacy policy
2024-06-19 18:09:59 -05:00
Sam James 19440e35e3 etc: find-node: use command -v, not which (#6567)
`which` isn't in POSIX and some Linux distributions (e.g. Debian,
Gentoo) are trying to remove it from their base installs. See
https://lwn.net/Articles/874049/.
2024-06-08 15:30:59 -05:00
Patrick Quist ee688190ac Disable GA (#6302) 2024-04-22 21:25:31 +02:00
Patrick Quist 9049ed7fe1 Start aarch64 support (#6332) 2024-04-15 01:24:57 +02:00
Jeremy 68817197e1 Generate one-dark site template screenshots 2024-04-09 21:42:12 -05:00
partouf 07f54a6721 new theme screenshots 2024-04-08 16:25:01 +02:00
Mosè GiordanoandValentin Churavy 8ad1419368 [julia] Add LLVM IrView (#6285)
Julia is based on LLVM like other toolchains supported by Compiler
Explorer, and it can emit LLVM IR, but at the moment we only expose it
via the flag `--format=llvm` to the compiler wrapper.

With this PR we add a proper LLVM IR viewer, like the other LLVM-based
toolchains. We add a new option for the wrapper to emit the entire LLVM
module, which has the benefit of being parsable by Compiler Explorer, so
that we can automatically filter out debug information and metadata
annotations.

Preview (from
https://github.com/compiler-explorer/compiler-explorer/issues/4597#issuecomment-2018956112):


![image](https://github.com/compiler-explorer/compiler-explorer/assets/765740/7c2f80b4-9c92-4761-9f6e-393d0ad26935)

We removed the custom `<[source code line] [number of output lines]
[function name] [method types]>` line in the output of the `code_*`
functions, together with the custom ASM parsing, because they invalidate
the output (it isn't valid ASM nor LLVM), and create more problems than
they solve.

This PR was prepared in collaboration with @vchuravy.

This should eventually address #4597, once inlined LLVM functions are
handled by the IR parser in Compiler Explorer, I think @vchuravy can
comment more on that issue.

---------

Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
2024-04-01 22:08:35 -05:00
standstaff 45ef23c940 chore: remove repetitive words (#6247)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

Signed-off-by: standstaff <zhengxingru@yeah.net>
2024-03-16 09:22:15 +02:00
Mosè Giordano 8ee8be2bcf [julia_wrapper] Slightly improve performance (#6024) 2024-01-20 17:22:57 +01:00
Mosè Giordano 7e899b008d [julia_wrapper] Fix compatibility with Julia v1.10 (#5963)
Fix error reported at
https://github.com/compiler-explorer/compiler-explorer/pull/5927#issuecomment-1882396045.
2024-01-15 14:56:34 -06:00
AlexandAlex Wiens 13e80af4da Fix #5752: Julia: Fix inclusion of methods of imported functions and handling of… (#5768)
… parametric methods

If the code contains a method, specializing a function that is defined
in a different module (e.g. Base), then the method would be ignored.

The `names` function offers the `imported` parameter, which leads to
inclusion of imported functions. However, this also leads to inclusion
of many methods that are not defined in the given code. To only consider
the methods from the input code, the input module `m` is passed to the
method searching call `methods(fun, m)`.

While debugging, another bug surfaced: methods with parametric types
would lead to an error, because the type for these methods is
represented differently. In this cases, `specTypes` is of type
`UnionAll`, which does not have a member `parameters`, but the members
`var` and `body` to represent the parametric structure of the type. Also
see https://docs.julialang.org/en/v1/devdocs/types/#UnionAll-types By
checking the `specType` member for the type `UnionAll`, this can be
fixed.

Fixes #5752

Co-authored-by: Alex Wiens <alex.wiens@uni-paderborn.de>
2023-11-20 21:38:00 -06:00
Patrick Quist d8d6b760a9 Update build-dist-win.ps1 2023-11-11 16:15:29 +01:00
Patrick Quist 4200088959 Update build-dist-win.ps1 2023-11-11 16:10:53 +01:00
Phil @ RISC-V Embedded Blog "Five Embeddev fcb8513f7f RISCV64 assembly opcode documentation - update (#5598) 2023-11-07 14:52:43 +01:00
Matt Godbolt 5d776aaae3 Replace ts-node-esm with direct calls to node to support node 20 (#5521)
- works both v18 and v20
- see https://github.com/TypeStrong/ts-node/issues/1997
2023-09-27 21:57:18 -05:00
Marc Poulhiès 4f6106da3f propcheck: skip local properties (#5254)
fixes #5251

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-07-11 14:06:25 +02:00
Marc Poulhiès c581148fd3 propcheck: applies to local config (#5250)
Applies to local config and fix existing issues.

By defaults, local and defaults are not checked for suspicious path (exe
not starting with /opt/compiler-explorer). This can be forced with the
--check-suspicious-in-local-prop.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-07-10 08:19:57 +02:00
Jeremy Rifkin 42ea9cc128 General work on solidifying the instruction set system (#5156)
Mainly type work
2023-06-17 19:41:26 -04:00
Guo Ci 79bba4c1d1 Add PTX and SASS docs (#5129)
For CUDA C++, add PTX and SASS docs.
2023-06-11 17:00:38 -04:00
Jeremy d9d6307f60 Fix docenizer makefile and committing changes from regenerating the docs 2023-06-03 01:28:22 -04:00
Matt Godbolt beec3b51d4 Refactor; rename arm64 to aarch64 2023-05-30 21:06:54 -05:00
Matt Godbolt 1275dca94b Merge branch 'main' into asm-docs/arm32-arm64 2023-05-30 19:38:31 -05:00
Marc Poulhiès 64ceb0ca03 Add missing test case for recent new propcheck rule
The test was missing, adding it now... /o\
refs #5009

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-05-08 20:39:19 +02:00
Serval Martinot-Lagarde b904ddf48a asm-docs: Add arm64 and update arm32 documentations 2023-05-08 11:40:23 +02:00
Marc Poulhiès 016fe2d04b propcheck: catch one more small error (#5009)
Catch invalid lines (i.e. not a comment and not a prop).
Also refine the PROP_RE so that the 'key' can't have a space (this could
be made more correct by allowing space around '=', but we don't have
any, so....)

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-04-29 23:49:53 +02:00
Jeremy Rifkin 5d8d39f136 Pink (#4916) 2023-04-01 00:52:27 -04:00
Patrick Quist 7d192ccde1 add properties and test for cewrapper (#4761) 2023-03-18 11:46:27 +01:00
Mats Jun LarsenandMatt Godbolt 633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Matt Godbolt fb4b7bb16e Bump used node version to 18 (#4778)
Still assume node 16 compatibility for now.
2023-02-25 12:43:00 -06:00
Valentin Churavy 149762051a [Julia] show options from compiler wrapper not Julia runtime (#4716)
https://github.com/compiler-explorer/compiler-explorer/pull/4674 wasn't
quite finished.
This goes the last mile, and shows the user the options from the
compiler-wrapper.
2023-02-12 13:55:47 -06:00
Jeremy Rifkin 342427ecde Tsify generate_site_template_screenshots.js (#4708)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2023-02-10 14:13:48 -05:00
Jeremy Rifkin f801481582 Tsify the java docenizer (#4710)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2023-02-10 14:10:53 -05:00
Mosè Giordano 429a01b62e [julia] Set optimisations on by default (#4713)
Fix #4712.

CC: @vchuravy @gbaraldi
2023-02-10 07:10:34 -06:00
Valentin Churavy ceee0d15f5 Add JuliaParser (#4674)
If I understand this right this should populate the list of options for the "compiler options" drop-down
2023-02-10 07:09:18 -06:00
Valentin Churavy 0461bf9717 [Julia] pass optimize to typed (#4673) 2023-02-02 10:18:36 -06:00