this repo has no description

more repro stuff

+131 -79
+16 -3
README.md
··· 11 11 ## Getting dependencies 12 12 13 13 The easiest way to install the required dependencies is using Nix. 14 - After [installing it](https://nixos.org/download/), simply run `nix develop`. 15 - This environment includes everything necessary for building the program, visualisations, and thesis. 14 + After [installing it](https://nixos.org/download/), simply run one of the two commands below: 16 15 17 - You can also build the program itself with `nix build .#default`. 16 + - `nix develop .#full` for a full environment with everything required to build the project, visualisations, and thesis. (approx 3.4G disk space) 17 + - `nix develop .#minimal` for a smaller environment, with only enough to build the project and run tests (approx 1.9G disk space). 18 + 19 + You can also build the program itself with `nix build .#default`, or see below to run a test VM. 18 20 19 21 Alternatively, manually set up the following programs: 20 22 ··· 27 29 - To build the thesis: 28 30 - Texlive, with the packages listed in `nix/tex-env.nix` 29 31 - `latexmk` 32 + 33 + Once you have dependencies installed, check the `README` in each directory for details on how to reproduce our results. 34 + 35 + ## Building a testing VM 36 + 37 + The VM which we used for testing can be fully rebuilt by running `nix build .#vm`. This requires around 3.1G on disk. 38 + 39 + After building, run `./result/bin/run-candelabra-vm` to start it. 40 + The credentials are `root` / `candelabra`, and you can use SSH if desired. 41 + 42 + The VM has candelabra prebuilt as `candelabra-cli`, but no tools for visualisation or building the thesis.
+1 -1
analysis/README.md
··· 10 10 11 11 ``` 12 12 $ just cost-models # approx 10m 13 - $ just comparisons 2>&1 | tee ../analysis/current/log # approx 1hr 30m 13 + $ just selections --compare 2>&1 | tee ../analysis/current/log # approx 1hr 30m 14 14 ``` 15 15 16 16 We need to also write the log output when comparing since we use this during analysis. To put this data in the right place, in `../analysis`:
+37
flake.lock
··· 38 38 "type": "github" 39 39 } 40 40 }, 41 + "nixlib": { 42 + "locked": { 43 + "lastModified": 1711846064, 44 + "narHash": "sha256-cqfX0QJNEnge3a77VnytM0Q6QZZ0DziFXt6tSCV8ZSc=", 45 + "owner": "nix-community", 46 + "repo": "nixpkgs.lib", 47 + "rev": "90b1a963ff84dc532db92f678296ff2499a60a87", 48 + "type": "github" 49 + }, 50 + "original": { 51 + "owner": "nix-community", 52 + "repo": "nixpkgs.lib", 53 + "type": "github" 54 + } 55 + }, 56 + "nixos-generators": { 57 + "inputs": { 58 + "nixlib": "nixlib", 59 + "nixpkgs": [ 60 + "nixpkgs" 61 + ] 62 + }, 63 + "locked": { 64 + "lastModified": 1711932680, 65 + "narHash": "sha256-CEpVtyB7uyRprTuiG+lpWWMvM/C0CbY/dbBuxT5BDwM=", 66 + "owner": "nix-community", 67 + "repo": "nixos-generators", 68 + "rev": "1f4c32ca4295bb7cca1e48a2f39b65490b249b0b", 69 + "type": "github" 70 + }, 71 + "original": { 72 + "owner": "nix-community", 73 + "repo": "nixos-generators", 74 + "type": "github" 75 + } 76 + }, 41 77 "nixpkgs": { 42 78 "locked": { 43 79 "lastModified": 1709128929, ··· 55 91 "root": { 56 92 "inputs": { 57 93 "crane": "crane", 94 + "nixos-generators": "nixos-generators", 58 95 "nixpkgs": "nixpkgs", 59 96 "rust-overlay": "rust-overlay" 60 97 }
+39 -19
flake.nix
··· 9 9 nixpkgs.follows = "nixpkgs"; 10 10 }; 11 11 }; 12 + nixos-generators = { 13 + url = "github:nix-community/nixos-generators"; 14 + inputs.nixpkgs.follows = "nixpkgs"; 15 + }; 12 16 }; 13 17 14 18 outputs = inputs @ { 15 19 self, 16 20 nixpkgs, 21 + nixos-generators, 17 22 crane, 18 23 rust-overlay, 19 24 }: let ··· 24 29 }; 25 30 tex-env = pkgs.callPackage ./nix/tex-env.nix inputs; 26 31 racket-env = pkgs.callPackage ./nix/racket-env.nix inputs; 32 + rust-toolchain = pkgs.rust-bin.fromRustupToolchain ((builtins.fromTOML (builtins.readFile ./src/rust-toolchain.toml)).toolchain // {profile = "minimal";}); 27 33 candelabra = pkgs.callPackage ./nix/candelabra.nix inputs; 28 34 in rec { 29 - devShells.${system}.default = pkgs.mkShell { 30 - buildInputs = [ 31 - tex-env 32 - racket-env 35 + devShells.${system} = { 36 + minimal = pkgs.mkShell { 37 + buildInputs = [ 38 + rust-toolchain 39 + racket-env 40 + pkgs.just # command runner 41 + pkgs.inotify-tools 42 + ]; 43 + }; 44 + full = pkgs.mkShell { 45 + buildInputs = [ 46 + rust-toolchain 47 + racket-env 48 + pkgs.just # command runner 49 + pkgs.inotify-tools 33 50 34 - pkgs.just # command runner 35 - pkgs.biber # bibliography backend 36 - pkgs.inotify-tools 51 + tex-env 52 + pkgs.biber # bibliography backend 37 53 38 - pkgs.livebook # datavis 39 - # god is dead 40 - pkgs.nodejs 41 - pkgs.nodePackages.vega-cli 42 - pkgs.nodePackages.vega-lite 43 - ]; 54 + pkgs.livebook # datavis 55 + # god is dead 56 + pkgs.nodejs 57 + pkgs.nodePackages.vega-cli 58 + pkgs.nodePackages.vega-lite 59 + ]; 60 + }; 44 61 }; 45 62 46 - packages.${system}.default = candelabra; 63 + packages.${system} = { 64 + default = candelabra; 65 + vm = nixos-generators.nixosGenerate { 66 + inherit system; 67 + specialArgs = { 68 + inherit inputs tex-env racket-env candelabra; 69 + }; 70 + modules = [./nix/configuration.nix]; 47 71 48 - nixosConfigurations.default = nixpkgs.lib.nixosSystem { 49 - inherit system; 50 - specialArgs = { 51 - inherit inputs tex-env racket-env candelabra; 72 + format = "vm"; 52 73 }; 53 - modules = [./nix/configuration.nix]; 54 74 }; 55 75 }; 56 76 }
+8 -29
nix/configuration.nix
··· 21 21 22 22 nix = { 23 23 settings.experimental-features = ["nix-command" "flakes" "ca-derivations"]; 24 - gc = { 25 - automatic = true; 26 - dates = "03:15"; 27 - options = "--delete-older-than 1d"; 28 - }; 29 24 }; 30 25 31 - # Everything below here is just boring machine setup 32 26 networking.hostName = "candelabra"; 33 27 networking.useDHCP = lib.mkDefault true; 34 28 ··· 38 32 # SSH Access 39 33 services.openssh = { 40 34 enable = true; 41 - settings.PermitRootLogin = "prohibit-password"; 35 + settings.PermitRootLogin = "yes"; 42 36 }; 43 37 44 - users.users.root.openssh.authorizedKeys.keys = [ 45 - "no-touch-required sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIPpKjZfzPN1KxVskFRnmTTCwzyCtjwcXVZc4i1rNfl9oAAAABHNzaDo= me@aria.rip" 46 - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPJN58ZzY9WZgaHYlIN6w1RtleaRpcX7gRr4j7m6aHso candelabra" # CI 47 - ]; 48 - 49 - # Boot & filesystems 50 - boot.loader.grub.enable = true; 51 - boot.loader.grub.device = "/dev/sda"; 52 - 53 - boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; 54 - boot.initrd.kernelModules = []; 55 - boot.kernelModules = ["kvm-intel"]; 56 - boot.extraModulePackages = []; 57 - 58 - fileSystems."/" = { 59 - device = "/dev/disk/by-uuid/b7946a55-0573-4be9-801b-5ca9afc7b3f3"; 60 - fsType = "ext4"; 61 - }; 62 - 63 - swapDevices = [ 64 - {device = "/dev/disk/by-uuid/9101d36f-dba8-4dda-8f4b-8dc8c1d37fe9";} 65 - ]; 38 + users.users.root.password = "candelabra"; 39 + services.getty.autologinUser = "root"; 66 40 67 41 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 68 42 system.stateVersion = "23.11"; 43 + 44 + system.activationScripts.copy-candelabra-src = '' 45 + echo "copying candelabra source to /root/..."; 46 + cp -r ${../.} /root/candelabra; 47 + ''; 69 48 }
+30 -27
src/README.md
··· 7 7 8 8 Building is done with Cargo as normal: `cargo build`. This places the executable in `./target/debug/candelabra-cli`. 9 9 10 + This is not necessary if using the testing VM, and you should replace `cargo run` with `candelabra-cli` in all commands below. 11 + 10 12 ## Creating cost models 11 13 12 - To build and view cost models, first find an implementation to look at: 14 + To build and view a cost model, first pick an implementation to look at: 13 15 14 - ``` 15 - $ cargo run -- list-library 16 - [...] 17 - Available container implementations: 18 - primrose_library::VecMap 19 - primrose_library::VecSet 20 - std::vec::Vec 21 - std::collections::BTreeSet 22 - std::collections::BTreeMap 23 - primrose_library::SortedVecSet 24 - std::collections::LinkedList 25 - primrose_library::SortedVecMap 26 - primrose_library::SortedVec 27 - std::collections::HashMap 28 - std::collections::HashSet 29 - ``` 16 + - primrose_library::VecMap 17 + - primrose_library::VecSet 18 + - std::vec::Vec 19 + - std::collections::BTreeSet 20 + - std::collections::BTreeMap 21 + - primrose_library::SortedVecSet 22 + - std::collections::LinkedList 23 + - primrose_library::SortedVecMap 24 + - primrose_library::SortedVec 25 + - std::collections::HashMap 26 + - std::collections::HashSet 30 27 31 - To view the cost model for a single implementation, run `cargo run -- cost-model <impl>`. 28 + To view the cost model for a single implementation, run `just cost-model <impl>`. 32 29 33 - Alternatively, run `just cost-model <impl>` to look at a single implementation, or `just cost-models` to view models for all implementations. 34 - The latter will clear the cache before running. 30 + Alternatively, run `just cost-models` to view models for all implementations. 31 + This will clear the cache before running. 35 32 36 33 Cost models are also saved to `target/candelabra/benchmark_results` as JSON files. To analyse your built cost models, copy them to `../analysis/current/candelabra/benchmark_results` and see the README in `../analysis/`. 37 34 38 35 ## Profiling applications 39 36 40 - To profile an application in the `tests/` directory and display the results, run `cargo run -- --manifest-path tests/Cargo.toml -p <project> profile`. 41 - 42 - Alternatively, run `just profile <project>`. 43 - 37 + To profile an application in the `tests/` directory and display the results, run `just profile <project>`. 44 38 Profiling info is also saved to `target/candelabra/profiler_info/` as JSON. 45 39 46 40 ## Selecting containers 47 41 48 - To print the estimated cost of using each implementation in a project, run `cargo run -- --manifest-path tests/Cargo.toml -p <project> select`. 42 + To print the estimated cost of using each implementation in a project, run `just select <project>`. 43 + Alternatively, run `just selections` to run selection for all test projects. 44 + 45 + You can add `--compare` to either of these commands to also benchmark the project with every assignment of implementations, and print out the results. 49 46 50 - Alternatively, run `just select <project>` for a single project, or `just selections` to run selection for all test projects. 51 - You can add `--compare` to any of these commands to also benchmark the project with every assignment of implementations, and print out the results. 47 + ## Running the full test suite 48 + 49 + To run everything we did, from scratch: 50 + 51 + ``` 52 + $ just cost-models # approx 10m 53 + $ just selections --compare 2>&1 | tee ../analysis/current/log # approx 1hr 30m 54 + ```