Giter Club home page Giter Club logo

idris-tf-random's People

Contributors

david-christiansen avatar evanrinehart avatar mikesperber avatar yurrriq avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

idris-tf-random's Issues

When building, one of the shared libraries fails to link

EvanR:idris-tf-random evan$ idris --build tf-random.ipkg 
gcc -I. -fPIC -o idr_mash.so -shared idr_mash.c
Undefined symbols for architecture x86_64:
  "_Threefish_256_Process_Block", referenced from:
      _idr_Threefish_256_Process_Block in idr_mash-1hLsby.o
     (maybe you meant: _idr_Threefish_256_Process_Block)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [idr_mash.so] Error 1
Loading ./System/Random/TF/Gen.ibc failed: Could not load dynamic alternatives "idr_mash.so"

The needed symbol is in threefish_block.o but the gcc command for idr_mash.so does not include it.

Spurious loss of deterministic behavior after generating some amount of Bits32s

http://lpaste.net/112156

In the above program, the last 4 or so out of 780 lines of output will vary from run to run.

This is really tricky. If you change the program slightly in some way that should or shouldn't change the behavior of the program, this will either cause the bug to apparently disappear (all output is reproducible from run to run) or cause it to manifest itself later in the sequence. By changing the random instance to give a Bits16 or Bits8 from the Bits32 random source (rather than wrapping it in a seemingly useless Word type) I have cause the bug to happen after ~70000 or ~12000 iterations instead of ~800. By removing the Word wrapper it seems to cause the bug to disappear completely.
By using the Bits32 generator directly (no Random instance) it seems to cause the bug to disappear completely. By inserting a pure () : IO () value before, after, or in the middle of the main loop it seems to cause the bug to disappear. By printing the values twice it seems to cause the bug to disappear. Printing the values as (Word, Bits32) to see if it is a problem with show instances seems to cause the bug to disappear!

I only tested this with the default C backend, not llvm or the repl.

Problem with tf-random's FFI code? If it is able to corrupt idris's C runtime that's a bigger issue. I was told that there is / may still be a spurious problem with BitsN primitives, and this may or may not be relevant to this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.