---
# System prepended metadata

title: Contribution Report

---

# Contribution Report

In [this archive](https://github.com/users/martinjonsson01/projects/4/archive), 90% of all things that have been done, both in the thesis and the code, has been documented along with its main author.

[TOC]

## Martin Jonsson

### Areas of responsibility

* Planning
  * Created project idea.
  * Group leader: I run the meetings, makes sure the project is progressing and handle any disputes.
* Information gathering/reading part
  * Researched the different parts of an ECS engine and different ways in which they could be implemented.
* Methods – choice/development
  * Set up and prepared GitHub repository, Kanban board, document templates for all required documents.
  * Suggested implementation language (Rust) and all of the main libraries that were used in the project.
  * Discussed and decided on benchmarking methods together with Edvin
* Implementation
  * Worked on scheduler prototype
    * Implemented threadpool as a work-stealing scheduler
    * Implemented precedence graph generation
  * MVP
    * Implemented boilerplate with Jacob and Edvin
    * Implemented and reworked scheduler prototype to be production-ready
  * Engine Development
    * Implemented WorkerPool
    * Implemented PrecedenceGraph
    * Implemented rendering engine
    * Implemented RECS rendering-plugin (along with Mathias)
    * Integrated parallel parameter fetching into WorkerPool
    * Implemented command buffers
    * Implemented batched entity-creation
    * Implemented both case studies:
      * Rain simulation
      * N-body simulation
    * Implemented benchmarks for both case studies in our own engine and in Bevy.

### Contribution to problem-solving, synthesis and analysis
* Problem-solving
  * Solved problems related to task scheduling and workload distribution using task stealing
  * Figured out, together with Mathias, a good design for integrating plugins neatly into the engine
* Creativity, wealth of ideas
  * Participated in numerous discussions regarding engine design during meetings

* Analysis of project-related material
  * Looked into application of Linda coordination language as a possible concurrency mechanism.
* Contribution to discussion
  * Carefully reviewed and gave feedback on every single code-contribution to the entire project
  * Reviewed and gave feedback on almost every part of the entire thesis
* Conclusions
  * Discussed benchmark-results with Jacob to figure out what our conclusions could be. Reviewed, rewrote parts of, and gave feedback on the conclusion-section of the thesis.

### Main author of sections
* State sections
  * Project Plan
    * Title
    * Background
      * Concurrent Scheduling of Systems
      * Handling Addition and Removal of Components and Entities
      * Querying of Entities and Components
      * Interactions Between Entities
      * Component Data Storage
    * Problem Statement
    * Method
      * Framework and Languages
  * Thesis
      * Title
      * Abstract
      * Introduction
          * Problem Statement
      * Anatomy of an ECS-Engine
        * Concurrent Scheduling of Systems
        * Queries and Interactions Between Entities
        * The von Neumann Bottleneck and the Challenge of ECS Component Data Storage
        * Data Structures in ECS
      * Method
          * Choice of Programming Language and its Features
            * Though, later heavily revised by Mathias
          * Benchmarking, Testing and Validation
      * The RECS-Engine
        * Entire chapter
      * Performance Evaluation
        * Co-wrote the evaluation, analysis and discussion-parts together with Linn and Jacob.

All of the above sections were thoroughly reviewed and edited by all members of the group.

## Mathias Prétot

### Areas of responsibility

* Planning
    * Helped with adding and prioritizing issues during meetings
* Information gathering/reading part
    * How to use an ECS and how to implement different parts of the ECS
    * Generally about concurrency and parallelism
    * A lot about Rust as well, as it was a completely new langueage to learn
* Implementation
    *  Prototyping: Querying
        * Exploring how querying should work
        * Mostly focused on how mutable/immutable access to components should work.
    * Implemented RECS rendering-plugin (along with Martin)

### Contribution to problem-solving, synthesis and analysis
* Problem-solving
    * Found togehter with Martin a good solution to implement the graphics plugin decoupled from the simulation part of the engine
* Analysis of project-related material
    * Reviewed several code PRs
    * Reviewed many parts of the Thesis
* Contribution to discussion
    * Tried to contribute to discussions whenever possible during our meetings or slack conversations (can't think of anything concrete, but as mention, tried to be vocal during meetings)

### Main author of sections
* State sections
    * Project Plan
        * Limitations
        * Schedule

    * Thesis
        * Introduction
            * Delimitations and Scope
        * Background
            * Smallar parts of Concurrent Scheduling of Systems(larger parts were removed due to word limit)
        * Method
            * Choice of Programming Language and Its Features
            * Engine Development and Case Studies (been heavily reduced due to word limit)
        * Implementation
            * Querying
                * Use of Unsafe Rust
            * Rendering and Simulation Thread Decoupling
        * Performance Evaluation
            * Generated the graphs for the N-body simulation
            * The non discussion part of the N-body simulation
            * The non discussion part of the ECS Benchmark Suite
        * Discussion and Conclusion
            * Conclusion
        * Bibiography
            * Reviewed and edited references to better match IEEE and be more consistent
        * Appendices
            * Appendix A
            * Appendix C
            * Appendix D
            
All of the above sections were thoroughly reviewed and edited by all members of the group.


## Jacob Bredin

### Areas of responsibility

* Planning
  * Contributed to the planning of the kanban issues.
* Information gathering/reading part
  * Read about different storage solutions used in ECS.
  * Read about different techniques for achieving high cache locality.
  * Read about benchmarking ECS engines.
  * Learned Rust, and the libraries we used.
* Methods – choice/development
  * Suggested starting development in the form of prototypes
* Implementation
  * Development of the archetype storage prototype with Linn
  * Integrated the archetype storage solution into the MVP
  * Implemented part of the querying functionality for archetypes

### Contribution to problem-solving, synthesis and analysis
* Problem-solving
  * Design the archetype component storage.
  * Came up with a solution for organizing data for querying Archetypes.
* Creativity, wealth of ideas
* Analysis of project-related material
  * Investigated performance issues with iterations, this was not included in the final project. 
* Contribution to discussion
  * Practical implications of the graph results.
  * Contributed to the discussion about results.
* Conclusions

### Main author of sections
* State sections
  * Project Plan
    * Background
        * Introduction to Entity Component System
        * ECS Structure
        * The Need for ECS
  * Half-time presentation
    * Presentation slides
    * Second half of the script
  * Final Report
    * Introduction
      * Last part of the introduction about the different parts of an ECS.
      * 1.1 Purpose and Goal (now rewritten, but with the same meaning).
    * Background
      * Last part of section 2.3 about AOS vs SOA.
    * Implementation
      * 5.2 Component Storage.
    * Performance Evaluation
      * Co-authored analysis of results in sections 6.1, 6.2 and 6.3 with Linn and Martin.

All of the above sections were thoroughly reviewed and edited by all members of the group.


## Christoffer Persson

### Areas of responsibility
* Planning
* Information gathering/reading part
* Methods – choice/development
* Implementation
    * Prototype: Scheduler
    * Adding/removing of components during runtime
    * Makespan reduction
* Project Diary
* Relevant material reaching examination team

### Contribution to problem-solving, synthesis and analysis
* Problem-solving
* Creativity, wealth of ideas
  * Participated in numerous discussions regarding engine design during meetings
* Creation of model
    * Scheduler
* Analysis of project-related material
    * Concurrency related topics
* Contribution to discussion
* Conclusions

### Main author of sections
* Project plan:
    * Purpose
    * Goal
    * Method: 
        * Prototyping
        * N-body Case Study
        * Profiling Tool
* Thesis
    * Implementation
        * System scheduler
    * Discussion
        * System scheduler improvement avenues

All of the above sections were thoroughly reviewed and edited by all members of the group.



## Linn Österlund

### Areas of responsibility
* Planning
    * Responsible for the report and the written part of the project
    * Takes notes during meetings, main responsible for meeting minutes
    * Contributed to the planning of the kanban issues.
* Information gathering/reading part
    * Research ECS and Rust
    * Read about different storage solutions used in ECS.
    * Read up on ethical aspects of the game development industry
    * Read up on agile workflow and Kanban for our project
* Methods – choice/development
* Implementation
    * Prototype: Component Data Storage with Jacob
    * Archetype implementation: Entity access from querying

### Contribution to problem-solving, synthesis and analysis
* Problem-solving
  * Design the archetype component storage.
* Creativity, wealth of ideas
  * Introduced the idea of the rain simulation to complement the n-body simulation in benchmarking the engine
* Creation of model
* Analysis of project-related material
* Contribution to discussion
* Conclusions

### Main author of sections
* Project Plan
    * Method
        * Introduction
        * Workflow
    * Ethical Aspects
    * (Helped restructure background)
* Thesis
    * Acknowledgement
    * Introduction
      * Opening section
    * Background
      * Parts on Data Structures in ECS
    * Method
    * The RECS-engine
    * Implementation
      * Co-author on Component Storage
    * Performance Evaluation
      * Co-wrote the evaluation, analysis and discussion-parts together with Martin and Jacob.
    * Discussion
      * Component Storage Improvements Avenues
* Reviewed and main editor of conclusion, discussion scheduler and all sections concerning data storage as well. 
All of the above sections were thoroughly reviewed and edited by all members of the group.

## Edvin Nilsson

### Areas of responsibility

* Planning
* Information gathering/reading part
  * General information about the ECS architecture and Rust.
  * A lot about how lifetimes work in Rust.
  * Researched the history of ECS and the current industry state of ECS.
* Methods – choice/development
    * Choice of benchmarking methods (with discussion with Martin)
* Implementation
    * Working on querying prototype
        * Implemented basic querying with support for reading and writing to components. 
        * Implemented support for multiple components using Rust macros.
        * Implemented querying filters for querying prototype.
    * MVP
        * Implemented boilerplate (with Martin and Jacob).
        * Integrated querying with the archetype implementation.
        * Implemented archetype-level querying filters using set operations.
    * Engine Development
        * Implemented querying that allows foreign entity access.
        * Implemented parallel parameter fetching to allow high performing intra-system-parallelization.
        * Performed performance analysis by using tools like Perf to find bottlenecks within the engine.
        * Restructured querying implementation to allow higher performance and cleaner code.
        * Implemented N-body benchmarks in Unity GameObjects, Unity ECS and with EnTT.
        * Compiled and ran all benchmarks for N-body, rain simulation and micro-benchmarks.
        * Implemented rain simulation benchmark in EnTT (never completely finished and used due to time constraint)


### Contribution to problem-solving, synthesis and analysis
* Problem-solving
    * Solved problems on how to handle querying by abstracting system parameters.
* Creativity, wealth of ideas
    * Participated in many discussions about engine development and brought up new ideas during meetings.
* Creation of model
* Analysis of project-related material
  * Reviewed many code PRs
  * Reviewed many sections of the thesis
  * Performed performance analysis of the application
* Contribution to discussion
  * Been involved in many discussions about engine design and other implementations details, during meetings and reviews.
* Conclusions

### Main author of sections
* State sections
    * Project Plan
        * Background
            * History of ECS
        * Method
            * Benchmarking and Testing
    * Thesis
      * Introduction
        * (benefits and drawback between OOP and ECS)
      * Anatomy of an ECS-Engine
        * Related Works (cut out due to space constraints)
      * Method
        * Benchmarking, Testing and Validation
      * Implementation
        * Querying
          * Abstraction of System Parameters
          * Read and Write
          * Filters
          * Query
          * Entity
          * Commands
          * System Iteration
      * Performance Evaluation
        * (system configuration) 
        * N-Body Simulation
          * (cache miss-rate)

All of the above sections were thoroughly reviewed and edited by all members of the group.


