Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update renders typecheckedunisonfile without leading . #5427

Open
aryairani opened this issue Oct 24, 2024 · 0 comments
Open

update renders typecheckedunisonfile without leading . #5427

aryairani opened this issue Oct 24, 2024 · 0 comments
Assignees
Labels

Comments

@aryairani
Copy link
Contributor

Describe and demonstrate the bug
On this hash:
@unison/knn-search-demo/main>
⊙ 1. #htonjt947k

do an update with this scratch file,

db : '{Exception, Cloud} Database
db = do Database.named "shakespeare-hnsw2"


initializeMemoryGraph :
  '{IO, Exception} ( mutable.Ref {IO} (Optional (Layer, Play, Text)),
    mutable.Ref
    {IO} (data.Map Layer (data.Map (Play, Text) (Set (Play, Text)))))
initializeMemoryGraph = do
  use Debug trace
  use IO ref
  ep = ref None
  edges = ref data.Map.empty
  List.foreach
    (p -> let
      trace "loading to memory" p
      nodes = Http.run do streamPlayHunk p
      trace "nodes" (List.size nodes)
      nodes |> populatePlayGraph3 (memoryHNSW ep edges)) plays
  (ep, edges)


saveGraph : '{IO, Exception} ()
saveGraph = do
  Debug.trace "Initializing memory graph" ()
  (ep, edges) = initializeMemoryGraph()
  Debug.trace "done." ()
  Cloud.run do
    use Database named
    use mutable.Ref read
    clearDatabase()
    db = .db()
    Database.assign db Environment.default()
    ep' = read ep
    edges' = read edges
    copyMemoryToHNSW2 db ep' edges' (buildPlayGraph db)

and we get this in the resulting scratch file, which uses the wrong identifier db for .db

saveGraph : '{IO, Exception} ()
saveGraph = do
  use Debug trace
  use mutable.Ref read
  trace "Initializing memory graph" ()
  let
    (ep, edges) = initializeMemoryGraph()
    trace "done." ()
    Cloud.run do
      clearDatabase()
      db = db()
      Database.assign db Environment.default()
      ep' = read ep
      edges' = read edges
      copyMemoryToHNSW2 db ep' edges' (buildPlayGraph db)

Screenshots

Environment (please complete the following information):
release/0.5.27

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants