Skip to content

Conversation

@niklasf
Copy link
Member

@niklasf niklasf commented Apr 29, 2022

Revives #8400, closes #7909.

Main motivation here is speed, but also that it's unlikely that future Stockfish versions will come with smaller networks that will be (nicely) usable in the browser.


Companion tools: https://github.com/lichess-org/external-engine

Idea:

  1. User downloads and installs remote-uci service (runs WebSocket server in backgound, I guess with a tray icon on Windows/Mac). Currently just prints:

    https://lichess.org/analysis/external?url=ws://127.0.0.1:9670/<secret>&<engine-info>
    
  2. On first install, or on demand, https://lichess.org/analysis/remote?url=ws://127.0.0.1:9670/<secret>&<engine-info> is opened in the browser.
    image

  3. Authorizing creates ceval.remote with RemoteWorkerOpts in local storage. Local storage, because likely only the particular device can reach the local remote-uci server. Redirects to the analysis page.

  4. On the analysis page:

    image

  5. Settings based on <engine-info>:

    image


  • Proof of concept
  • Factor out generally reasonable changes to master branch and rebase
  • Polish authorization UI
  • Fix hash table setting
  • Disable cloud analysis storage (maybe always, or at least unless Official Stockfish is used)
  • Implement secret
  • Protocol should not rely on Stockfish specifics
  • Reject insecure connections (Chrome does so anyway)
  • Document protocol for third-party clients/providers
  • Create polished providers
    • Command line client (WIP)
    • Tiny Windows UI & installer with bundled engine (WIP, see Discord)
    • Tiny Mac UI & installer with bundled engine

@niklasf niklasf changed the title Connect remote UCI engine Connect external UCI engine May 6, 2022
@niklasf niklasf marked this pull request as ready for review May 6, 2022 18:07
* master:
  rel attributes for markdown-style links
moreJs = embedJsUnsafe(
// ensure maximum browser compatibility
"""setTimeout(function(){var el=document.getElementById('oauth-authorize');el.removeAttribute('disabled');el.setAttribute('class','button')}, 2000);"""
"""setTimeout(() => {const el=document.getElementById('oauth-authorize');el.removeAttribute('disabled');el.classList.remove('button')}, 2000);"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally going for much broader browser compatibility here, because apps might open the OAuth prompt in ancient web views.

ornicar added 2 commits May 8, 2022 09:07
* master:
  let mods download games of closed accounts
  remove paypal checkout live setting
@ornicar
Copy link
Collaborator

ornicar commented May 8, 2022

Is it ok to merge and deploy this before we have providers?

@ornicar ornicar merged commit d48e894 into master May 10, 2022
@niklasf
Copy link
Member Author

niklasf commented May 10, 2022

I would say yes. It's clearly labeled as alpha, so I hope no one will be mad if we change the protocol or disable it again.

@RobbieGM
Copy link

RobbieGM commented Aug 4, 2022

This is super cool! Uploading an engine from a .wasm file might be a nice future improvement since it wouldn't need the user to run a WebSocket server locally and would also improve portability.

@danispringer

This comment was marked as off-topic.

@niklasf niklasf deleted the remote-uci branch December 17, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Suggestion] Allow UCI engine analysis

5 participants