{"id":17791217,"url":"https://github.com/schell/dagga","last_synced_at":"2025-03-17T08:08:55.898Z","repository":{"id":142265791,"uuid":"611022442","full_name":"schell/dagga","owner":"schell","description":"DAG scheduler with nice constraint semantics","archived":false,"fork":false,"pushed_at":"2024-09-15T18:23:45.000Z","size":56,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-04T09:11:28.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-08T00:12:37.000Z","updated_at":"2024-11-30T09:48:52.000Z","dependencies_parsed_at":"2023-07-19T07:00:24.766Z","dependency_job_id":null,"html_url":"https://github.com/schell/dagga","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schell%2Fdagga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schell%2Fdagga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schell%2Fdagga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schell%2Fdagga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schell","download_url":"https://codeload.github.com/schell/dagga/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997086,"owners_count":20380980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T10:50:16.226Z","updated_at":"2025-03-17T08:08:55.881Z","avatar_url":"https://github.com/schell.png","language":"Rust","readme":"# dagga 🌿\nA crate for scheduling directed acyclic graphs.\n\n## Features\n\n- node `creates` resources semantics\n- node `reads` resource semantics, ie borrow\n- `writes` resource semantics, ie mutable/exclusive borrow\n- `consumes` resource semantics, ie move\n- node dependencies\n  * node X must run _before_ node Y\n  * node X must run _after_ node Y\n  * barriers - nodes added before a barrier will always be scheduled before the barrier and nodes added after a barrier will always be scheduled after the barrier\n\n## Example uses\n* scheduling parallel operations with dependencies, shared and exclusive resources\n* scheduling steps in a render graph\n* scheduling system batches in ECS\n* scheduling audio nodes in an audio graph\n\n## Example\n\n```rust\nuse dagga::*;\n\n// Create names/values for our resources.\n//\n// These represent the types of the resources that get created, passed through\n// and consumed by each node.\nlet [a, b, c, d]: [usize; 4] = [0, 1, 2, 3];\n\n// Add the nodes with their dependencies and build the schedule.\n// The order they are added should not matter (it may cause differences in\n// scheduling, but always result in a valid schedule).\nlet dag = Dag::\u003c(), usize\u003e::default()\n    .with_node({\n        // This node results in the creation of an `a`.\n        Node::new(()).with_name(\"create-a\").with_result(a)\n    })\n    .with_node({\n        // This node creates a `b`.\n        Node::new(()).with_name(\"create-b\").with_result(b)\n    })\n    .with_node({\n        // This node reads `a` and `b` and results in `c`\n        Node::new(())\n            .with_name(\"create-c\")\n            .with_read(a)\n            .with_read(b)\n            .with_result(c)\n    })\n    .with_node({\n        // This node modifies `a`, but for reasons outside of the scope of the types\n        // expressed here (just as an example), it must be run before\n        // \"create-c\". There is no result of this node beside the side-effect of\n        // modifying `a`.\n        Node::new(())\n            .with_name(\"modify-a\")\n            .with_write(a)\n            .with_read(b)\n            .run_before(\"create-c\")\n    })\n    .with_node({\n        // This node consumes `a`, `b`, `c` and results in `d`.\n        Node::new(())\n            .with_name(\"reduce-abc-to-d\")\n            .with_move(a)\n            .with_move(b)\n            .with_move(c)\n            .with_result(d)\n    });\n\ndagga::assert_batches(\n    \u0026[\n        \"create-a, create-b\", /* each batch can be run in parallel w/o violating\n                                * exclusive borrows */\n        \"modify-a\",\n        \"create-c\",\n        \"reduce-abc-to-d\",\n    ],\n    dag.clone(),\n);\n```\n\nYou can also have `dagga` create a dot graph file to visualize the schedule (using graphiz or similar):\n![dagga example schedule](example.svg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschell%2Fdagga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschell%2Fdagga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschell%2Fdagga/lists"}