-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
180 changed files
with
13,801 additions
and
429,709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/naming-convention": "off", | ||
"@typescript-eslint/semi": "off", | ||
"curly": "warn", | ||
"eqeqeq": "warn", | ||
"no-throw-literal": "warn", | ||
"semi": "off" | ||
}, | ||
"ignorePatterns": [ | ||
"out", | ||
"dist", | ||
"**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
out | ||
dist | ||
node_modules | ||
.vscode-test/ | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/dist/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
}, | ||
{ | ||
"name": "Extension Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js", | ||
"${workspaceFolder}/dist/**/*.js" | ||
], | ||
"preLaunchTask": "tasks: watch-tests" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false, // set this to true to hide the "out" folder with the compiled JS files | ||
"dist": false // set this to true to hide the "dist" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true, // set this to false to include "out" folder in search results | ||
"dist": true // set this to false to include "dist" folder in search results | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off", | ||
"cmake.configureOnOpen": false, | ||
"livePreview.defaultPreviewPath": "/index.html" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$ts-webpack-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never", | ||
"group": "watchers" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "watch-tests", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never", | ||
"group": "watchers" | ||
}, | ||
"group": "build" | ||
}, | ||
{ | ||
"label": "tasks: watch-tests", | ||
"dependsOn": [ | ||
"npm: watch", | ||
"npm: watch-tests" | ||
], | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
out/** | ||
node_modules/** | ||
src/** | ||
.gitignore | ||
.yarnrc | ||
webpack.config.js | ||
vsc-extension-quickstart.md | ||
**/tsconfig.json | ||
**/.eslintrc.json | ||
**/*.map | ||
**/*.ts |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Change Log | ||
|
||
All notable changes to the "interactive-herbie" extension will be documented in this file. | ||
|
||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. | ||
|
||
## [Unreleased] | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Edward Misback | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# Odyssey: An Interactive Numerics Workbench | ||
#### [[Video tutorial (8.5 min)]](https://youtu.be/jsjGuM2KK50) [[Setup]](#running-odyssey) | ||
|
||
Odyssey is a tool for interactively rewriting numerical expressions to reduce floating-point error. | ||
|
||
<img src="doc/overview.gif" width=600/> | ||
<br> | ||
<br> | ||
|
||
**Before using Odyssey, please see [Running Odyssey](#running-odyssey) below to install dependencies.** | ||
|
||
## Table of Contents | ||
- [Features](#features) | ||
- [Running Odyssey](#running-odyssey) | ||
- [Submitting Feedback and Getting Help](#submitting-feedback-and-getting-help) | ||
- [Release Notes](#release-notes) | ||
- [For Developers](#for-developers) | ||
|
||
## Features | ||
|
||
Odyssey displays the *local error* of expressions. Local error shows how different subexpressions contribute to the total error for an input. | ||
|
||
<img src="doc/local_error.gif" width=600/> | ||
<br> | ||
<br> | ||
|
||
Odyssey generates rewriting suggestions with the state-of-the-art [Herbie](https://herbie.uwplse.org/demo/) floating-point expression rewriting tool. | ||
|
||
<img src="doc/ask_herbie.gif" width=600/> | ||
<br> | ||
<br> | ||
|
||
Derivations of Herbie's rewrites are also available. | ||
|
||
<img src="doc/derivation.gif" width=600/> | ||
<br> | ||
<br> | ||
|
||
The sample range of the expression can be adjusted to fit your use case. | ||
|
||
<!-- TODO gif of Odyssey showing adjusting the sample range for sqrt(x + 1) - sqrt(x) --> | ||
<img src="doc/resample.gif" width=600/> | ||
<br> | ||
<br> | ||
|
||
A full walkthrough of Odyssey is available in the [video tutorial](https://youtu.be/jsjGuM2KK50). | ||
|
||
If you have any questions about features, please [open an issue](https://github.com/herbie-fp/odyssey/issues/new) on Github. | ||
|
||
## Running Odyssey | ||
|
||
Odyssey runs as a VSCode extension. You can install it from the VSCode Marketplace [here](https://marketplace.visualstudio.com/items?itemName=herbie-fp.odyssey-fp), but first follow the instructions below to install dependencies. | ||
|
||
### Dependencies | ||
Odyssey uses a [Herbie](https://herbie.uwplse.org) server to analyze expressions and currently requires you to bring your own Herbie instance. After following the [Herbie installation instructions](https://herbie.uwplse.org/doc/latest/installing.html), you can run a Herbie server with | ||
```bash | ||
$ herbie web --port 8000 --quiet | ||
# Response should look like: | ||
Herbie 2.0 with seed 552322303 | ||
Find help on https://herbie.uwplse.org/, exit with Ctrl-C | ||
Your Web application is running at http://localhost:8000. | ||
Stop this program at any time to terminate the Web Server. | ||
``` | ||
|
||
### Running the VSCode extension | ||
|
||
After starting the Herbie server, run Odyssey from the VSCode command palette by clicking on VSCode and using **Ctrl/Command-Shift-P > Odyssey: Herbie.** | ||
|
||
The server status shown in Odyssey should have the text "Connected." | ||
|
||
If the server status is red with the text "No Server", Odyssey can't connect to the Herbie server. | ||
|
||
If needed, you can adjust the server address where Odyssey looks for Herbie by clicking on the server status. Make sure that the port Odyssey is connecting to is the same one Herbie is being hosted on. | ||
|
||
### (Alternative) Running as a standalone web application | ||
|
||
Odyssey can also run as a standalone web application. | ||
|
||
First, you'll need to install node from https://nodejs.org/en/download/. | ||
|
||
Next, clone this repo and build the application: | ||
```bash | ||
$ git clone https://github.com/herbie-fp/odyssey | ||
$ cd odyssey | ||
$ npm install | ||
$ npm run compile | ||
``` | ||
|
||
Then, after starting the Herbie server, run an HTTP server to serve the `index.html` file: | ||
```bash | ||
$ npx serve -p 3000 | ||
``` | ||
|
||
# Submitting Feedback and Getting Help | ||
Please submit any feedback or bug reports by [opening an issue on this repo](https://github.com/herbie-fp/odyssey/issues/new). | ||
|
||
# Release Notes | ||
|
||
### 1.0.0 | ||
* First public release | ||
|
||
<!-- TODO add more release notes --> | ||
|
||
### 0.4.0 | ||
|
||
* Rename repo + extension | ||
* Still unofficial; expecting to release 1.0 at the beginning of August | ||
|
||
### 0.1.0 | ||
|
||
First major post-study 1 version | ||
|
||
# For Developers | ||
|
||
## Setting up a development environment | ||
```bash | ||
$ npm install | ||
# Then use command/control+shift+B to start the auto-compile task | ||
# Each time compilation finishes, you should see a message like "webpack 5.82.1 compiled with 1 warning in 31769 ms" | ||
``` | ||
|
||
### Testing the extension | ||
Use the "Run and Debug" tab to start an instance of VSCode with the most recent code. | ||
|
||
You can see changes to the frontend (`webview/index.ts`) by simply refreshing the webview, but **changes to the host (`extension.ts`) will only show if the debugger is restarted.** | ||
|
||
### Publishing the extension: | ||
|
||
Get publication key from @elmisback, then: | ||
|
||
```bash | ||
# update "version" in package.json and commit, then | ||
$ npm run publish | ||
``` | ||
|
||
<!-- ## Extension Settings | ||
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. | ||
For example: | ||
This extension contributes the following settings: | ||
* `myExtension.enable`: enable/disable this extension | ||
* `myExtension.thing`: set to `blah` to do something --> | ||
|
||
----------------------------------------------------------------------------------------------------------- | ||
<!-- ## Following extension guidelines | ||
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. | ||
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.